summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-flexbox/inline-flexbox-wrap-vertically-width-calculation.html
blob: e9010cf96cff8d131e0319168d7570285331dd2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html>
<title>CSS Flexbox: Inline flexbox width calculation with flex-direction: column and flex-wrap</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-direction-property">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-wrap-property">
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#Computing_widths_and_margins">
<link href="support/flexbox.css" rel="stylesheet">
<meta name="assert" content="This test checks that width is correctly computed for flexbox with flex-direction: column and flex-wrap.">
<style>
.inline-flexbox {
    background-color: #aaa;
    position: relative;
}

.writing-mode-vertical {
  writing-mode: vertical-rl;
}
.inline-flexbox > * {
    flex: none;
}
.inline-flexbox :nth-child(1) {
    background-color: lightblue;
}
.inline-flexbox :nth-child(2) {
    background-color: lightgreen;
}
.inline-flexbox :nth-child(3) {
    background-color: pink;
}
.inline-flexbox :nth-child(4) {
    background-color: yellow;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.inline-flexbox');">
<div id=log></div>
<div class="inline-flexbox column align-content-flex-start wrap" data-expected-width="110" data-expected-height="60">
  <div style="width: 100px; height: 20px" data-offset-x="0" data-offset-y="0"></div>
  <div style="width: 50px; height: 10px" data-offset-x="0" data-offset-y="20"></div>
  <div style="width: 70px; height: 10px" data-offset-x="0" data-offset-y="30"></div>
  <div style="width: 110px; height: 20px" data-offset-x="0" data-offset-y="40"></div>
</div>

<div class="inline-flexbox column align-content-flex-start wrap" style="height: 35px" data-expected-width="80" data-expected-height="35">
  <div style="width: 10px; height: 20px" data-offset-x="0" data-offset-y="0"></div>
  <div style="width: 50px; height: 10px" data-offset-x="0" data-offset-y="20"></div>
  <div style="width: 80px; height: 10px" data-offset-x="50" data-offset-y="0"></div>
  <div style="width: 40px; height: 20px" data-offset-x="50" data-offset-y="10"></div>
</div>

<div class="inline-flexbox column align-content-flex-start wrap writing-mode-vertical" data-expected-width="280" data-expected-height="70">
  <div style="width: 50px; height: 20px" data-offset-x="230" data-offset-y="0"></div>
  <div style="width: 100px; height: 70px" data-offset-x="130" data-offset-y="0"></div>
  <div style="width: 30px; height: 50px" data-offset-x="100" data-offset-y="0"></div>
  <div style="width: 100px; height: 30px" data-offset-x="0" data-offset-y="0"></div>
</div>

<div class="inline-flexbox column align-content-flex-start wrap writing-mode-vertical" style="width: 200px" data-expected-width="200" data-expected-height="70">
  <div style="width: 50px; height: 20px" data-offset-x="150" data-offset-y="0"></div>
  <div style="width: 100px; height: 70px" data-offset-x="50" data-offset-y="0"></div>
  <div style="width: 30px; height: 50px" data-offset-x="20" data-offset-y="0"></div>
  <div style="width: 100px; height: 30px" data-offset-x="100" data-offset-y="70"></div>
</div>

<div class="inline-flexbox column align-content-flex-start wrap-reverse" data-expected-width="110" data-expected-height="60">
  <div style="width: 100px; height: 20px" data-offset-x="10" data-offset-y="0"></div>
  <div style="width: 50px; height: 10px" data-offset-x="60" data-offset-y="20"></div>
  <div style="width: 70px; height: 10px" data-offset-x="40" data-offset-y="30"></div>
  <div style="width: 110px; height: 20px" data-offset-x="0" data-offset-y="40"></div>
</div>

<div class="inline-flexbox column align-content-flex-start wrap-reverse" style="height: 35px" data-expected-width="80" data-expected-height="35">
  <div style="width: 10px; height: 20px" data-offset-x="70" data-offset-y="0"></div>
  <div style="width: 50px; height: 10px" data-offset-x="30" data-offset-y="20"></div>
  <div style="width: 80px; height: 10px" data-offset-x="-50" data-offset-y="0"></div>
  <div style="width: 40px; height: 20px" data-offset-x="-10" data-offset-y="10"></div>
</div>

<div class="inline-flexbox column align-content-flex-start wrap-reverse writing-mode-vertical" data-expected-width="280" data-expected-height="70">
  <div style="width: 50px; height: 20px" data-offset-x="230" data-offset-y="50"></div>
  <div style="width: 100px; height: 50px" data-offset-x="130" data-offset-y="20"></div>
  <div style="width: 30px; height: 30px" data-offset-x="100" data-offset-y="40"></div>
  <div style="width: 100px; height: 70px" data-offset-x="0" data-offset-y="0"></div>
</div>

<div class="inline-flexbox column align-content-flex-start wrap-reverse writing-mode-vertical" style="width: 200px" data-expected-width="200" data-expected-height="70">
  <div style="width: 50px; height: 20px" data-offset-x="150" data-offset-y="50"></div>
  <div style="width: 100px; height: 50px" data-offset-x="50" data-offset-y="20"></div>
  <div style="width: 30px; height: 70px" data-offset-x="20" data-offset-y="0"></div>
  <div style="width: 100px; height: 30px" data-offset-x="100" data-offset-y="-30"></div>
</div>

<div class="inline-flexbox column-reverse align-content-flex-start wrap" data-expected-width="110" data-expected-height="60">
  <div style="width: 100px; height: 20px" data-offset-x="0" data-offset-y="40"></div>
  <div style="width: 50px; height: 10px" data-offset-x="0" data-offset-y="30"></div>
  <div style="width: 70px; height: 10px" data-offset-x="0" data-offset-y="20"></div>
  <div style="width: 110px; height: 20px" data-offset-x="0" data-offset-y="0"></div>
</div>

<div class="inline-flexbox column-reverse align-content-flex-start wrap" style="height: 35px" data-expected-width="80" data-expected-height="35">
  <div style="width: 10px; height: 20px" data-offset-x="0" data-offset-y="15"></div>
  <div style="width: 50px; height: 10px" data-offset-x="0" data-offset-y="5"></div>
  <div style="width: 80px; height: 10px" data-offset-x="50" data-offset-y="25"></div>
  <div style="width: 40px; height: 20px" data-offset-x="50" data-offset-y="5"></div>
</div>

<div class="inline-flexbox column-reverse align-content-flex-start wrap writing-mode-vertical" data-expected-width="280" data-expected-height="70">
  <div style="width: 50px; height: 20px" data-offset-x="0" data-offset-y="0"></div>
  <div style="width: 100px; height: 50px" data-offset-x="50" data-offset-y="0"></div>
  <div style="width: 30px; height: 70px" data-offset-x="150" data-offset-y="0"></div>
  <div style="width: 100px; height: 30px" data-offset-x="180" data-offset-y="0"></div>
</div>

<div class="inline-flexbox column-reverse align-content-flex-start wrap writing-mode-vertical" style="width: 200px" data-expected-width="200" data-expected-height="70">
  <div style="width: 50px; height: 20px" data-offset-x="0" data-offset-y="0"></div>
  <div style="width: 100px; height: 70px" data-offset-x="50" data-offset-y="0"></div>
  <div style="width: 30px; height: 50px" data-offset-x="150" data-offset-y="0"></div>
  <div style="width: 100px; height: 30px" data-offset-x="0" data-offset-y="70"></div>
</div>

<div class="inline-flexbox column-reverse align-content-flex-start wrap-reverse" data-expected-width="110" data-expected-height="60">
  <div style="width: 100px; height: 20px" data-offset-x="10" data-offset-y="40"></div>
  <div style="width: 50px; height: 10px" data-offset-x="60" data-offset-y="30"></div>
  <div style="width: 70px; height: 10px" data-offset-x="40" data-offset-y="20"></div>
  <div style="width: 110px; height: 20px" data-offset-x="0" data-offset-y="0"></div>
</div>

<div class="inline-flexbox column-reverse align-content-flex-start wrap-reverse" style="height: 35px" data-expected-width="80" data-expected-height="35">
  <div style="width: 10px; height: 20px" data-offset-x="70" data-offset-y="15"></div>
  <div style="width: 50px; height: 10px" data-offset-x="30" data-offset-y="5"></div>
  <div style="width: 80px; height: 10px" data-offset-x="-50" data-offset-y="25"></div>
  <div style="width: 40px; height: 20px" data-offset-x="-10" data-offset-y="5"></div>
</div>

<div class="inline-flexbox column-reverse align-content-flex-start wrap-reverse writing-mode-vertical" data-expected-width="280" data-expected-height="70">
  <div style="width: 50px; height: 70px" data-offset-x="0" data-offset-y="0"></div>
  <div style="width: 100px; height: 20px" data-offset-x="50" data-offset-y="50"></div>
  <div style="width: 30px; height: 50px" data-offset-x="150" data-offset-y="20"></div>
  <div style="width: 100px; height: 30px" data-offset-x="180" data-offset-y="40"></div>
</div>

<div class="inline-flexbox column-reverse align-content-flex-start wrap-reverse writing-mode-vertical" style="width: 200px" data-expected-width="200" data-expected-height="70">
  <div style="width: 50px; height: 20px" data-offset-x="0" data-offset-y="50"></div>
  <div style="width: 100px; height: 50px" data-offset-x="50" data-offset-y="20"></div>
  <div style="width: 30px; height: 30px" data-offset-x="150" data-offset-y="40"></div>
  <div style="width: 100px; height: 70px" data-offset-x="0" data-offset-y="-50"></div>
</div>
</body>
</html>