Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-anchor-position/anchor-scroll-implicit-001.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class=reftest-wait>
<title>Tests that scroll adjustments of implicitly anchored elements are applied correctly</title>
<link rel="author" href="mailto:dshin@mozilla.com">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<style>
.positioned {
position: fixed;
width: 100px;
height: 50px;
left: anchor(left);
top: anchor(bottom);
background: green;
border: none;
padding: 0;
margin: 0;
}
.container {
position: relative;
width: 100px;
height: 100px;
background: red;
overflow: hidden;
}
.filler {
width: 1px;
height: 50px;
}
.anchor {
width: 100px;
height: 50px;
background: green;
border: none;
padding: 0;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class=positioned popover id="popover"></div>
<div id=s class=container>
<div class=filler></div>
<button id=b class=anchor popovertarget="popover"></button>
<div class=filler></div>
</div>
<script>
b.click();
s.scrollTop = 50;
document.documentElement.classList.remove('reftest-wait');
</script>
</html>