1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/w3c-css/submitted/flexbox/flexbox-table-fixup-1b.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,74 @@ 1.4 +<?xml version="1.0" encoding="UTF-8"?> 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 +<!-- 1.10 + Testcase with table parts inside of a flex container, triggering 1.11 + table-fixup. We use justify-content:space-between to stick packing 1.12 + space between flex items, so that we can verify that e.g. a contiguous 1.13 + run of <td>s will end up in the same flex item (wrapped in a table). 1.14 + 1.15 + In this variant of the test, we also assign 'flex' values to the 1.16 + table parts - these values should have no effect, since these children 1.17 + don't themselves form flex items. The flex property _is_ honored on 1.18 + the <div class="c">, though, because _its_ box _is_ a direct child of a 1.19 + flexbox, so it _is_ a flex item. 1.20 +--> 1.21 +<html xmlns="http://www.w3.org/1999/xhtml"> 1.22 + <head> 1.23 + <title>CSS Test: Testing that the 'flex' shorthand has no effect on table cells in a flex container, since they aren't flex items</title> 1.24 + <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> 1.25 + <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#flex-items"/> 1.26 + <link rel="match" href="flexbox-table-fixup-1-ref.xhtml"/> 1.27 + <style> 1.28 + div.flexbox { 1.29 + border: 1px dashed blue; 1.30 + width: 200px; 1.31 + display: flex; 1.32 + justify-content: space-around; 1.33 + } 1.34 + 1.35 + <!-- NOTE: table-fixup pads each td element by 1px on each side. We 1.36 + override that for top & bottom, for simplicity. So the td makes us 1.37 + generate a box that's 2px wider than its contents. --> 1.38 + td { 1.39 + padding-top: 0px; 1.40 + padding-bottom: 0px; 1.41 + } 1.42 + 1.43 + .a { 1.44 + background: lightgreen; 1.45 + width: 48px; 1.46 + flex: 5 3 100px; 1.47 + } 1.48 + 1.49 + .b { 1.50 + background: yellow; 1.51 + width: 48px; 1.52 + flex: 1 2 3px; 1.53 + } 1.54 + 1.55 + .c { 1.56 + background: pink; 1.57 + flex: 0 0 48px; 1.58 + } 1.59 + </style> 1.60 + </head> 1.61 + <body> 1.62 + <!-- Just 2 adjacent table cells (they end up in the same table) --> 1.63 + <div class="flexbox" 1.64 + ><td class="a">cell1</td><td class="b">cell2</td></div> 1.65 + 1.66 + <!-- Table cell followed by tbody (they end up in the same table) --> 1.67 + <div class="flexbox" 1.68 + ><td class="a">cell1</td><tbody class="b">t</tbody></div> 1.69 + 1.70 + <!-- Empty table cell (ends up occupying 2px of width), followed by div, 1.71 + followed by nonempty table cell. (3 flex items). --> 1.72 + <!-- Note: We use "space-between" (instead of "space-around") here because 1.73 + it makes the math cleaner. (100px split 2 ways instead of 3 ways.) --> 1.74 + <div class="flexbox" style="justify-content: space-between" 1.75 + ><td></td><div class="c">div</div><td class="b">cell1</td></div> 1.76 + </body> 1.77 +</html>