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-2.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,111 @@ 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 multi-line flex container creates struts, and that they can migrate between lines</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-2-ref.html"> 1.15 + <meta charset="utf-8"> 1.16 + <style> 1.17 + .flexContainer { 1.18 + display: flex; 1.19 + flex-wrap: wrap; 1.20 + 1.21 + /* These let us show where each flex line begins (and hence, how tall 1.22 + the flex lines end up) */ 1.23 + align-content: flex-start; 1.24 + align-items: flex-start; 1.25 + 1.26 + width: 30px; 1.27 + background: yellow; 1.28 + border: 1px dotted black; 1.29 + float: left; 1.30 + margin: 5px; 1.31 + } 1.32 + .collapsedItem { 1.33 + visibility: collapse; 1.34 + width: 15px; 1.35 + height: 25px; 1.36 + } 1.37 + .halfWidthItem { 1.38 + width: 15px; 1.39 + height: 15px; 1.40 + background: teal; 1.41 + } 1.42 + .fullWidthItem { 1.43 + width: 30px; 1.44 + height: 20px; 1.45 + background: purple; 1.46 + } 1.47 + .veryTallItem { 1.48 + width: 15px; 1.49 + height: 40px; 1.50 + background: olive; 1.51 + } 1.52 + </style> 1.53 +</head> 1.54 +<body> 1.55 + <!-- FIRST ROW: --> 1.56 + <!-- One collapsed flex item, at the beginning of a flex line, which 1.57 + ends up establishing its flex line's cross size: --> 1.58 + <div class="flexContainer"> 1.59 + <div class="collapsedItem"></div> 1.60 + <div class="halfWidthItem"></div> 1.61 + <div class="fullWidthItem"></div> 1.62 + </div> 1.63 + <!-- ...and now with it being at the end of that flex line: --> 1.64 + <div class="flexContainer"> 1.65 + <div class="halfWidthItem"></div> 1.66 + <div class="collapsedItem"></div> 1.67 + <div class="fullWidthItem"></div> 1.68 + </div> 1.69 + 1.70 + <div style="clear: both"></div> 1.71 + 1.72 + <!-- SECOND ROW: --> 1.73 + <!-- One collapsed flex item, initially in its own line. It ends 1.74 + up being merged into another line after it collapses, due to its 1.75 + (post-collapse) zero main-size. --> 1.76 + <div class="flexContainer"> 1.77 + <div class="collapsedItem"></div> 1.78 + <div class="fullWidthItem"></div> 1.79 + <div class="fullWidthItem"></div> 1.80 + </div> 1.81 + <div class="flexContainer"> 1.82 + <div class="fullWidthItem"></div> 1.83 + <div class="collapsedItem"></div> 1.84 + <div class="fullWidthItem"></div> 1.85 + </div> 1.86 + <div class="flexContainer"> 1.87 + <div class="fullWidthItem"></div> 1.88 + <div class="fullWidthItem"></div> 1.89 + <div class="collapsedItem"></div> 1.90 + </div> 1.91 + 1.92 + <div style="clear: both"></div> 1.93 + 1.94 + <!-- THIRD ROW: --> 1.95 + <!-- One collapsed flex item, initially in a line with an even-taller item. 1.96 + The collapsed item ends up shifting into another line after it 1.97 + collapses, but it carries the taller item's cross size with it, as its 1.98 + strut size. --> 1.99 + <div class="flexContainer"> 1.100 + <div class="fullWidthItem"></div> 1.101 + <div class="collapsedItem"></div> 1.102 + <div class="veryTallItem"></div> 1.103 + </div> 1.104 + <!-- ...and now with two (differently-sized) struts in first line: 1.105 + (the one that's taller - due to being initially grouped with the tall 1.106 + item - wins out.) --> 1.107 + <div class="flexContainer"> 1.108 + <div class="collapsedItem"></div> 1.109 + <div class="fullWidthItem"></div> 1.110 + <div class="collapsedItem"></div> 1.111 + <div class="veryTallItem"></div> 1.112 + </div> 1.113 +</body> 1.114 +</html>