Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow Test: scroll-marker-contain property invalidation - reparenting nested anchors</title>
<link rel="match" href="scroll-marker-contain-001-ref.tentative.html">
<style>
.wrapper {
scroll-marker-contain: auto;
}
#scroller {
overflow: auto;
height: 130px;
width: 100px;
}
#scroller div {
width: 100px;
height: 100px;
background-color: blue;
margin: 5px;
}
a {
color: red;
}
a:target-current {
color: green;
}
</style>
<div class="wrapper">
<div id="target" class="wrapper">
<a href="#target1">t1</a>
<a href="#target2">t2</a>
<a href="#target3">t3</a>
<a href="#target4">t4</a>
</div>
</div>
<div id="scroller">
<div id="target1"></div>
<div id="target2"></div>
<div id="target3"></div>
<div id="target4"></div>
</div>
<script>
scroller.scrollTop = 400;
document.documentElement.offsetTop;
target.classList.remove('wrapper');
document.documentElement.offsetTop;
scroller.scrollTop = 0;
</script>