Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / css3 / flexbox / flex-justify-content.html
blob56f9f9221d31e04df82566b68d059ea3bbe31442
1 <!DOCTYPE html>
2 <html>
3 <style>
4 body {
5 margin: 0;
7 .flexbox {
8 width: 600px;
9 display: flex;
10 background-color: #aaa;
11 position: relative;
13 .flexbox div {
14 height: 20px;
15 border: 0;
16 flex: none;
19 .flexbox :nth-child(1) {
20 background-color: blue;
22 .flexbox :nth-child(2) {
23 background-color: green;
25 .flexbox :nth-child(3) {
26 background-color: red;
28 </style>
29 <script src="../../resources/check-layout.js"></script>
30 <body onload="checkLayout('.flexbox')">
31 <div class="flexbox">
32 <div data-expected-width="100" data-offset-x="0" style="flex: 1 0 0; max-width: 100px;"></div>
33 <div data-expected-width="100" data-offset-x="100" style="width: 100px;"></div>
34 <div data-expected-width="100" data-offset-x="200" style="width: 100px;"></div>
35 </div>
37 <div class="flexbox" style="justify-content: flex-end">
38 <div data-expected-width="100" data-offset-x="300" style="flex: 0 0 100px;"></div>
39 <div data-expected-width="100" data-offset-x="400" style="width: 100px;"></div>
40 <div data-expected-width="100" data-offset-x="500" style="width: 100px;"></div>
41 </div>
43 <div class="flexbox" style="justify-content: center">
44 <div data-expected-width="100" data-offset-x="150" style="flex: 1 0 0; max-width: 100px;"></div>
45 <div data-expected-width="100" data-offset-x="250" style="width: 100px;"></div>
46 <div data-expected-width="100" data-offset-x="350" style="width: 100px;"></div>
47 </div>
49 <div class="flexbox" style="justify-content: center">
50 <div data-expected-width="200" data-offset-x="0" style="flex: 1 100px;"></div>
51 <div data-expected-width="200" data-offset-x="200" style="flex: 1 100px;"></div>
52 <div data-expected-width="200" data-offset-x="400" style="flex: 1 100px;"></div>
53 </div>
55 <!-- True centering on overflow. -->
56 <div class="flexbox" style="justify-content: center">
57 <div data-expected-width="800" data-offset-x="-100" style="width: 800px;"></div>
58 </div>
60 <div class="flexbox" style="justify-content: space-between">
61 <div data-expected-width="100" data-offset-x="0" style="flex: 1 0 0; max-width: 100px;"></div>
62 <div data-expected-width="100" data-offset-x="250" style="width: 100px;"></div>
63 <div data-expected-width="100" data-offset-x="500" style="width: 100px;"></div>
64 </div>
66 <div class="flexbox" style="justify-content: space-between">
67 <div data-expected-width="200" data-offset-x="0" style="flex: 1 100px;"></div>
68 <div data-expected-width="200" data-offset-x="200" style="flex: 1 100px;"></div>
69 <div data-expected-width="200" data-offset-x="400" style="flex: 1 100px;"></div>
70 </div>
72 <!-- If there's only one child, we justify-content: flex-start. -->
73 <div class="flexbox" style="justify-content: space-between">
74 <div data-expected-width="100" data-offset-x="0" style="flex: 1 0 0; max-width: 100px;"></div>
75 </div>
77 <div class="flexbox" style="justify-content: space-around">
78 <div data-expected-width="100" data-offset-x="50" style="flex: 1 0 0; max-width: 100px;"></div>
79 <div data-expected-width="100" data-offset-x="250" style="width: 100px;"></div>
80 <div data-expected-width="100" data-offset-x="450" style="width: 100px;"></div>
81 </div>
83 <!-- If there's only one child, we justify-content center. -->
84 <div class="flexbox" style="justify-content: space-around">
85 <div data-expected-width="100" data-offset-x="250" style="flex: 1 0 0; max-width: 100px;"></div>
86 </div>
88 <!-- True centering on overflow. -->
89 <div class="flexbox" style="justify-content: space-around">
90 <div data-expected-width="800" data-offset-x="-100" style="width: 800px;"></div>
91 </div>
93 <!-- Make sure we don't crash with no children. -->
94 <div class="flexbox" style="justify-content: space-around"></div>
96 <!-- margin:auto applies before justify-content. -->
97 <div class="flexbox" style="justify-content: flex-end">
98 <div data-expected-width="100" data-offset-x="0" style="width: 100px;"></div>
99 <div data-expected-width="100" data-offset-x="100" style="width: 100px; margin-right: auto"></div>
100 <div data-expected-width="100" data-offset-x="500" style="width: 100px;"></div>
101 </div>
103 <!-- The justify-content does nothing here because we are shrinking. -->
104 <div class="flexbox" style="justify-content: flex-end">
105 <div data-expected-width="200" data-offset-x="0" style="flex: 0 1 300px;"></div>
106 <div data-expected-width="200" data-offset-x="200" style="width: 200px;"></div>
107 <div data-expected-width="200" data-offset-x="400" style="width: 200px;"></div>
108 </div>
110 <!-- We overflow the flexbox (no negative flexing) and align the end. The overflow is to the left. -->
111 <div class="flexbox" style="justify-content: flex-end">
112 <div data-expected-width="300" data-offset-x="-100" style="flex: 1 0 300px;"></div>
113 <div data-expected-width="200" data-offset-x="200" style="width: 200px;"></div>
114 <div data-expected-width="200" data-offset-x="400" style="width: 200px;"></div>
115 </div>
117 </body>
118 </html>