OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <style> | 3 <style> |
4 .flexbox { | 4 .flexbox { |
5 position: relative; | 5 position: relative; |
6 display: -webkit-flex; | 6 display: flex; |
7 background-color: grey; | 7 background-color: grey; |
8 width: 600px; | 8 width: 600px; |
9 height: 20px; | 9 height: 20px; |
10 } | 10 } |
11 .title { | 11 .title { |
12 margin-top: 1em; | 12 margin-top: 1em; |
13 } | 13 } |
14 .ltr { | 14 .ltr { |
15 direction: ltr; | 15 direction: ltr; |
16 } | 16 } |
17 .rtl { | 17 .rtl { |
18 direction: rtl; | 18 direction: rtl; |
19 } | 19 } |
20 .horizontal-tb { | 20 .horizontal-tb { |
21 -webkit-writing-mode: horizontal-tb; | 21 -webkit-writing-mode: horizontal-tb; |
22 } | 22 } |
23 .horizontal-bt { | 23 .horizontal-bt { |
24 -webkit-writing-mode: horizontal-bt; | 24 -webkit-writing-mode: horizontal-bt; |
25 } | 25 } |
26 .column { | 26 .column { |
27 -webkit-flex-flow: column; | 27 flex-flow: column; |
28 } | 28 } |
29 .column-reverse { | 29 .column-reverse { |
30 -webkit-flex-flow: column-reverse; | 30 flex-flow: column-reverse; |
31 } | 31 } |
32 .wrap { | 32 .wrap { |
33 -webkit-flex-wrap: wrap; | 33 flex-wrap: wrap; |
34 } | 34 } |
35 .wrap-reverse { | 35 .wrap-reverse { |
36 -webkit-flex-wrap: wrap-reverse; | 36 flex-wrap: wrap-reverse; |
37 } | 37 } |
38 .align-content-flex-start { | 38 .align-content-flex-start { |
39 -webkit-align-content: flex-start; | 39 align-content: flex-start; |
40 } | 40 } |
41 .align-content-flex-end { | 41 .align-content-flex-end { |
42 -webkit-align-content: flex-end; | 42 align-content: flex-end; |
43 } | 43 } |
44 .align-content-center { | 44 .align-content-center { |
45 -webkit-align-content: center; | 45 align-content: center; |
46 } | 46 } |
47 .align-content-space-between { | 47 .align-content-space-between { |
48 -webkit-align-content: space-between; | 48 align-content: space-between; |
49 } | 49 } |
50 .align-content-space-around { | 50 .align-content-space-around { |
51 -webkit-align-content: space-around; | 51 align-content: space-around; |
52 } | 52 } |
53 .align-content-stretch { | 53 .align-content-stretch { |
54 -webkit-align-content: stretch; | 54 align-content: stretch; |
55 } | 55 } |
56 .flexbox > :nth-child(1) { | 56 .flexbox > :nth-child(1) { |
57 background-color: blue; | 57 background-color: blue; |
58 } | 58 } |
59 .flexbox > :nth-child(2) { | 59 .flexbox > :nth-child(2) { |
60 background-color: green; | 60 background-color: green; |
61 } | 61 } |
62 </style> | 62 </style> |
63 <script src="../../resources/check-layout.js"></script> | 63 <script src="../../resources/check-layout.js"></script> |
64 <body onload="checkLayout('.flexbox')"> | 64 <body onload="checkLayout('.flexbox')"> |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 { | 229 { |
230 if ((writingMode.indexOf('horizontal') != -1 && flexDirection.indexOf('row')
!= -1) | 230 if ((writingMode.indexOf('horizontal') != -1 && flexDirection.indexOf('row')
!= -1) |
231 || (writingMode.indexOf('vertical') != -1 && flexDirection.indexOf('colu
mn') != -1)) | 231 || (writingMode.indexOf('vertical') != -1 && flexDirection.indexOf('colu
mn') != -1)) |
232 return 'width'; | 232 return 'width'; |
233 return 'height'; | 233 return 'height'; |
234 } | 234 } |
235 | 235 |
236 function addChild(flexbox, preferredSize, alignContent, expected_x_offset) | 236 function addChild(flexbox, preferredSize, alignContent, expected_x_offset) |
237 { | 237 { |
238 var child = document.createElement('div'); | 238 var child = document.createElement('div'); |
239 child.setAttribute('style', '-webkit-flex: 1 ' + preferredSize + 'px;' | 239 child.setAttribute('style', 'flex: 1 ' + preferredSize + 'px;' |
240 + 'min-width: 100px'); | 240 + 'min-width: 100px'); |
241 | 241 |
242 child.setAttribute("data-expected-width", alignContent == "stretch" ? "300"
: "100"); | 242 child.setAttribute("data-expected-width", alignContent == "stretch" ? "300"
: "100"); |
243 child.setAttribute("data-expected-height", "20"); | 243 child.setAttribute("data-expected-height", "20"); |
244 child.setAttribute("data-offset-y", "0"); | 244 child.setAttribute("data-offset-y", "0"); |
245 child.setAttribute("data-offset-x", expected_x_offset); | 245 child.setAttribute("data-offset-x", expected_x_offset); |
246 | 246 |
247 flexbox.appendChild(child); | 247 flexbox.appendChild(child); |
248 } | 248 } |
249 | 249 |
(...skipping 28 matching lines...) Expand all Loading... |
278 | 278 |
279 document.body.appendChild(flexbox); | 279 document.body.appendChild(flexbox); |
280 }) | 280 }) |
281 }) | 281 }) |
282 }) | 282 }) |
283 }) | 283 }) |
284 }) | 284 }) |
285 </script> | 285 </script> |
286 </body> | 286 </body> |
287 </html> | 287 </html> |
OLD | NEW |