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 max-width: 600px; | 8 max-width: 600px; |
9 -webkit-align-content: flex-start; | 9 align-content: flex-start; |
10 } | 10 } |
11 .flexbox > * { | 11 .flexbox > * { |
12 -webkit-flex: none; | 12 flex: none; |
13 } | 13 } |
14 .title { | 14 .title { |
15 margin-top: 1em; | 15 margin-top: 1em; |
16 } | 16 } |
17 .ltr { | 17 .ltr { |
18 direction: ltr; | 18 direction: ltr; |
19 } | 19 } |
20 .rtl { | 20 .rtl { |
21 direction: rtl; | 21 direction: rtl; |
22 } | 22 } |
23 .horizontal-tb { | 23 .horizontal-tb { |
24 -webkit-writing-mode: horizontal-tb; | 24 -webkit-writing-mode: horizontal-tb; |
25 } | 25 } |
26 .horizontal-bt { | 26 .horizontal-bt { |
27 -webkit-writing-mode: horizontal-bt; | 27 -webkit-writing-mode: horizontal-bt; |
28 } | 28 } |
29 .vertical-rl { | 29 .vertical-rl { |
30 -webkit-writing-mode: vertical-rl; | 30 -webkit-writing-mode: vertical-rl; |
31 } | 31 } |
32 .vertical-lr { | 32 .vertical-lr { |
33 -webkit-writing-mode: vertical-lr; | 33 -webkit-writing-mode: vertical-lr; |
34 } | 34 } |
35 .row { | 35 .row { |
36 -webkit-flex-flow: row; | 36 flex-flow: row; |
37 } | 37 } |
38 .row-reverse { | 38 .row-reverse { |
39 -webkit-flex-flow: row-reverse; | 39 flex-flow: row-reverse; |
40 } | 40 } |
41 .column { | 41 .column { |
42 -webkit-flex-flow: column; | 42 flex-flow: column; |
43 } | 43 } |
44 .column-reverse { | 44 .column-reverse { |
45 -webkit-flex-flow: column-reverse; | 45 flex-flow: column-reverse; |
46 } | 46 } |
47 .wrap { | 47 .wrap { |
48 -webkit-flex-wrap: wrap; | 48 flex-wrap: wrap; |
49 } | 49 } |
50 .wrap-reverse { | 50 .wrap-reverse { |
51 -webkit-flex-wrap: wrap-reverse; | 51 flex-wrap: wrap-reverse; |
52 } | 52 } |
53 .flexbox > :nth-child(1) { | 53 .flexbox > :nth-child(1) { |
54 background-color: #0f0; | 54 background-color: #0f0; |
55 } | 55 } |
56 .flexbox > :nth-child(2) { | 56 .flexbox > :nth-child(2) { |
57 background-color: #0d0; | 57 background-color: #0d0; |
58 } | 58 } |
59 .flexbox > :nth-child(3) { | 59 .flexbox > :nth-child(3) { |
60 background-color: #090; | 60 background-color: #090; |
61 } | 61 } |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 { | 693 { |
694 if ((writingMode.indexOf('horizontal') != -1 && flexDirection.indexOf('row')
!= -1) | 694 if ((writingMode.indexOf('horizontal') != -1 && flexDirection.indexOf('row')
!= -1) |
695 || (writingMode.indexOf('vertical') != -1 && flexDirection.indexOf('colu
mn') != -1)) | 695 || (writingMode.indexOf('vertical') != -1 && flexDirection.indexOf('colu
mn') != -1)) |
696 return 'width'; | 696 return 'width'; |
697 return 'height'; | 697 return 'height'; |
698 } | 698 } |
699 | 699 |
700 function addChild(flexbox, mainAxis, crossAxis, preferredSize, crossAxisLength,
expectations) | 700 function addChild(flexbox, mainAxis, crossAxis, preferredSize, crossAxisLength,
expectations) |
701 { | 701 { |
702 var child = document.createElement('div'); | 702 var child = document.createElement('div'); |
703 child.setAttribute('style', '-webkit-flex: 1 0 ' + preferredSize + 'px;' | 703 child.setAttribute('style', 'flex: 1 0 ' + preferredSize + 'px;' |
704 + crossAxis + ': ' + crossAxisLength + 'px;'); | 704 + crossAxis + ': ' + crossAxisLength + 'px;'); |
705 | 705 |
706 child.setAttribute("data-expected-width", expectations[0]); | 706 child.setAttribute("data-expected-width", expectations[0]); |
707 child.setAttribute("data-expected-height", expectations[1]); | 707 child.setAttribute("data-expected-height", expectations[1]); |
708 child.setAttribute("data-offset-x", expectations[2]); | 708 child.setAttribute("data-offset-x", expectations[2]); |
709 child.setAttribute("data-offset-y", expectations[3]); | 709 child.setAttribute("data-offset-y", expectations[3]); |
710 | 710 |
711 flexbox.appendChild(child); | 711 flexbox.appendChild(child); |
712 } | 712 } |
713 | 713 |
(...skipping 30 matching lines...) Expand all Loading... |
744 flexbox.setAttribute("data-expected-height", testExpectations.fl
exbox[1]); | 744 flexbox.setAttribute("data-expected-height", testExpectations.fl
exbox[1]); |
745 | 745 |
746 document.body.appendChild(flexbox); | 746 document.body.appendChild(flexbox); |
747 }) | 747 }) |
748 }) | 748 }) |
749 }) | 749 }) |
750 }) | 750 }) |
751 </script> | 751 </script> |
752 </body> | 752 </body> |
753 </html> | 753 </html> |
OLD | NEW |