Skip to content

Commit 8c68a9a

Browse files
committed
1 parent 360aba6 commit 8c68a9a

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

css/css-anchor-position/anchor-scroll-position-try-015.tentative.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<!DOCTYPE html>
2+
3+
<html class="reftest-wait">
4+
25
<title>Scrolling further up shouldn't trigger the anchored element to grow.</title>
36
<link rel="help" href="https://drafts.csswg.org/css-anchor-position/#position-try-fallbacks">
47
<link rel="match" href="anchor-scroll-position-try-015-ref.html">
8+
<script src="/common/reftest-wait.js"></script>
9+
<script src="/common/rendering-utils.js"></script>
10+
511
<style>
612
#anchor {
713
anchor-name: --a;
@@ -31,11 +37,15 @@
3137
</div>
3238

3339
<script>
34-
scroller.scrollTop = 150;
35-
requestAnimationFrame(() => {
36-
requestAnimationFrame(() => {
37-
scroller.scrollTop = 200;
38-
document.documentElement.classList.remove('reftest-wait');
39-
});
40+
window.addEventListener("load", async () => {
41+
scroller.scrollTop = 150;
42+
await waitForAtLeastOneFrame();
43+
44+
scroller.scrollTop = 200;
45+
await waitForAtLeastOneFrame();
46+
47+
takeScreenshot();
4048
});
4149
</script>
50+
51+
</html>

0 commit comments

Comments
 (0)