blob: 9ab6b66d944cae1998f8d90add8cb3809575d0aa (
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>
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#determining">
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#propdef-anchor-name">
<link rel="author" href="mailto:kojii@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script src="support/test-common.js"></script>
<style>
.relpos {
position: relative;
}
.abspos {
position: absolute;
}
.anchor1 {
anchor-name: --a1;
width: 10px;
height: 10px;
background: orange;
}
.target {
position: absolute;
width: anchor-size(--a1 width);
height: 10px;
background: lime;
}
</style>
<body onload="checkLayoutForAnchorPos('.target')">
<!-- In-flow and out-of-flow boxes in a containing block. -->
<div class="relpos">
<div class="target" data-expected-width=30></div>
<div>
<div class="target" data-expected-width=30></div>
<div class="relpos">
<div class="target" data-expected-width=0></div>
<div class="abspos">
<div class="target" data-expected-width=30></div>
<div class="relpos">
<div class="target" data-expected-width=40></div>
<div class="anchor1" style="width: 20px"></div>
<div class="anchor1" style="position: absolute; width: 10px"></div>
<div class="anchor1" style="width: 40px"></div>
<div class="anchor1" style="position: absolute; width: 30px"></div>
<div class="target" data-expected-width=30></div>
</div>
</div>
<div class="target" data-expected-width=30></div>
</div>
<div class="target" data-expected-width=30></div>
</div>
<div class="target" data-expected-width=30></div>
</div>
<!-- In-flow boxes in ancestors, after the propagated ones. -->
<div class="relpos">
<div>
<div class="relpos">
<div class="target" data-expected-width=0></div>
<div class="abspos">
<div class="relpos">
<div class="target" data-expected-width=20></div>
<div class="anchor1" style="width: 20px"></div>
<div class="anchor1" style="position: absolute; width: 10px"></div>
<div class="target" data-expected-width=10></div>
</div>
<div class="anchor1" style="width: 50px"></div>
<div class="target" data-expected-width=50></div>
</div>
<div class="target" data-expected-width=50></div>
</div>
<div class="anchor1" style="width: 60px"></div>
<div class="target" data-expected-width=70></div>
</div>
<div class="anchor1" style="width: 70px"></div>
<div class="target" data-expected-width=70></div>
</div>
<!-- Out-of-flow boxes in ancestors, after the propagated ones. -->
<div class="relpos">
<div>
<div class="relpos">
<div class="target" data-expected-width=0></div>
<div class="abspos">
<div class="relpos">
<div class="target" data-expected-width=20></div>
<div class="anchor1" style="width: 20px"></div>
<div class="anchor1" style="position: absolute; width: 10px"></div>
<div class="target" data-expected-width=10></div>
</div>
<div class="anchor1" style="position: absolute; width: 110px"></div>
<div class="target" data-expected-width=110></div>
</div>
<div class="target" data-expected-width=110></div>
</div>
<div class="target" data-expected-width=110></div>
</div>
<div class="anchor1" style="position: absolute; width: 100px"></div>
<div class="target" data-expected-width=100></div>
</div>
<!-- In-flow boxes in ancestors, before the propagated ones. -->
<div class="relpos">
<div>
<div class="relpos">
<div class="abspos">
<div class="relpos">
<div class="target" data-expected-width=20></div>
<div class="anchor1" style="position: absolute; width: 10px"></div>
<div class="anchor1" style="width: 20px"></div>
<div class="target" data-expected-width=20></div>
</div>
<div class="anchor1" style="width: 120px"></div>
<div class="target" data-expected-width=120></div>
</div>
<div class="anchor1" style="width: 110px"></div>
<div class="target" data-expected-width=110></div>
</div>
<div class="target" data-expected-width=100></div>
</div>
<div class="anchor1" style="width: 100px"></div>
<div class="target" data-expected-width=100></div>
</div>
<!-- Out-of-flow boxes in ancestors, before the propagated ones. -->
<div class="relpos">
<div class="target" data-expected-width=10></div>
<div class="anchor1" style="position: absolute; width: 100px"></div>
<div>
<div class="target" data-expected-width=10></div>
<div class="relpos">
<div class="target" data-expected-width=0></div>
<div class="anchor1" style="position: absolute; width: 110px"></div>
<div class="abspos">
<div class="target" data-expected-width=10></div>
<div class="anchor1" style="position: absolute; width: 120px"></div>
<div class="relpos">
<div class="target" data-expected-width=20></div>
<div class="anchor1" style="width: 20px"></div>
<div class="anchor1" style="position: absolute; width: 10px"></div>
<div class="target" data-expected-width=10></div>
</div>
<div class="target" data-expected-width=10></div>
</div>
<div class="target" data-expected-width=10></div>
</div>
<div class="target" data-expected-width=10></div>
</div>
<div class="target" data-expected-width=10></div>
</div>
</body>
|