1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/w3c-css/submitted/flexbox/flexbox-collapsed-item-horiz-1.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,98 @@ 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 +<html> 1.10 +<head> 1.11 + <title>CSS Test: Testing that visibility:collapse on a flex item in a single-line flex container maintains the containers's cross size, but doesn't otherwise impact flex layout</title> 1.12 + <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> 1.13 + <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#algo-visibility"> 1.14 + <link rel="match" href="flexbox-collapsed-item-horiz-1-ref.html"> 1.15 + <meta charset="utf-8"> 1.16 + <style> 1.17 + .flexContainer { 1.18 + display: flex; 1.19 + background: yellow; 1.20 + border: 1px dotted black; 1.21 + float: left; 1.22 + margin: 5px; 1.23 + } 1.24 + .flexContainer > * { 1.25 + /* All flex items have 20px base size */ 1.26 + width: 20px; 1.27 + } 1.28 + .collapse { 1.29 + visibility: collapse; 1.30 + } 1.31 + .flexible { 1.32 + flex: 1 auto; 1.33 + } 1.34 + .heightTall { 1.35 + height: 40px; 1.36 + background: purple; 1.37 + } 1.38 + .heightAuto { 1.39 + background: teal; 1.40 + } 1.41 + .heightShort { 1.42 + height: 10px; 1.43 + background: pink; 1.44 + } 1.45 + </style> 1.46 +</head> 1.47 +<body> 1.48 + <!-- FIRST ROW: --> 1.49 + <!-- Just one (collapsed) flex item, which ends up establishing 1.50 + the container's size (even though it's collapsed): --> 1.51 + <div class="flexContainer"> 1.52 + <div class="heightTall collapse"></div> 1.53 + </div> 1.54 + 1.55 + <div style="clear: both"></div> 1.56 + 1.57 + <!-- SECOND ROW: --> 1.58 + <!-- One collapsed flex item, one short flex item. 1.59 + (Container ends up with collapsed item's height) --> 1.60 + <div class="flexContainer"> 1.61 + <div class="heightTall collapse"></div> 1.62 + <div class="heightShort"></div> 1.63 + </div> 1.64 + <!-- (same, but with items in opposite order) --> 1.65 + <div class="flexContainer"> 1.66 + <div class="heightShort"></div> 1.67 + <div class="heightTall collapse"></div> 1.68 + </div> 1.69 + 1.70 + <div style="clear: both"></div> 1.71 + 1.72 + <!-- THIRD ROW: --> 1.73 + <!-- One collapsed flex item, one stretched flex item. 1.74 + (Container and stretched item end up with collapsed item's height) --> 1.75 + <div class="flexContainer"> 1.76 + <div class="heightTall collapse"></div> 1.77 + <div class="heightAuto"></div> 1.78 + </div> 1.79 + <!-- (again, with items in opposite order) --> 1.80 + <div class="flexContainer"> 1.81 + <div class="heightAuto"></div> 1.82 + <div class="heightTall collapse"></div> 1.83 + </div> 1.84 + 1.85 + <div style="clear: both"></div> 1.86 + 1.87 + <!-- FOURTH ROW: --> 1.88 + <!-- One collapsed flex item, one other flex item; both are flexible. 1.89 + (The non-collapsed one should take all of the available width.) --> 1.90 + <div class="flexContainer"> 1.91 + <div class="heightAuto flexible collapse"></div> 1.92 + <div class="heightTall flexible"></div> 1.93 + </div> 1.94 + <!-- (again, with items in opposite order) --> 1.95 + <div class="flexContainer"> 1.96 + <div class="heightTall flexible"></div> 1.97 + <div class="heightAuto flexible collapse"></div> 1.98 + </div> 1.99 + 1.100 +</body> 1.101 +</html>