Files
sousa-gecko/testing/web-platform/tests/css/css-anchor-position/scroll-compensation-crash.html
T
Kiet Ho 44b5b41c59 Bug 2052075 [wpt PR 61031] - WebKit export of commit 316226@main, a=testonly
Automatic update from web-platform-tests
WebKit export of commit 316226@main

See https://commits.webkit.org/316226@main for the commit that adds
this test.

--

wpt-commits: 52af8da98c3237b4b2babbdf60cc39711a408e54
wpt-pr: 61031
2026-07-10 09:24:49 +00:00

49 lines
962 B
HTML

<!DOCTYPE html>
<title>WebKit crash in anchor scroll compensation code</title>
<link rel="author" title="Kiet Ho" href="mailto:kiet.ho@apple.com">
<link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#scroll">
<style>
#scroller {
overflow: scroll;
width: 500px;
height: 500px;
}
#anchor {
width: 50px;
height: 50px;
anchor-name: --anchor;
}
.anchored {
position: absolute;
/* Has to have a default anchor to trigger scroll compensation */
position-anchor: --anchor;
left: anchor(left);
width: 50px;
height: 50px;
}
</style>
<div id="scroller">
<div id="anchor"></div>
</div>
<div class="anchored"></div>
<div class="anchored"></div>
<div class="anchored"></div>
<div class="anchored"></div>
<div class="anchored"></div>
<script>
scroller.scrollTop = 200;
// Force layout.
scroller.offsetTop;
scroller.remove();
// Force layout.
document.body.offsetTop;
</script>