layout/reftests/w3c-css/submitted/flexbox/flexbox-sizing-vert-2.xhtml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <?xml version="1.0" encoding="UTF-8"?>
michael@0 2 <!--
michael@0 3 Any copyright is dedicated to the Public Domain.
michael@0 4 http://creativecommons.org/publicdomain/zero/1.0/
michael@0 5 -->
michael@0 6 <!--
michael@0 7 This testcase checks how "min-width" and "max-width" affect the sizing
michael@0 8 of vertical flex containers that have no explicit "width" property.
michael@0 9 -->
michael@0 10 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 11 <head>
michael@0 12 <title>CSS Test: Testing sizing of an auto-sized vertical flex container with min-width and max-width constraints</title>
michael@0 13 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/>
michael@0 14 <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#layout-algorithm"/>
michael@0 15 <link rel="match" href="flexbox-sizing-vert-2-ref.xhtml"/>
michael@0 16 <style>
michael@0 17 div { height: 100px; }
michael@0 18 div.flexbox {
michael@0 19 float: left;
michael@0 20 border: 1px dashed blue;
michael@0 21 background: lightgreen;
michael@0 22 font-size: 10px;
michael@0 23 display: flex;
michael@0 24 margin-right: 10px;
michael@0 25 }
michael@0 26 </style>
michael@0 27 </head>
michael@0 28 <body>
michael@0 29 <!-- floated auto-width vertical flexbox should shrinkwrap its contents. -->
michael@0 30 <div class="flexbox">
michael@0 31 <div>AB</div>
michael@0 32 </div>
michael@0 33
michael@0 34 <!-- Adding a small min-size shouldn't affect that. -->
michael@0 35 <div class="flexbox" style="min-width: 2px">
michael@0 36 <div>AB</div>
michael@0 37 </div>
michael@0 38
michael@0 39 <!-- ...nor should a large max-size. -->
michael@0 40 <div class="flexbox" style="max-width: 300px">
michael@0 41 <div>AB</div>
michael@0 42 </div>
michael@0 43
michael@0 44 <!-- OK. Now, if we set a minimum size that's larger than the shrinkwrap
michael@0 45 size, we should jump up to that size.-->
michael@0 46 <div class="flexbox" style="min-width: 30px">
michael@0 47 <div>AB</div>
michael@0 48 </div>
michael@0 49
michael@0 50 <!-- If we set a maximum size that's smaller than the shrinkwrap size,
michael@0 51 we should max out at that size.-->
michael@0 52 <div class="flexbox" style="max-width: 3px">
michael@0 53 <div>AB</div>
michael@0 54 </div>
michael@0 55
michael@0 56 <!-- But if we add a min-size, it beats the max-size. -->
michael@0 57 <div class="flexbox" style="min-width: 30px; max-width: 5px">
michael@0 58 <div>AB</div>
michael@0 59 </div>
michael@0 60
michael@0 61 </body>
michael@0 62 </html>

mercurial