summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/layout-instability/shift-with-counterscroll-2.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/layout-instability/shift-with-counterscroll-2.html
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--testing/web-platform/tests/layout-instability/shift-with-counterscroll-2.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/testing/web-platform/tests/layout-instability/shift-with-counterscroll-2.html b/testing/web-platform/tests/layout-instability/shift-with-counterscroll-2.html
new file mode 100644
index 0000000000..d99723010e
--- /dev/null
+++ b/testing/web-platform/tests/layout-instability/shift-with-counterscroll-2.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>Layout Instability: shift with counterscroll not counted, with 2 scrollers</title>
+<link rel="help" href="https://wicg.github.io/layout-instability/" />
+<style>
+.scroller {
+ overflow: scroll;
+ position: absolute;
+ left: 20px;
+ top: 20px;
+ width: 200px;
+ height: 200px;
+}
+.content {
+ width: 170px;
+ height: 600px;
+}
+.changer {
+ position: relative;
+ background: yellow;
+ left: 10px;
+ top: 100px;
+ width: 150px;
+ height: 150px;
+}
+
+</style>
+<div id="scroller1" class="scroller">
+ <div class="content">
+ <div id="changer1" class="changer"></div>
+ </div>
+</div>
+<div id="scroller2" class="scroller">
+ <div class="content">
+ <div id="changer2" class="changer"></div>
+ </div>
+</div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/util.js"></script>
+<script>
+
+promise_test(async () => {
+ const watcher = new ScoreWatcher;
+
+ // Wait for the initial render to complete.
+ await waitForAnimationFrames(2);
+
+ // Top goes from 100 to 200. scroll by 100 to counter it.
+ changer1.style.top = "200px";
+ scroller1.scrollTop = 100;
+ // Top goes from 100 to 300. scroll by 200 to counter it.
+ changer2.style.top = "300px";
+ scroller2.scrollTop = 200;
+
+ await waitForAnimationFrames(3);
+ assert_equals(watcher.score, 0);
+}, "Shift with counterscroll not counted, with 2 scrollers.");
+
+</script>