Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-overflow/scroll-markers/scroll-marker-group-body-overflow-propagation-001-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Overflow Test: Changing the root overflow, which changes whether the body overflow propagates to the viewport, does not crash</title>
<style>
html {
scroll-marker-group: before;
}
body {
scroll-marker-group: before;
overflow: auto;
}
#item::scroll-marker {
content: "";
}
</style>
<div id="item"></div>
<script>
const html = document.documentElement;
html.offsetTop;
// Stop propagating the body overflow to the viewport, which moves #item's
// ::scroll-marker from the root's group to the body's group.
html.style.overflow = "clip";
html.offsetTop;
// Propagate the body overflow to the viewport again.
html.style.overflow = "visible";
</script>