summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-scroll-anchoring/nested-overflow-subtree-layout.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-scroll-anchoring/nested-overflow-subtree-layout.html
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-scroll-anchoring/nested-overflow-subtree-layout.html')
-rw-r--r--testing/web-platform/tests/css/css-scroll-anchoring/nested-overflow-subtree-layout.html51
1 files changed, 51 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-scroll-anchoring/nested-overflow-subtree-layout.html b/testing/web-platform/tests/css/css-scroll-anchoring/nested-overflow-subtree-layout.html
new file mode 100644
index 0000000000..e7696016bb
--- /dev/null
+++ b/testing/web-platform/tests/css/css-scroll-anchoring/nested-overflow-subtree-layout.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <title>Test that subtree layout with nested overflow preserves scroll anchoring.</title>
+ <link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org">
+ <link rel="help" href="https://drafts.csswg.org/css-scroll-anchoring/">
+ <link rel="match" href="nested-overflow-subtree-layout-ref.html">
+ <script src="/common/reftest-wait.js"></script>
+</head>
+<style>
+#outer {
+ overflow: hidden;
+ width: 500px;
+ height: 500px;
+}
+#inner {
+ overflow: auto;
+ position: relative;
+ width: 500px;
+ height: 2000px;
+}
+p {
+
+ font: 48pt monospace;
+}
+</style>
+</head>
+<body>
+<div id="outer">
+ <div id="inner">
+ <p>Anchor</p>
+ </div>
+</div>
+<script>
+const outer = document.querySelector("#outer");
+const inner = document.querySelector("#inner");
+
+onload = () => {
+ requestAnimationFrame(() => {
+ requestAnimationFrame(() => {
+ outer.scrollTo(0, 70);
+ requestAnimationFrame(() => {
+ const elem = document.createElement("p");
+ elem.textContent = "FAIL";
+ inner.insertBefore(elem, inner.firstChild);
+ takeScreenshot();
+ });
+ });
+ });
+};
+</script>