layout/reftests/flexbox/flexbox-minSize-vert-1.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/flexbox/flexbox-minSize-vert-1.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,73 @@
     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 test checks that we correctly handle flex items with an explicit
    1.11 +     "min-height: -moz-min-content".
    1.12 +
    1.13 +     We check that such flex items can't shrink below their min-content height,
    1.14 +     unless we explicitly reduce their min-height with e.g. "min-height: 0".
    1.15 +-->
    1.16 +<html xmlns="http://www.w3.org/1999/xhtml">
    1.17 +  <head>
    1.18 +    <style>
    1.19 +      div.flexbox {
    1.20 +        height: 140px;
    1.21 +        display: flex;
    1.22 +        flex-direction: column;
    1.23 +        margin-right: 5px;
    1.24 +        font-size: 8px;
    1.25 +        border: 1px dotted black;
    1.26 +        float: left;
    1.27 +      }
    1.28 +      div.flexbox > * {
    1.29 +        margin-bottom: 20px;
    1.30 +        border: 1px dashed green;
    1.31 +        background: lightblue;
    1.32 +        width: 40px;
    1.33 +        min-height: -moz-min-content; /* not yet supported -- see bug 852367 */
    1.34 +      }
    1.35 +      div.smallSize      { height: 5px; }
    1.36 +      div.smallFlexBasis { flex-basis: 2px; }
    1.37 +      div.zeroMinHeight  { min-height: 0; }
    1.38 +
    1.39 +    </style>
    1.40 +  </head>
    1.41 +  <body>
    1.42 +
    1.43 +    <!-- Check that we honor "min-height: min-content" as a lower-bound when
    1.44 +         sizing flex items. -->
    1.45 +    <div class="flexbox">
    1.46 +      <div>a b</div>
    1.47 +      <div class="smallSize">a b</div>
    1.48 +      <div class="smallFlexBasis">a b</div>
    1.49 +    </div>
    1.50 +
    1.51 +    <!-- ... EVEN if our flex container is small and we're overflowing. -->
    1.52 +    <div class="flexbox smallSize">
    1.53 +      <div>a b</div>
    1.54 +      <div class="smallSize">a b</div>
    1.55 +      <div class="smallFlexBasis">a b</div>
    1.56 +    </div>
    1.57 +
    1.58 +    <!-- Test that we don't clamp when we've got "min-height: 0" on our
    1.59 +         flex items, though. -->
    1.60 +    <div class="flexbox">
    1.61 +      <div class="zeroMinHeight">a b</div>
    1.62 +      <div class="zeroMinHeight smallSize">a b</div>
    1.63 +      <div class="zeroMinHeight smallFlexBasis">a b</div>
    1.64 +    </div>
    1.65 +
    1.66 +    <!-- ... and similarly, when we have a small flex container and we trigger
    1.67 +         shrinking behavior, flex items with "min-height: 0" are allowed to
    1.68 +         shrink past their min-content height. -->
    1.69 +    <div class="flexbox smallSize">
    1.70 +      <div class="zeroMinHeight">a b</div>
    1.71 +      <div class="zeroMinHeight smallSize">a b</div>
    1.72 +      <div class="zeroMinHeight smallFlexBasis">a b</div>
    1.73 +    </div>
    1.74 +
    1.75 +  </body>
    1.76 +</html>

mercurial