1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/w3c-css/submitted/flexbox/flexbox-sizing-vert-2.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 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 + This testcase checks how "min-width" and "max-width" affect the sizing 1.11 + of vertical flex containers that have no explicit "width" property. 1.12 +--> 1.13 +<html xmlns="http://www.w3.org/1999/xhtml"> 1.14 + <head> 1.15 + <title>CSS Test: Testing sizing of an auto-sized vertical flex container with min-width and max-width constraints</title> 1.16 + <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> 1.17 + <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#layout-algorithm"/> 1.18 + <link rel="match" href="flexbox-sizing-vert-2-ref.xhtml"/> 1.19 + <style> 1.20 + div { height: 100px; } 1.21 + div.flexbox { 1.22 + float: left; 1.23 + border: 1px dashed blue; 1.24 + background: lightgreen; 1.25 + font-size: 10px; 1.26 + display: flex; 1.27 + margin-right: 10px; 1.28 + } 1.29 + </style> 1.30 + </head> 1.31 + <body> 1.32 + <!-- floated auto-width vertical flexbox should shrinkwrap its contents. --> 1.33 + <div class="flexbox"> 1.34 + <div>AB</div> 1.35 + </div> 1.36 + 1.37 + <!-- Adding a small min-size shouldn't affect that. --> 1.38 + <div class="flexbox" style="min-width: 2px"> 1.39 + <div>AB</div> 1.40 + </div> 1.41 + 1.42 + <!-- ...nor should a large max-size. --> 1.43 + <div class="flexbox" style="max-width: 300px"> 1.44 + <div>AB</div> 1.45 + </div> 1.46 + 1.47 + <!-- OK. Now, if we set a minimum size that's larger than the shrinkwrap 1.48 + size, we should jump up to that size.--> 1.49 + <div class="flexbox" style="min-width: 30px"> 1.50 + <div>AB</div> 1.51 + </div> 1.52 + 1.53 + <!-- If we set a maximum size that's smaller than the shrinkwrap size, 1.54 + we should max out at that size.--> 1.55 + <div class="flexbox" style="max-width: 3px"> 1.56 + <div>AB</div> 1.57 + </div> 1.58 + 1.59 + <!-- But if we add a min-size, it beats the max-size. --> 1.60 + <div class="flexbox" style="min-width: 30px; max-width: 5px"> 1.61 + <div>AB</div> 1.62 + </div> 1.63 + 1.64 + </body> 1.65 +</html>