3 <link href=
"resources/flexbox.css" rel=
"stylesheet">
9 background-color: #aaa;
11 outline:
2px solid red;
20 .flexbox :nth-child(
1) {
21 background-color: blue;
23 .flexbox :nth-child(
2) {
24 background-color: green;
33 -webkit-writing-mode: horizontal-tb;
36 -webkit-writing-mode: horizontal-bt;
39 -webkit-writing-mode: vertical-rl;
42 -webkit-writing-mode: vertical-lr;
45 <script src=
"../../resources/check-layout.js"></script>
46 <body onload=
"checkLayout('.flexbox')">
49 function positionAsString(position
)
51 return 'data-offset-x="' + position
[0] + '" data-offset-y="' + position
[1] + '"';
56 'row': { rtl
: [-10, -10], ltr
: [0, -10]},
57 'row-reverse': { rtl
: [0, -10], ltr
: [-10, -10]},
58 'column': { rtl
: [0, 0], ltr
: [-10, 0]},
59 'column-reverse': { rtl
: [0, -10], ltr
: [-10, -10]}
62 'row': { rtl
: [-10, 0], ltr
: [0, 0]},
63 'row-reverse': { rtl
: [0, 0], ltr
: [-10, 0]},
64 'column': { rtl
: [0, -10], ltr
: [-10, -10]},
65 'column-reverse': { rtl
: [0, 0], ltr
: [-10, 0]}
68 'row': { rtl
: [-10, -10], ltr
: [-10, 0]},
69 'row-reverse': { rtl
: [-10, 0], ltr
: [-10, -10]},
70 'column': { rtl
: [0, 0], ltr
: [0, -10]},
71 'column-reverse': { rtl
: [-10, 0], ltr
: [-10, -10]}
74 'row': { rtl
: [0, -10], ltr
: [0, 0]},
75 'row-reverse': { rtl
: [0, 0], ltr
: [0, -10]},
76 'column': { rtl
: [-10, 0], ltr
: [-10, -10]},
77 'column-reverse': { rtl
: [0, 0], ltr
: [0, -10]}
81 var writingModes
= ['horizontal-tb', 'horizontal-bt', 'vertical-lr', 'vertical-rl'];
82 var flexFlows
= ['row', 'column', 'row-reverse', 'column-reverse'];
83 var directions
= ['ltr', 'rtl'];
85 writingModes
.forEach(function(writingMode
) {
86 flexFlows
.forEach(function(flexFlow
) {
87 directions
.forEach(function(direction
) {
88 var flexboxClassName
= writingMode
+ ' ' + direction
+ ' ' + flexFlow
;
90 var title
= document
.createElement('div');
91 title
.className
= 'title';
92 title
.innerHTML
= flexboxClassName
;
93 document
.body
.appendChild(title
);
95 var container
= document
.createElement('div');
96 container
.innerHTML
= '<div class="flexbox align-items-flex-end ' + flexboxClassName
+ '">\n' +
97 '<div class="flex-none" ' + positionAsString(expectations
[writingMode
][flexFlow
][direction
]) + '></div><div class="flex-none"></div>\n' +
100 document
.body
.appendChild(container
);