Files
sousa-gecko/testing/web-platform/tests/css/css-anchor-position/position-visibility-initial.html
T
Kiet Ho e914da6edc Bug 1979856 [wpt PR 54015] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=293421, a=testonly
Automatic update from web-platform-tests
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=293421

--

wpt-commits: 5c800f6dd9500d4cc175756cac9106447a75b150
wpt-pr: 54015
2025-08-06 15:18:22 +00:00

49 lines
1.1 KiB
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<meta name="assert" content="Position-visibility: anchors-visible should be the initial value." />
<title>CSS Anchor Positioning Test: position-visibility: anchors-visible</title>
<link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#position-visibility">
<link rel="match" href="position-visibility-initial-ref.html">
<style>
#scroll-container {
overflow: hidden scroll;
width: 300px;
height: 100px;
}
#anchor {
anchor-name: --a1;
width: 100px;
height: 100px;
background: orange;
}
#spacer {
height: 100px;
}
#target {
position-anchor: --a1;
position-area: bottom right;
width: 100px;
height: 100px;
background: red;
position: absolute;
top: 0;
left: 0;
}
</style>
<div id="scroll-container">
<div id="anchor">anchor</div>
<div id="spacer"></div>
<div id="target">target</div>
</div>
<script>
const scroller = document.getElementById('scroll-container');
scroller.scrollTop = 100;
// #target should not be visible because #anchor is scrolled out of view.
</script>