Skip to content

Commit e24289f

Browse files
authored
1 parent de0f50c commit e24289f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!doctype HTML>
2+
<meta charset="utf8">
3+
<title>Content Visibility: hidden image</title>
4+
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
5+
<meta name="assert" content="content-visibility hidden content returns uptodate geometry with sibling content requiring layout">
6+
7+
<script src="/resources/testharness.js"></script>
8+
<script src="/resources/testharnessreport.js"></script>
9+
10+
<style>
11+
#hidden {
12+
content-visibility: hidden;
13+
}
14+
15+
#absolute {
16+
top: 100px;
17+
left: 100px;
18+
}
19+
</style>
20+
21+
<div id=sibling></div>
22+
<div id=hidden><div id=absolute></div></div>
23+
24+
<script>
25+
async_test((t) => {
26+
function runTest() {
27+
sibling.style.width = "10px";
28+
absolute.style.position = "absolute";
29+
sibling.getBoundingClientRect().top;
30+
31+
t.step(() => assert_equals(absolute.getBoundingClientRect().top, 108, "bounding client rect top"));
32+
t.step(() => assert_equals(absolute.getBoundingClientRect().left, 108, "bounding client rect left"));
33+
t.done();
34+
}
35+
onload = requestAnimationFrame(runTest);
36+
}, "content-visibility hidden content returns uptodate geometry with sibling content requiring layout");
37+
38+
</script>
39+
</html>

0 commit comments

Comments
 (0)