blob: 364b3eb24f19dea2666d986c95fc1f4f77128d7a (
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
|
<!DOCTYPE html>
<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>
.container {
position: relative;
height: 10px;
}
.anchor1 {
anchor-name: --a1;
width: 5px;
height: 7px;
background: orange;
}
.target {
position: absolute;
}
</style>
<body onload="checkLayoutForAnchorPos('.target')">
<div class="container">
<div class="anchor1"></div>
<div class="target"
style="min-width: anchor-size(--a1 width)"
data-expected-width=5></div>
<div class="target"
style="min-height: anchor-size(--a1 width)"
data-expected-height=5></div>
<div class="target"
style="max-width: anchor-size(--a1 width)"
data-expected-width=5>
<div style="width: 100px"></div>
</div>
<div class="target"
style="max-height: anchor-size(--a1 width)"
data-expected-height=5>
<div style="height: 100px"></div>
</div>
</div>
</body>
|