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

Thu, 15 Jan 2015 21:13:52 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:13:52 +0100
branch
TOR_BUG_9701
changeset 12
7540298fafa1
permissions
-rw-r--r--

Remove forgotten relic of ABI crash risk averse overloaded method change.

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-height" and "max-height" affect the sizing
michael@0 8 of vertical flex containers that have no explicit "height" 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-height and max-height 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-1-ref.xhtml"/>
michael@0 16 <style>
michael@0 17 div { width: 10px; }
michael@0 18 div.flexbox {
michael@0 19 float: left;
michael@0 20 border: 1px dashed blue;
michael@0 21 font-size: 10px;
michael@0 22 display: flex;
michael@0 23 flex-direction: column;
michael@0 24 margin-right: 2px;
michael@0 25 }
michael@0 26 div.a {
michael@0 27 flex: 1 20px;
michael@0 28 max-height: 60px;
michael@0 29 background: lightgreen;
michael@0 30 }
michael@0 31 div.b {
michael@0 32 flex: 1 20px;
michael@0 33 min-height: 40px;
michael@0 34 max-height: 60px;
michael@0 35 background: purple;
michael@0 36 }
michael@0 37 div.c {
michael@0 38 flex: 1 40px;
michael@0 39 min-height: 10px;
michael@0 40 max-height: 60px;
michael@0 41 background: orange;
michael@0 42 }
michael@0 43 </style>
michael@0 44 </head>
michael@0 45 <body>
michael@0 46 <!-- floated auto-sized vertical flexbox should shrinkwrap its flex items'
michael@0 47 hypothetical main sizes (their flex base sizes, clamped to min/max) -->
michael@0 48 <div class="flexbox">
michael@0 49 <div class="a"/><div class="b"/><div class="c"/>
michael@0 50 </div>
michael@0 51
michael@0 52 <!-- Adding a small min-size shouldn't affect that. -->
michael@0 53 <div class="flexbox" style="min-height: 10px">
michael@0 54 <div class="a"/><div class="b"/><div class="c"/>
michael@0 55 </div>
michael@0 56
michael@0 57 <!-- ...nor should a large max-size. -->
michael@0 58 <div class="flexbox" style="max-height: 300px">
michael@0 59 <div class="a"/><div class="b"/><div class="c"/>
michael@0 60 </div>
michael@0 61
michael@0 62 <!-- OK. Now, if we set a minimum size that's larger than the shrinkwrap
michael@0 63 size, we should jump up to that size.-->
michael@0 64 <div class="flexbox" style="min-height: 120px">
michael@0 65 <div class="a"/><div class="b"/><div class="c"/>
michael@0 66 </div>
michael@0 67
michael@0 68 <!-- ...even if it's large enough that our items won't occupy all the
michael@0 69 space. -->
michael@0 70 <div class="flexbox" style="min-height: 200px">
michael@0 71 <div class="a"/><div class="b"/><div class="c"/>
michael@0 72 </div>
michael@0 73
michael@0 74 <!-- If we set a maximum size that's smaller than the shrinkwrap size,
michael@0 75 we should max out at that size.-->
michael@0 76 <div class="flexbox" style="max-height: 70px">
michael@0 77 <div class="a"/><div class="b"/><div class="c"/>
michael@0 78 </div>
michael@0 79
michael@0 80 <!-- The max-size may be small enough that our items will overflow. -->
michael@0 81 <div class="flexbox" style="max-height: 20px">
michael@0 82 <div class="a"/><div class="b"/><div class="c"/>
michael@0 83 </div>
michael@0 84
michael@0 85 <!-- But if we add a min-size, it beats the max-size. Here, we use a
michael@0 86 min-size smaller than the sum of the items' base sizes... -->
michael@0 87 <div class="flexbox" style="min-height: 58px; max-height: 20px">
michael@0 88 <div class="a"/><div class="b"/><div class="c"/>
michael@0 89 </div>
michael@0 90
michael@0 91 <!-- ...and here we use a min-size larger than the sum of the items'
michael@0 92 base sizes. -->
michael@0 93 <div class="flexbox" style="min-height: 140px; max-height: 20px">
michael@0 94 <div class="a"/><div class="b"/><div class="c"/>
michael@0 95 </div>
michael@0 96
michael@0 97 </body>
michael@0 98 </html>

mercurial