6 background-color: grey;
10 padding:
2px
13px
8px
17px;
11 margin:
2px
13px
8px
17px;
30 -webkit-writing-mode: horizontal-tb;
33 -webkit-writing-mode: horizontal-bt;
36 -webkit-writing-mode: vertical-rl;
39 -webkit-writing-mode: vertical-lr;
45 flex-flow: row-reverse;
51 flex-flow: column-reverse;
54 <script src=
"../../resources/check-layout.js"></script>
55 <body onload=
"checkLayout('.flexbox')">
58 var writingModes
= ['horizontal-tb', 'horizontal-bt', 'vertical-lr', 'vertical-rl'];
59 var flexFlows
= ['row', 'column', 'row-reverse', 'column-reverse'];
60 var scrollDirections
= ['overflowY', 'overflowX'];
62 var dummyNode
= document
.createElement('div');
63 dummyNode
.style
.overflow
= 'scroll';
64 document
.body
.appendChild(dummyNode
);
65 var scrollbarWidth
= dummyNode
.offsetWidth
- dummyNode
.clientWidth
;
67 writingModes
.forEach(function(writingMode
) {
68 flexFlows
.forEach(function(flexFlow
) {
69 scrollDirections
.forEach(function(scrollDirection
) {
70 var flexboxClassName
= writingMode
+ ' ' + scrollDirection
+ ' ' + flexFlow
;
72 var title
= document
.createElement('div');
73 title
.className
= 'title';
74 title
.innerHTML
= flexboxClassName
;
75 document
.body
.appendChild(title
);
77 var isColumn
= flexFlow
.indexOf('column') != -1;
78 var isHorizontal
= (writingMode
.indexOf('horizontal') != -1) ? !isColumn
: isColumn
;
80 var expectedWidth
= isHorizontal
? 220 : 140;
81 var expectedHeight
= isHorizontal
? 60 : 110;
82 if (scrollDirection
== 'overflowY')
83 expectedWidth
+= scrollbarWidth
;
84 if (scrollDirection
== 'overflowX')
85 expectedHeight
+= scrollbarWidth
;
88 var container
= document
.createElement('div');
89 container
.innerHTML
= '<div class="flexbox ' + flexboxClassName
+ '" data-expected-width="' + expectedWidth
+ '" data-expected-height="' + expectedHeight
+ '">\n' +
90 '<div style="background-color:pink; width: 20px; height: 30px;"></div>\n' +
91 '<div style="background-color:red; width: 80px; height: 40px;"></div>\n' +
92 '</div><div style="clear:both;"></div>';
94 document
.body
.appendChild(container
);