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 In this variant of the test, we also assign 'flex' values to the |
| 13 table parts - these values should have no effect, since these children |
| 14 don't themselves form flex items. The flex property _is_ honored on |
| 15 the <div class="c">, though, because _its_ box _is_ a direct child of a |
| 16 flexbox, so it _is_ a flex item. |
| 17 --> |
| 18 <html xmlns="http://www.w3.org/1999/xhtml"> |
| 19 <head> |
| 20 <title>CSS Test: Testing that the 'flex' shorthand has no effect on table ce
lls in a flex container, since they aren't flex items</title> |
| 21 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"
/> |
| 22 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#flex-items"/> |
| 23 <link rel="match" href="flexbox-table-fixup-001-ref.xhtml"/> |
| 24 <style> |
| 25 div.flexbox { |
| 26 border: 1px dashed blue; |
| 27 width: 200px; |
| 28 display: flex; |
| 29 justify-content: space-around; |
| 30 } |
| 31 |
| 32 <!-- NOTE: table-fixup pads each td element by 1px on each side. We |
| 33 override that for top & bottom, for simplicity. So the td makes us |
| 34 generate a box that's 2px wider than its contents. --> |
| 35 td { |
| 36 padding-top: 0px; |
| 37 padding-bottom: 0px; |
| 38 } |
| 39 |
| 40 .a { |
| 41 background: lightgreen; |
| 42 width: 48px; |
| 43 flex: 5 3 100px; |
| 44 } |
| 45 |
| 46 .b { |
| 47 background: yellow; |
| 48 width: 48px; |
| 49 flex: 1 2 3px; |
| 50 } |
| 51 |
| 52 .c { |
| 53 background: pink; |
| 54 flex: 0 0 48px; |
| 55 } |
| 56 </style> |
| 57 </head> |
| 58 <body> |
| 59 <!-- Just 2 adjacent table cells (they end up in the same table) --> |
| 60 <div class="flexbox" |
| 61 ><td class="a">cell1</td><td class="b">cell2</td></div> |
| 62 |
| 63 <!-- Table cell followed by tbody (they end up in the same table) --> |
| 64 <div class="flexbox" |
| 65 ><td class="a">cell1</td><tbody class="b">t</tbody></div> |
| 66 |
| 67 <!-- Empty table cell (ends up occupying 2px of width), followed by div, |
| 68 followed by nonempty table cell. (3 flex items). --> |
| 69 <!-- Note: We use "space-between" (instead of "space-around") here because |
| 70 it makes the math cleaner. (100px split 2 ways instead of 3 ways.) --> |
| 71 <div class="flexbox" style="justify-content: space-between" |
| 72 ><td></td><div class="c">div</div><td class="b">cell1</td></div> |
| 73 </body> |
| 74 </html> |
OLD | NEW |