1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/w3c-css/submitted/flexbox/flexbox-with-pseudo-elements-2.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,79 @@ 1.4 +<!DOCTYPE html> 1.5 +<!-- 1.6 + Any copyright is dedicated to the Public Domain. 1.7 + http://creativecommons.org/publicdomain/zero/1.0/ 1.8 +--> 1.9 +<!-- Testcase to ensure we handle ::before and ::after pseudo-elements on 1.10 + a flex container and treat them as flex items (e.g. honoring "order"). 1.11 +--> 1.12 +<html> 1.13 +<head> 1.14 + <title>CSS Test: Testing that generated content nodes are treated as a flex items, and honor 'order'</title> 1.15 + <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> 1.16 + <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#flex-items"> 1.17 + <link rel="match" href="flexbox-with-pseudo-elements-2-ref.html"> 1.18 + <meta charset="utf-8"> 1.19 + <style> 1.20 + .flexContainer { 1.21 + display: flex; 1.22 + margin-bottom: 2px; 1.23 + background: lightgray; 1.24 + } 1.25 + .withBefore::before { 1.26 + content: 'b'; 1.27 + background: yellow; 1.28 + /* This 'order' value should place us after the other elements, visually, 1.29 + even though we're ::before. */ 1.30 + order: 1; 1.31 + } 1.32 + .withAfter::after { 1.33 + content: 'a'; 1.34 + background: lightblue; 1.35 + /* This 'order' value should place us before the other elements, visually, 1.36 + even though we're ::after. */ 1.37 + order: -1; 1.38 + } 1.39 + </style> 1.40 +</head> 1.41 +<body> 1.42 + <!-- 'b' should be at end, due to its high 'order' value: --> 1.43 + <div class="flexContainer withBefore"> 1.44 + <div>I</div> 1.45 + </div> 1.46 + 1.47 + <!-- 'b' should be at beginning, since it's '::before' and the other item has 1.48 + a matching 'order' value: --> 1.49 + <div class="flexContainer withBefore"> 1.50 + <div style="order: 1">I</div> 1.51 + </div> 1.52 + 1.53 + <!-- 'a' should be at beginning, due to its low 'order' value: --> 1.54 + <div class="flexContainer withAfter"> 1.55 + <div>I</div> 1.56 + </div> 1.57 + 1.58 + <!-- 'b' should be at beginning, since it's '::after' and the other item has 1.59 + a matching 'order' value: --> 1.60 + <div class="flexContainer withAfter"> 1.61 + <div style="order: -1">I</div> 1.62 + </div> 1.63 + 1.64 + <!-- As above, the ::after 'a' should be at beginning, and the ::before 'b' 1.65 + should be at end, due to their 'order' values --> 1.66 + <div class="flexContainer withBefore withAfter"> 1.67 + <div>I</div> 1.68 + </div> 1.69 + 1.70 + <!-- ...but now the normal item "I" has its order increased, so it'll go 1.71 + at the end. --> 1.72 + <div class="flexContainer withBefore withAfter"> 1.73 + <div style="order: 1">I</div> 1.74 + </div> 1.75 + 1.76 + <!-- ...and now the normal item "I" has its order reduced, so it'll go 1.77 + at the beginning. --> 1.78 + <div class="flexContainer withBefore withAfter"> 1.79 + <div style="order: -1">I</div> 1.80 + </div> 1.81 +</body> 1.82 +</html>