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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/w3c-css/submitted/flexbox/flexbox-sizing-horiz-2.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,61 @@
     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-height" and "max-height" affect the sizing
    1.11 +     of horizontal flex containers that have no explicit "height" 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 horizontal flex container with min-height and max-height 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-horiz-2-ref.xhtml"/>
    1.19 +    <style>
    1.20 +      div { width: 200px; }
    1.21 +      div.flexbox {
    1.22 +        border: 1px dashed blue;
    1.23 +        background: lightgreen;
    1.24 +        font-size: 10px;
    1.25 +        display: flex;
    1.26 +        margin-bottom: 5px;
    1.27 +      }
    1.28 +    </style>
    1.29 +  </head>
    1.30 +  <body>
    1.31 +    <!-- auto-height horizontal flexbox should shrinkwrap its contents. -->
    1.32 +    <div class="flexbox">
    1.33 +      <div>text</div>
    1.34 +    </div>
    1.35 +
    1.36 +    <!-- Adding a small min-size shouldn't affect that. -->
    1.37 +    <div class="flexbox" style="min-height: 2px">
    1.38 +      <div>text</div>
    1.39 +    </div>
    1.40 +
    1.41 +    <!-- ...nor should a large max-size. -->
    1.42 +    <div class="flexbox" style="max-height: 300px">
    1.43 +      <div>text</div>
    1.44 +    </div>
    1.45 +
    1.46 +    <!-- OK. Now, if we set a minimum size that's larger than the shrinkwrap
    1.47 +         size, we should jump up to that size.-->
    1.48 +    <div class="flexbox" style="min-height: 30px">
    1.49 +      <div>text</div>
    1.50 +    </div>
    1.51 +
    1.52 +    <!-- If we set a maximum size that's smaller than the shrinkwrap size,
    1.53 +         we should max out at that size.-->
    1.54 +    <div class="flexbox" style="max-height: 6px">
    1.55 +      <div>text</div>
    1.56 +    </div>
    1.57 +
    1.58 +    <!-- But if we add a min-size, it beats the max-size. -->
    1.59 +    <div class="flexbox" style="min-height: 30px; max-height: 5px">
    1.60 +      <div>text</div>
    1.61 +    </div>
    1.62 +
    1.63 +  </body>
    1.64 +</html>

mercurial