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-006.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Overflow Test: The ::scroll-marker moves to the root's group when removing the first body lets the overflow of the next body propagate to the viewport</title>
<link rel="match" href="scroll-marker-group-body-overflow-propagation-ref.html">
<style>
html {
scroll-marker-group: before;
}
body {
scroll-marker-group: before;
overflow: hidden;
margin: 0;
}
html::scroll-marker-group,
body::scroll-marker-group {
height: 0;
overflow: hidden;
}
html::scroll-marker-group {
height: 100px;
}
#item::scroll-marker {
content: "";
display: block;
width: 100px;
height: 100px;
background: green;
}
</style>
<div id="item"></div>
<p>Test passes if there is a filled green square.</p>
<script>
const first_body = document.createElement("body");
document.documentElement.insertBefore(first_body, document.body);
document.documentElement.offsetTop;
first_body.remove();
</script>