OLD | NEW |
(Empty) | |
| 1 <?xml version="1.0" encoding="UTF-8"?> |
| 2 <!-- |
| 3 Any copyright is dedicated to the Public Domain. |
| 4 http://creativecommons.org/publicdomain/zero/1.0/ |
| 5 --> |
| 6 <!-- |
| 7 Testcase with table parts inside of a flex container, triggering |
| 8 table-fixup. We use justify-content:space-between to stick packing |
| 9 space between flex items, so that we can verify that e.g. a contiguous |
| 10 run of <td>s will end up in the same flex item (wrapped in a table). |
| 11 --> |
| 12 <html xmlns="http://www.w3.org/1999/xhtml"> |
| 13 <head> |
| 14 <title>CSS Test: Testing that table cells in a flex container get an anonymo
us table wrapper that forms the flex item</title> |
| 15 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"
/> |
| 16 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#flex-items"/> |
| 17 <link rel="match" href="flexbox-table-fixup-001-ref.xhtml"/> |
| 18 <style> |
| 19 div.flexbox { |
| 20 border: 1px dashed blue; |
| 21 width: 200px; |
| 22 display: flex; |
| 23 justify-content: space-around; |
| 24 } |
| 25 |
| 26 <!-- NOTE: table-fixup pads each td element by 1px on each side. We |
| 27 override that for top & bottom, for simplicity. So the td makes us |
| 28 generate a box that's 2px wider than its contents. --> |
| 29 td { |
| 30 padding-top: 0px; |
| 31 padding-bottom: 0px; |
| 32 } |
| 33 |
| 34 .a { |
| 35 background: lightgreen; |
| 36 width: 48px; |
| 37 } |
| 38 |
| 39 .b { |
| 40 background: yellow; |
| 41 width: 48px; |
| 42 } |
| 43 |
| 44 .c { |
| 45 background: pink; |
| 46 width: 48px; |
| 47 } |
| 48 </style> |
| 49 </head> |
| 50 <body> |
| 51 <!-- Just 2 adjacent table cells (they end up in the same table) --> |
| 52 <div class="flexbox" |
| 53 ><td class="a">cell1</td><td class="b">cell2</td></div> |
| 54 |
| 55 <!-- Table cell followed by tbody (they end up in the same table) --> |
| 56 <div class="flexbox" |
| 57 ><td class="a">cell1</td><tbody class="b">t</tbody></div> |
| 58 |
| 59 <!-- Empty table cell (ends up occupying 2px of width), followed by div, |
| 60 followed by nonempty table cell. (3 flex items). --> |
| 61 <!-- Note: We use "space-between" (instead of "space-around") here because |
| 62 it makes the math cleaner. (100px split 2 ways instead of 3 ways.) --> |
| 63 <div class="flexbox" style="justify-content: space-between" |
| 64 ><td></td><div class="c">div</div><td class="b">cell1</td></div> |
| 65 </body> |
| 66 </html> |
OLD | NEW |