tony@chromium.org | 21f8ce8 | 2012-05-03 23:21:44 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <style> |
| 5 | div { |
| 6 | outline: 1px solid black; |
| 7 | background: hsla(210,100%,90%, .8); |
| 8 | padding: 5px; |
| 9 | margin: 5px; |
| 10 | } |
| 11 | |
| 12 | .flexbox { |
hyatt@apple.com | 247170f | 2017-02-28 16:23:15 +0000 | [diff] [blame] | 13 | display: flex; |
tony@chromium.org | 21f8ce8 | 2012-05-03 23:21:44 +0000 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | .row { |
hyatt@apple.com | 247170f | 2017-02-28 16:23:15 +0000 | [diff] [blame] | 17 | flex-direction: row; |
tony@chromium.org | 21f8ce8 | 2012-05-03 23:21:44 +0000 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | .column { |
hyatt@apple.com | 247170f | 2017-02-28 16:23:15 +0000 | [diff] [blame] | 21 | display: flex; |
| 22 | flex-direction: column; |
tony@chromium.org | 21f8ce8 | 2012-05-03 23:21:44 +0000 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | .flex { |
hyatt@apple.com | 247170f | 2017-02-28 16:23:15 +0000 | [diff] [blame] | 26 | flex: 1 0 auto; |
tony@chromium.org | 21f8ce8 | 2012-05-03 23:21:44 +0000 | [diff] [blame] | 27 | } |
| 28 | </style> |
hyatt@apple.com | 247170f | 2017-02-28 16:23:15 +0000 | [diff] [blame] | 29 | <script src="../../resources/testharness.js"></script> |
| 30 | <script src="../../resources/testharnessreport.js"></script> |
| 31 | <script src="../../resources/check-layout-th.js"></script> |
tony@chromium.org | 21f8ce8 | 2012-05-03 23:21:44 +0000 | [diff] [blame] | 32 | </head> |
tony@chromium.org | b1541ca | 2012-07-13 19:58:47 +0000 | [diff] [blame] | 33 | <body onload="checkLayout('.flexbox')"> |
hyatt@apple.com | 247170f | 2017-02-28 16:23:15 +0000 | [diff] [blame] | 34 | <div id=log></div> |
tony@chromium.org | 21f8ce8 | 2012-05-03 23:21:44 +0000 | [diff] [blame] | 35 | There should be two boxes of equal height on the left and 3 boxes of equal |
| 36 | height on the right. |
| 37 | <div class="flexbox row" style="width: 600px"> |
| 38 | <div data-expected-width=290 data-expected-height=220 class="column flex"> |
| 39 | <div data-expected-width=270 data-expected-height=95 class="flex"></div> |
| 40 | <div data-expected-width=270 data-expected-height=95 class="flex"></div> |
| 41 | </div> |
| 42 | <div data-expected-width=290 data-expected-height=220 class="column flex"> |
| 43 | <div data-expected-width=270 data-expected-height=60 class="flex" style="height: 50px;"></div> |
| 44 | <div data-expected-width=270 data-expected-height=60 class="flex" style="height: 50px;"></div> |
| 45 | <div data-expected-width=270 data-expected-height=60 class="flex" style="height: 50px;"></div> |
| 46 | </div> |
| 47 | </div> |
| 48 | |
| 49 | None of the boxes should overflow and the inner most boxes should be end aligned. |
| 50 | <div class="flexbox column" style="width: 600px; height: 300px; position: relative;"> |
hyatt@apple.com | 247170f | 2017-02-28 16:23:15 +0000 | [diff] [blame] | 51 | <div data-expected-width=590 data-expected-height=250 class="column flex" style="justify-content: flex-end"> |
| 52 | <div data-offset-y="180" data-expected-width=570 data-expected-height=30 style="height: 20px; flex: none;"></div> |
| 53 | <div data-offset-y="220" data-expected-width=570 data-expected-height=30 style="height: 20px; flex: none;"></div> |
tony@chromium.org | 21f8ce8 | 2012-05-03 23:21:44 +0000 | [diff] [blame] | 54 | </div> |
hyatt@apple.com | 247170f | 2017-02-28 16:23:15 +0000 | [diff] [blame] | 55 | <div data-expected-width=590 data-expected-height=30 style="height: 20px; flex: none;"></div> |
tony@chromium.org | 21f8ce8 | 2012-05-03 23:21:44 +0000 | [diff] [blame] | 56 | </div> |
| 57 | |
| 58 | |
| 59 | </body> |
| 60 | </html> |