layout/reftests/w3c-css/submitted/flexbox/flexbox-sizing-vert-1.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-vert-1.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,98 @@
     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 vertical 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 vertical 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-vert-1-ref.xhtml"/>
    1.19 +    <style>
    1.20 +      div { width: 10px; }
    1.21 +      div.flexbox {
    1.22 +        float: left;
    1.23 +        border: 1px dashed blue;
    1.24 +        font-size: 10px;
    1.25 +        display: flex;
    1.26 +        flex-direction: column;
    1.27 +        margin-right: 2px;
    1.28 +      }
    1.29 +      div.a {
    1.30 +        flex: 1 20px;
    1.31 +        max-height: 60px;
    1.32 +        background: lightgreen;
    1.33 +      }
    1.34 +      div.b {
    1.35 +        flex: 1 20px;
    1.36 +        min-height: 40px;
    1.37 +        max-height: 60px;
    1.38 +        background: purple;
    1.39 +      }
    1.40 +      div.c {
    1.41 +        flex: 1 40px;
    1.42 +        min-height: 10px;
    1.43 +        max-height: 60px;
    1.44 +        background: orange;
    1.45 +      }
    1.46 +    </style>
    1.47 +  </head>
    1.48 +  <body>
    1.49 +    <!-- floated auto-sized vertical flexbox should shrinkwrap its flex items'
    1.50 +         hypothetical main sizes (their flex base sizes, clamped to min/max) -->
    1.51 +    <div class="flexbox">
    1.52 +      <div class="a"/><div class="b"/><div class="c"/>
    1.53 +    </div>
    1.54 +
    1.55 +    <!-- Adding a small min-size shouldn't affect that. -->
    1.56 +    <div class="flexbox" style="min-height: 10px">
    1.57 +      <div class="a"/><div class="b"/><div class="c"/>
    1.58 +    </div>
    1.59 +
    1.60 +    <!-- ...nor should a large max-size. -->
    1.61 +    <div class="flexbox" style="max-height: 300px">
    1.62 +      <div class="a"/><div class="b"/><div class="c"/>
    1.63 +    </div>
    1.64 +
    1.65 +    <!-- OK. Now, if we set a minimum size that's larger than the shrinkwrap
    1.66 +         size, we should jump up to that size.-->
    1.67 +    <div class="flexbox" style="min-height: 120px">
    1.68 +      <div class="a"/><div class="b"/><div class="c"/>
    1.69 +    </div>
    1.70 +
    1.71 +    <!-- ...even if it's large enough that our items won't occupy all the
    1.72 +         space. -->
    1.73 +    <div class="flexbox" style="min-height: 200px">
    1.74 +      <div class="a"/><div class="b"/><div class="c"/>
    1.75 +    </div>
    1.76 +
    1.77 +    <!-- If we set a maximum size that's smaller than the shrinkwrap size,
    1.78 +         we should max out at that size.-->
    1.79 +    <div class="flexbox" style="max-height: 70px">
    1.80 +      <div class="a"/><div class="b"/><div class="c"/>
    1.81 +    </div>
    1.82 +
    1.83 +    <!-- The max-size may be small enough that our items will overflow. -->
    1.84 +    <div class="flexbox" style="max-height: 20px">
    1.85 +      <div class="a"/><div class="b"/><div class="c"/>
    1.86 +    </div>
    1.87 +
    1.88 +    <!-- But if we add a min-size, it beats the max-size. Here, we use a
    1.89 +         min-size smaller than the sum of the items' base sizes... -->
    1.90 +    <div class="flexbox" style="min-height: 58px; max-height: 20px">
    1.91 +      <div class="a"/><div class="b"/><div class="c"/>
    1.92 +    </div>
    1.93 +
    1.94 +    <!-- ...and here we use a min-size larger than the sum of the items'
    1.95 +         base sizes. -->
    1.96 +    <div class="flexbox" style="min-height: 140px; max-height: 20px">
    1.97 +      <div class="a"/><div class="b"/><div class="c"/>
    1.98 +    </div>
    1.99 +
   1.100 +  </body>
   1.101 +</html>

mercurial