Files
sousa-gecko/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-implicit-002.html
T
David Shin 3df39bdd60 Bug 2032165: Remove position-anchor: auto from [popover] in UA stylesheet. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,emilio
This is clarified in spec resolution [1].
Adjust WPT tests `anchor-scroll-implicit-00*.html`, which uses popovers with
`anchor()` functions, to use `position-area`, since what is used to anchor
is not the focus of these tests.

[1]: https://github.com/w3c/csswg-drafts/issues/13067#issuecomment-4239954367

Differential Revision: https://phabricator.services.mozilla.com/D294490
2026-04-17 15:18:58 +00:00

60 lines
1.2 KiB
HTML

<!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="help" href="https://drafts.csswg.org/css-anchor-position-1/">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<style>
.positioned {
position: absolute;
width: 100px;
height: 50px;
position-area: center bottom;
background: green;
border: none;
padding: 0;
margin: 0;
}
.container {
position: relative;
width: 100px;
height: 100px;
background: red;
}
.scroller {
width: 100%;
height: 100%;
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=container>
<div id=s class=scroller>
<div class=filler></div>
<button id=b class=anchor popovertarget="popover"></button>
<div class=filler></div>
</div>
<div class=positioned popover id="popover"></div>
</div>
<script>
b.click();
s.scrollTop = 50;
document.documentElement.classList.remove('reftest-wait');
</script>
</html>