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

Thu, 22 Jan 2015 13:21:57 +0100

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

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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 horizontal 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 horizontal 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-horiz-2-ref.xhtml"/>
michael@0 16 <style>
michael@0 17 div { width: 200px; }
michael@0 18 div.flexbox {
michael@0 19 border: 1px dashed blue;
michael@0 20 background: lightgreen;
michael@0 21 font-size: 10px;
michael@0 22 display: flex;
michael@0 23 margin-bottom: 5px;
michael@0 24 }
michael@0 25 </style>
michael@0 26 </head>
michael@0 27 <body>
michael@0 28 <!-- auto-height horizontal flexbox should shrinkwrap its contents. -->
michael@0 29 <div class="flexbox">
michael@0 30 <div>text</div>
michael@0 31 </div>
michael@0 32
michael@0 33 <!-- Adding a small min-size shouldn't affect that. -->
michael@0 34 <div class="flexbox" style="min-height: 2px">
michael@0 35 <div>text</div>
michael@0 36 </div>
michael@0 37
michael@0 38 <!-- ...nor should a large max-size. -->
michael@0 39 <div class="flexbox" style="max-height: 300px">
michael@0 40 <div>text</div>
michael@0 41 </div>
michael@0 42
michael@0 43 <!-- OK. Now, if we set a minimum size that's larger than the shrinkwrap
michael@0 44 size, we should jump up to that size.-->
michael@0 45 <div class="flexbox" style="min-height: 30px">
michael@0 46 <div>text</div>
michael@0 47 </div>
michael@0 48
michael@0 49 <!-- If we set a maximum size that's smaller than the shrinkwrap size,
michael@0 50 we should max out at that size.-->
michael@0 51 <div class="flexbox" style="max-height: 6px">
michael@0 52 <div>text</div>
michael@0 53 </div>
michael@0 54
michael@0 55 <!-- But if we add a min-size, it beats the max-size. -->
michael@0 56 <div class="flexbox" style="min-height: 30px; max-height: 5px">
michael@0 57 <div>text</div>
michael@0 58 </div>
michael@0 59
michael@0 60 </body>
michael@0 61 </html>

mercurial