OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <style> | 3 <style> |
4 .container { | 4 .container { |
5 position: relative; | 5 position: relative; |
6 background-color: pink; | 6 background-color: pink; |
7 outline: 1px solid red; | 7 outline: 1px solid red; |
8 display: inline-block; | 8 display: inline-block; |
9 } | 9 } |
10 .flexbox { | 10 .flexbox { |
11 display: -webkit-flex; | 11 display: flex; |
12 background-color: grey; | 12 background-color: grey; |
13 width: 100px; | 13 width: 100px; |
14 height: 100px; | 14 height: 100px; |
15 } | 15 } |
16 .title { | 16 .title { |
17 margin-top: 1em; | 17 margin-top: 1em; |
18 } | 18 } |
19 .ltr { | 19 .ltr { |
20 direction: ltr; | 20 direction: ltr; |
21 } | 21 } |
22 .rtl { | 22 .rtl { |
23 direction: rtl; | 23 direction: rtl; |
24 } | 24 } |
25 .horizontal-tb { | 25 .horizontal-tb { |
26 -webkit-writing-mode: horizontal-tb; | 26 -webkit-writing-mode: horizontal-tb; |
27 } | 27 } |
28 .horizontal-bt { | 28 .horizontal-bt { |
29 -webkit-writing-mode: horizontal-bt; | 29 -webkit-writing-mode: horizontal-bt; |
30 } | 30 } |
31 .vertical-rl { | 31 .vertical-rl { |
32 -webkit-writing-mode: vertical-rl; | 32 -webkit-writing-mode: vertical-rl; |
33 } | 33 } |
34 .vertical-lr { | 34 .vertical-lr { |
35 -webkit-writing-mode: vertical-lr; | 35 -webkit-writing-mode: vertical-lr; |
36 } | 36 } |
37 .row { | 37 .row { |
38 -webkit-flex-flow: row; | 38 flex-flow: row; |
39 } | 39 } |
40 .row-reverse { | 40 .row-reverse { |
41 -webkit-flex-flow: row-reverse; | 41 flex-flow: row-reverse; |
42 } | 42 } |
43 .column { | 43 .column { |
44 -webkit-flex-flow: column; | 44 flex-flow: column; |
45 } | 45 } |
46 .column-reverse { | 46 .column-reverse { |
47 -webkit-flex-flow: column-reverse; | 47 flex-flow: column-reverse; |
48 } | 48 } |
49 .flexbox > :nth-child(1) { | 49 .flexbox > :nth-child(1) { |
50 background-color: blue; | 50 background-color: blue; |
51 } | 51 } |
52 </style> | 52 </style> |
53 <script src="../../resources/check-layout.js"></script> | 53 <script src="../../resources/check-layout.js"></script> |
54 <body onload="checkLayout('.flexbox')"> | 54 <body onload="checkLayout('.flexbox')"> |
55 | 55 |
56 <script> | 56 <script> |
57 function positionAsString(position) | 57 function positionAsString(position) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 container.setAttribute('data-expected-height', containerSize[1]); | 112 container.setAttribute('data-expected-height', containerSize[1]); |
113 | 113 |
114 var flowDirection = direction; | 114 var flowDirection = direction; |
115 // row-reverse is the same as flipping the writing direction. | 115 // row-reverse is the same as flipping the writing direction. |
116 if (flexFlow == "row-reverse") | 116 if (flexFlow == "row-reverse") |
117 flowDirection = direction == "rtl" ? "ltr" : "rtl"; | 117 flowDirection = direction == "rtl" ? "ltr" : "rtl"; |
118 else if (flexFlow == "column-reverse") | 118 else if (flexFlow == "column-reverse") |
119 flowDirection = direction + "-column-reverse"; | 119 flowDirection = direction + "-column-reverse"; |
120 | 120 |
121 container.innerHTML = '\n<div class="flexbox ' + flexboxClassName +
'" ' + sizeAsString(containerSize) + '>\n' + | 121 container.innerHTML = '\n<div class="flexbox ' + flexboxClassName +
'" ' + sizeAsString(containerSize) + '>\n' + |
122 '<div style="-webkit-flex: 1 0 auto; width: 105px; height: 105px
;" ' + sizeAsString([105, 105]) + ' ' + positionAsString(expectations[writingMo
de][flowDirection]) + '></div>\n' + | 122 '<div style="flex: 1 0 auto; width: 105px; height: 105px;" ' + s
izeAsString([105, 105]) + ' ' + positionAsString(expectations[writingMode][flow
Direction]) + '></div>\n' + |
123 '</div>\n'; | 123 '</div>\n'; |
124 | 124 |
125 document.body.appendChild(container); | 125 document.body.appendChild(container); |
126 }) | 126 }) |
127 }) | 127 }) |
128 }) | 128 }) |
129 </script> | 129 </script> |
130 </body> | 130 </body> |
131 </html> | 131 </html> |
OLD | NEW |