Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>CSS Overflow Test: The ::scroll-marker moves to the body's group when inserting another body before it stops its overflow from propagating 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;
}
body:last-of-type::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>
document.documentElement.offsetTop;
// The overflow of the inserted body propagates to the viewport instead.
document.documentElement.insertBefore(document.createElement("body"),
document.body);
</script>