layout/reftests/flexbox/flexbox-minSize-horiz-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-horiz-1.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,71 @@
     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-width: -moz-min-content".
    1.12 +
    1.13 +     We check that such flex items can't shrink below their min-content width,
    1.14 +     unless we explicitly reduce their min-width with e.g. "min-width: 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 +        width: 200px;
    1.21 +        display: flex;
    1.22 +        margin-bottom: 5px;
    1.23 +        font-size: 8px;
    1.24 +        border: 1px dotted black;
    1.25 +      }
    1.26 +      div.flexbox > * {
    1.27 +        margin-right: 20px;
    1.28 +        border: 1px dashed green;
    1.29 +        background: lightblue;
    1.30 +        height: 40px;
    1.31 +        min-width: -moz-min-content;
    1.32 +      }
    1.33 +      div.smallSize      { width: 5px; }
    1.34 +      div.smallFlexBasis { flex-basis: 2px; }
    1.35 +      div.zeroMinWidth   { min-width: 0; }
    1.36 +
    1.37 +    </style>
    1.38 +  </head>
    1.39 +  <body>
    1.40 +
    1.41 +    <!-- Check that we honor "min-width: min-content" as a lower-bound when
    1.42 +         sizing flex items. -->
    1.43 +    <div class="flexbox">
    1.44 +      <div>abc d e f</div>
    1.45 +      <div class="smallSize">abc d e f</div>
    1.46 +      <div class="smallFlexBasis">abc d e f</div>
    1.47 +    </div>
    1.48 +
    1.49 +    <!-- ... EVEN if our flex container is small and we're overflowing. -->
    1.50 +    <div class="flexbox smallSize">
    1.51 +      <div>abc d e f</div>
    1.52 +      <div class="smallSize">abc d e f</div>
    1.53 +      <div class="smallFlexBasis">abc d e f</div>
    1.54 +    </div>
    1.55 +
    1.56 +    <!-- Test that we don't clamp when we've got "min-width: 0" on our
    1.57 +         flex items, though. -->
    1.58 +    <div class="flexbox">
    1.59 +      <div class="zeroMinWidth">abc d e f</div>
    1.60 +      <div class="zeroMinWidth smallSize">abc d e f</div>
    1.61 +      <div class="zeroMinWidth smallFlexBasis">abc d e f</div>
    1.62 +    </div>
    1.63 +
    1.64 +    <!-- ... and similarly, when we have a small flex container and we trigger
    1.65 +         shrinking behavior, flex items with "min-width: 0" are allowed to
    1.66 +         shrink past their min-content width. -->
    1.67 +    <div class="flexbox smallSize">
    1.68 +      <div class="zeroMinWidth">abc d e f</div>
    1.69 +      <div class="zeroMinWidth smallSize">abc d e f</div>
    1.70 +      <div class="zeroMinWidth smallFlexBasis">abc d e f</div>
    1.71 +    </div>
    1.72 +
    1.73 +  </body>
    1.74 +</html>

mercurial