OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- |
| 3 Any copyright is dedicated to the Public Domain. |
| 4 http://creativecommons.org/publicdomain/zero/1.0/ |
| 5 --> |
| 6 <!-- This testcase checks flex items are painted atomically. In particular, |
| 7 if one item has content that overflows into the region of another item, |
| 8 then one item is painted "behind" the other; there shouldn't normally |
| 9 any interleaving of backgrounds and content between the two items. |
| 10 |
| 11 This testcase also tests some special cases that will change the paint |
| 12 ordering - specifically, the properties "position", "z-index", and |
| 13 "order" on flex items. |
| 14 --> |
| 15 <!-- This was resolved by the CSSWG in April 2013: |
| 16 http://krijnhoetmer.nl/irc-logs/css/20130403#l-455 --> |
| 17 <html> |
| 18 <head> |
| 19 <title>CSS Test: Testing that flex items paint as pseudo-stacking contexts (li
ke inline-blocks): atomically, in the absence of 'z-index' on descendants</title
> |
| 20 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> |
| 21 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#painting"> |
| 22 <link rel="match" href="flexbox-items-as-stacking-contexts-002-ref.html"> |
| 23 <style> |
| 24 body { font: 10px sans-serif } |
| 25 .flexContainer { |
| 26 background: orange; |
| 27 display: flex; |
| 28 justify-content: space-between; |
| 29 width: 70px; |
| 30 padding: 2px; |
| 31 margin-bottom: 2px; |
| 32 } |
| 33 .item1 { |
| 34 background: lightblue; |
| 35 width: 30px; |
| 36 min-width: 0; /* disable default min-width:auto behavior */ |
| 37 } |
| 38 .item2 { |
| 39 background: yellow; |
| 40 width: 30px; |
| 41 min-width: 0; /* disable default min-width:auto behavior */ |
| 42 } |
| 43 </style> |
| 44 </head> |
| 45 <body> |
| 46 <!-- This container has two flex items, the first of which has content |
| 47 sticking out & overlapping the second. If they're painting atomically |
| 48 (and in the right order), the second item's background should cover the |
| 49 first item's overflowing content. --> |
| 50 <div class="flexContainer" |
| 51 ><div class="item1">ThisIsALongUnbrokenString</div><div class="item2">HereIs
SomeMoreLongText</div></div> |
| 52 |
| 53 <!-- Now, the first item is relatively positioned, which should make it paint |
| 54 on top of everything. --> |
| 55 <div class="flexContainer" |
| 56 ><div class="item1" style="position:relative">ThisIsALongUnbrokenString</div
><div class="item2">HereIsSomeMoreLongText</div></div> |
| 57 |
| 58 <!-- Now, the first item is has "z-index" set, which should make it paint on |
| 59 top of everything. --> |
| 60 <div class="flexContainer" |
| 61 ><div class="item1" style="z-index: 1">ThisIsALongUnbrokenString</div><div c
lass="item2">HereIsSomeMoreLongText</div></div> |
| 62 |
| 63 <!-- Now, the first item has "order" set to a higher value than default, |
| 64 which should make it paint on top (and at the far right) --> |
| 65 <div class="flexContainer" |
| 66 ><div class="item1" style="order: 1">ThisIsALongUnbrokenString</div><div cla
ss="item2">HereIsSomeMoreLongText</div></div> |
| 67 |
| 68 <!-- And for thoroughness, let's set "order" to a lower value than default, |
| 69 on the second item. (Should render the same as previous example.) --> |
| 70 <div class="flexContainer" |
| 71 ><div class="item1">ThisIsALongUnbrokenString</div><div class="item2" style=
"order: -1">HereIsSomeMoreLongText</div></div> |
| 72 |
| 73 <!-- ...but if we relatively position that second item, it should paint |
| 74 on top again, despite its low "order" value. --> |
| 75 <div class="flexContainer" |
| 76 ><div class="item1">ThisIsALongUnbrokenString</div><div class="item2" style=
"order: -1; position: relative">HereIsSomeMoreLongText</div></div> |
| 77 </body> |
| 78 </html> |
OLD | NEW |