Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / css3 / flexbox / flex-align-end.html
blobfdf5ad2ff7bd6e56793cc9ef7f1154d9b1bc7908
1 <!DOCTYPE html>
2 <html>
3 <link href="resources/flexbox.css" rel="stylesheet">
4 <style>
5 .flexbox {
6 margin: 120px;
7 width: 100px;
8 height: 100px;
9 background-color: #aaa;
10 position: relative;
11 outline: 2px solid red;
13 .title {
14 margin-bottom: 10px;
16 .flexbox > div {
17 height: 110px;
18 width: 110px;
20 .flexbox :nth-child(1) {
21 background-color: blue;
23 .flexbox :nth-child(2) {
24 background-color: green;
26 .ltr {
27 direction: ltr;
29 .rtl {
30 direction: rtl;
32 .horizontal-tb {
33 -webkit-writing-mode: horizontal-tb;
35 .horizontal-bt {
36 -webkit-writing-mode: horizontal-bt;
38 .vertical-rl {
39 -webkit-writing-mode: vertical-rl;
41 .vertical-lr {
42 -webkit-writing-mode: vertical-lr;
44 </style>
45 <script src="../../resources/check-layout.js"></script>
46 <body onload="checkLayout('.flexbox')">
48 <script>
49 function positionAsString(position)
51 return 'data-offset-x="' + position[0] + '" data-offset-y="' + position[1] + '"';
54 var expectations = {
55 'horizontal-tb': {
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]}
61 'horizontal-bt': {
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]}
67 'vertical-lr': {
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]}
73 'vertical-rl': {
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' +
98 '</div>';
100 document.body.appendChild(container);
104 </script>
106 </body>
107 </html>