Thu, 15 Jan 2015 21:13:52 +0100
Remove forgotten relic of ABI crash risk averse overloaded method change.
michael@0 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
michael@0 | 2 | <!-- |
michael@0 | 3 | Any copyright is dedicated to the Public Domain. |
michael@0 | 4 | http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 5 | --> |
michael@0 | 6 | <!-- |
michael@0 | 7 | This test checks that video elements behave correctly as flex items. |
michael@0 | 8 | --> |
michael@0 | 9 | <html xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 10 | <head> |
michael@0 | 11 | <title>CSS Test: Testing flexbox layout algorithm property on video flex items in a vertical flex container</title> |
michael@0 | 12 | <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> |
michael@0 | 13 | <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#layout-algorithm"/> |
michael@0 | 14 | <link rel="match" href="flexbox-basic-video-vert-1-ref.xhtml"/> |
michael@0 | 15 | <style> |
michael@0 | 16 | div.flexbox { |
michael@0 | 17 | height: 200px; |
michael@0 | 18 | background: lightgreen; |
michael@0 | 19 | display: flex; |
michael@0 | 20 | justify-content: space-between; |
michael@0 | 21 | flex-direction: column; |
michael@0 | 22 | float: left; |
michael@0 | 23 | margin-right: 10px; |
michael@0 | 24 | font: 8px monospace; |
michael@0 | 25 | } |
michael@0 | 26 | video { |
michael@0 | 27 | width: 20px; |
michael@0 | 28 | height: 10px; |
michael@0 | 29 | min-height: 0; |
michael@0 | 30 | border: 1px dotted green; |
michael@0 | 31 | } |
michael@0 | 32 | </style> |
michael@0 | 33 | </head> |
michael@0 | 34 | <body> |
michael@0 | 35 | |
michael@0 | 36 | <!-- A) One flex item --> |
michael@0 | 37 | <div class="flexbox"> |
michael@0 | 38 | <video/> |
michael@0 | 39 | </div> |
michael@0 | 40 | |
michael@0 | 41 | <!-- B) Text and a video (ensure they aren't merged into one flex item) --> |
michael@0 | 42 | <div class="flexbox"> |
michael@0 | 43 | a b <video/> |
michael@0 | 44 | </div> |
michael@0 | 45 | |
michael@0 | 46 | <!-- C) Two video elements, getting stretched by different ratios, from 0. |
michael@0 | 47 | |
michael@0 | 48 | Space-to-be-distributed = 200px - borders = 200 - (1 + 1) - (1 + 1) |
michael@0 | 49 | = 196px |
michael@0 | 50 | |
michael@0 | 51 | 1st element gets 5/8 of space: 5/8 * 196px = 122.5px |
michael@0 | 52 | 1st element gets 3/8 of space: 3/8 * 196px = 73.5px |
michael@0 | 53 | --> |
michael@0 | 54 | <div class="flexbox"> |
michael@0 | 55 | <video style="flex: 5"/> |
michael@0 | 56 | <video style="flex: 3"/> |
michael@0 | 57 | </div> |
michael@0 | 58 | |
michael@0 | 59 | <!-- D) Two video elements, getting stretched by different ratios, from |
michael@0 | 60 | different flex bases. |
michael@0 | 61 | |
michael@0 | 62 | Space-to-be-distributed = 200px - (33 + 1 + 1) - (13 + 1 + 1) = 150px |
michael@0 | 63 | 1st element gets 2/5 of space: 33px + 2/5 * 150px = 93px |
michael@0 | 64 | 1st element gets 3/5 of space: 13px + 3/5 * 150px = 103px |
michael@0 | 65 | --> |
michael@0 | 66 | <div class="flexbox"> |
michael@0 | 67 | <video style="height: 33px; flex: 2 auto"/> |
michael@0 | 68 | <video style="height: 13px; flex: 3 auto"/> |
michael@0 | 69 | </div> |
michael@0 | 70 | |
michael@0 | 71 | <!-- E) Two flex items, getting shrunk by different amounts. |
michael@0 | 72 | |
michael@0 | 73 | Space-to-be-distributed = 200px - (150 + 1 + 1) - (100 + 1 + 1) = -54px |
michael@0 | 74 | First element scaled flex ratio = 4 * 150 = 600 |
michael@0 | 75 | Second element scaled flex ratio = 3 * 100 = 300 |
michael@0 | 76 | * So, total flexibility is 600 + 300 = 900 |
michael@0 | 77 | |
michael@0 | 78 | 1st element gets 600/900 of space: 150 + 600/900 * -54 = 114px |
michael@0 | 79 | 2nd element gets 300/900 of space: 100 + 300/900 * -54 = 82px |
michael@0 | 80 | --> |
michael@0 | 81 | <div class="flexbox"> |
michael@0 | 82 | <video style="height: 150px; flex: 1 4 auto"/> |
michael@0 | 83 | <video style="height: 100px; flex: 1 3 auto"/> |
michael@0 | 84 | </div> |
michael@0 | 85 | |
michael@0 | 86 | <!-- F) Making sure we don't grow past max-height --> |
michael@0 | 87 | <!-- Same as (D), except we've added a max-height on the second element. |
michael@0 | 88 | --> |
michael@0 | 89 | <div class="flexbox"> |
michael@0 | 90 | <video style="height: 33px; flex: 2 auto"/> |
michael@0 | 91 | <video style="height: 13px; max-height: 90px; flex: 3 auto"/> |
michael@0 | 92 | </div> |
michael@0 | 93 | |
michael@0 | 94 | <!-- G) Making sure we grow at least as large as min-height --> |
michael@0 | 95 | <!-- Same as (C), except we've added a min-height on the second element. |
michael@0 | 96 | --> |
michael@0 | 97 | <div class="flexbox"> |
michael@0 | 98 | <video style="height: 33px; flex: 2 auto"/> |
michael@0 | 99 | <video style="height: 13px; min-height: 150px; flex: 3 auto"/> |
michael@0 | 100 | </div> |
michael@0 | 101 | |
michael@0 | 102 | </body> |
michael@0 | 103 | </html> |