OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 |
| 3 <title>CSS Flexbox: Definite cross sizes</title> |
| 4 |
| 5 <style> |
| 6 .rect { |
| 7 width: 50px; |
| 8 height: 50px; |
| 9 background-color: green; |
| 10 } |
| 11 |
| 12 .flexbox { |
| 13 width: 50px; |
| 14 outline: 3px solid black; |
| 15 } |
| 16 |
| 17 .flexbox > div > div { |
| 18 overflow: hidden; |
| 19 } |
| 20 </style> |
| 21 |
| 22 <link rel="stylesheet" href="resources/flexbox.css"> |
| 23 <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#definite-sizes"> |
| 24 <link rel="author" title="Google Inc." href="https://www.google.com/"> |
| 25 |
| 26 <script src="../../resources/testharness.js"></script> |
| 27 <script src="../../resources/testharnessreport.js"></script> |
| 28 <script src="../../resources/check-layout-th.js"></script> |
| 29 |
| 30 <body onload="checkLayout('.flexbox')" style="height: 800px;"> |
| 31 <div id=log></div> |
| 32 |
| 33 <p>This test verifies that we consider flex items' cross sizes to be definite |
| 34 iff the flexbox has a definite cross size, is single-line, and the align value |
| 35 is stretch (the default)</p> |
| 36 |
| 37 <p>Tests that we get an indefinite size in the normal case.</p> |
| 38 <div class="flexbox" data-expected-height="50"> |
| 39 <div data-expected-height="50"> |
| 40 <div style="height: 50%" data-expected-height="50"> |
| 41 <div class="rect" data-expected-height="50"></div> |
| 42 </div> |
| 43 </div> |
| 44 </div> |
| 45 |
| 46 <p>Tests that we get an indefinite size in a wrapping flexbox</p> |
| 47 <div class="flexbox wrap" style="height: 50px;" data-expected-height="50"> |
| 48 <div data-expected-height="50"> |
| 49 <div style="height: 50%" data-expected-height="50"> |
| 50 <div class="rect" data-expected-height="50"></div> |
| 51 </div> |
| 52 </div> |
| 53 </div> |
| 54 |
| 55 <p>Tests that we get an indefinite size when not stretch-aligning</p> |
| 56 <div class="flexbox wrap" style="height: 50px;" data-expected-height="50"> |
| 57 <div class="align-self-flex-start" data-expected-height="50"> |
| 58 <div style="height: 50%" data-expected-height="50"> |
| 59 <div class="rect" data-expected-height="50"></div> |
| 60 </div> |
| 61 </div> |
| 62 </div> |
| 63 |
| 64 <p>Tests that we get an definite size in a definite-height flexbox</p> |
| 65 <div class="flexbox" style="height: 50px;" data-expected-height="50"> |
| 66 <div data-expected-height="50"> |
| 67 <div style="height: 50%" data-expected-height="25"> |
| 68 <div class="rect" data-expected-height="50"></div> |
| 69 </div> |
| 70 </div> |
| 71 </div> |
| 72 |
| 73 <p>Tests that we respect min-height</p> |
| 74 <div class="flexbox" style="height: 50px;" data-expected-height="50"> |
| 75 <div data-expected-height="50"> |
| 76 <div style="height: 50%; min-height: 30px;" data-expected-height="30"> |
| 77 <div class="rect" data-expected-height="50"></div> |
| 78 </div> |
| 79 </div> |
| 80 </div> |
| 81 |
| 82 <p>Tests that percentage sizes can also be definite</p> |
| 83 <div class="flexbox" style="height: 10%;" data-expected-height="80"> |
| 84 <div data-expected-height="80"> |
| 85 <div style="height: 50%" data-expected-height="40"> |
| 86 <div class="rect" data-expected-height="50"></div> |
| 87 </div> |
| 88 </div> |
| 89 </div> |
| 90 |
| 91 <p>Tests that percentage sizes are not necessarily definite</p> |
| 92 <div> |
| 93 <div class="flexbox" style="height: 10%;" data-expected-height="50"> |
| 94 <div data-expected-height="50"> |
| 95 <div style="height: 50%" data-expected-height="50"> |
| 96 <div class="rect" data-expected-height="50"></div> |
| 97 </div> |
| 98 </div> |
| 99 </div> |
| 100 </div> |
| 101 |
| 102 <p>Tests that we don't mix up widths and heights</p> |
| 103 <div class="flexbox" style="height: 50px; width: 100px;" data-expected-height="5
0"> |
| 104 <div style="width: 100px;" data-expected-height="50" data-expected-width="100"
> |
| 105 <div style="width: 50%" data-expected-width="50"> |
| 106 <div class="rect" data-expected-height="50" data-expected-width="50"></div
> |
| 107 </div> |
| 108 </div> |
| 109 </div> |
OLD | NEW |