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-marker-group-008.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: two scroll-marker-group with dynamic change</title>
<link rel="match" href="scroll-marker-group-008-ref.html">
<style>
div::scroll-marker-group {
display: flex;
height: 50px;
width: 100px;
}
div.scroll-marker-group-before {
overflow: auto;
scroll-marker-group: before;
}
div.scroll-marker-group-before::scroll-marker-group {
background: green;
}
div.scroll-marker-group-after {
overflow: auto;
scroll-marker-group: after;
}
div.scroll-marker-group-after::scroll-marker-group {
background: yellow;
}
</style>
<div id="target1"></div>
<div id="target2"></div>
<script>
document.documentElement.offsetTop;
target1.className = "scroll-marker-group-before";
target2.className = "scroll-marker-group-after";
document.documentElement.offsetTop;
target1.className = "scroll-marker-group-after";
document.documentElement.offsetTop;
target1.className = "";
document.documentElement.offsetTop;
</script>