layout/reftests/w3c-css/submitted/flexbox/flexbox-basic-video-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-basic-video-vert-1.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,103 @@
     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 video elements behave correctly as flex items.
    1.11 +-->
    1.12 +<html xmlns="http://www.w3.org/1999/xhtml">
    1.13 +  <head>
    1.14 +    <title>CSS Test: Testing flexbox layout algorithm property on video flex items in a vertical flex container</title>
    1.15 +    <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/>
    1.16 +    <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#layout-algorithm"/>
    1.17 +    <link rel="match" href="flexbox-basic-video-vert-1-ref.xhtml"/>
    1.18 +    <style>
    1.19 +      div.flexbox {
    1.20 +        height: 200px;
    1.21 +        background: lightgreen;
    1.22 +        display: flex;
    1.23 +        justify-content: space-between;
    1.24 +        flex-direction: column;
    1.25 +        float: left;
    1.26 +        margin-right: 10px;
    1.27 +        font: 8px monospace;
    1.28 +      }
    1.29 +      video {
    1.30 +        width: 20px;
    1.31 +        height: 10px;
    1.32 +        min-height: 0;
    1.33 +        border: 1px dotted green;
    1.34 +      }
    1.35 +    </style>
    1.36 +  </head>
    1.37 +  <body>
    1.38 +
    1.39 +    <!-- A) One flex item -->
    1.40 +    <div class="flexbox">
    1.41 +      <video/>
    1.42 +    </div>
    1.43 +
    1.44 +    <!-- B) Text and a video (ensure they aren't merged into one flex item) -->
    1.45 +    <div class="flexbox">
    1.46 +      a b <video/>
    1.47 +    </div>
    1.48 +
    1.49 +    <!-- C) Two video elements, getting stretched by different ratios, from 0.
    1.50 +
    1.51 +         Space-to-be-distributed = 200px - borders = 200 - (1 + 1) - (1 + 1)
    1.52 +                                 = 196px
    1.53 +
    1.54 +         1st element gets 5/8 of space: 5/8 * 196px = 122.5px
    1.55 +         1st element gets 3/8 of space: 3/8 * 196px = 73.5px
    1.56 +      -->
    1.57 +    <div class="flexbox">
    1.58 +      <video style="flex: 5"/>
    1.59 +      <video style="flex: 3"/>
    1.60 +    </div>
    1.61 +
    1.62 +    <!-- D) Two video elements, getting stretched by different ratios, from
    1.63 +         different flex bases.
    1.64 +
    1.65 +         Space-to-be-distributed = 200px - (33 + 1 + 1) - (13 + 1 + 1) = 150px
    1.66 +         1st element gets 2/5 of space: 33px + 2/5 * 150px = 93px
    1.67 +         1st element gets 3/5 of space: 13px + 3/5 * 150px = 103px
    1.68 +      -->
    1.69 +    <div class="flexbox">
    1.70 +      <video style="height: 33px; flex: 2 auto"/>
    1.71 +      <video style="height: 13px; flex: 3 auto"/>
    1.72 +    </div>
    1.73 +
    1.74 +    <!-- E) Two flex items, getting shrunk by different amounts.
    1.75 +
    1.76 +         Space-to-be-distributed = 200px - (150 + 1 + 1) - (100 + 1 + 1) = -54px
    1.77 +         First element scaled flex ratio = 4 * 150 = 600
    1.78 +         Second element scaled flex ratio = 3 * 100 = 300
    1.79 +           * So, total flexibility is 600 + 300 = 900
    1.80 +
    1.81 +         1st element gets 600/900 of space: 150 + 600/900 * -54 = 114px
    1.82 +         2nd element gets 300/900 of space: 100 + 300/900 * -54 = 82px
    1.83 +      -->
    1.84 +    <div class="flexbox">
    1.85 +      <video style="height: 150px; flex: 1 4 auto"/>
    1.86 +      <video style="height: 100px; flex: 1 3 auto"/>
    1.87 +    </div>
    1.88 +
    1.89 +    <!-- F) Making sure we don't grow past max-height -->
    1.90 +    <!-- Same as (D), except we've added a max-height on the second element.
    1.91 +      -->
    1.92 +    <div class="flexbox">
    1.93 +      <video style="height: 33px; flex: 2 auto"/>
    1.94 +      <video style="height: 13px; max-height: 90px; flex: 3 auto"/>
    1.95 +    </div>
    1.96 +
    1.97 +    <!-- G) Making sure we grow at least as large as min-height -->
    1.98 +    <!-- Same as (C), except we've added a min-height on the second element.
    1.99 +      -->
   1.100 +    <div class="flexbox">
   1.101 +      <video style="height: 33px; flex: 2 auto"/>
   1.102 +      <video style="height: 13px; min-height: 150px; flex: 3 auto"/>
   1.103 +    </div>
   1.104 +
   1.105 +  </body>
   1.106 +</html>

mercurial