Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-anchor-position/anchor-scroll-composited-scrolling-003-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="test-wait">
<title>Tests that scrolling doesn't crash renderer when scroller becomes non-scroller</title>
<link rel="author" href="mailto:xiaochengh@chromium.org">
<style>
#scroller {
margin-top: 200px;
height: 200px;
overflow-y: scroll;
}
#anchor {
anchor-name: --a;
}
#spacer {
height: 400px;
}
#target {
position: fixed;
top: anchor(bottom);
left: anchor(left);
position-anchor: --a;
}
</style>
<div id="scroller">
<div id="spacer"></div>
<div id="anchor">anchor</div>
</div>
<div id="target">target</div>
<script type="module">
const raf = () => new Promise(resolve => requestAnimationFrame(resolve));
await raf();
await raf();
scroller.style.overflowY = 'visible';
// Force paint property update on target in the same frame
target.style.transform = 'scale(1)';
document.documentElement.classList.remove('test-wait');
</script>
</html>