diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/layout-instability/shift-with-counter-scroll-and-transform.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/layout-instability/shift-with-counter-scroll-and-transform.html')
-rw-r--r-- | testing/web-platform/tests/layout-instability/shift-with-counter-scroll-and-transform.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/testing/web-platform/tests/layout-instability/shift-with-counter-scroll-and-transform.html b/testing/web-platform/tests/layout-instability/shift-with-counter-scroll-and-transform.html new file mode 100644 index 0000000000..b4e4a99c1c --- /dev/null +++ b/testing/web-platform/tests/layout-instability/shift-with-counter-scroll-and-transform.html @@ -0,0 +1,62 @@ +<!DOCTYPE html> +<title>Layout Instability: shift with counter scroll and transform not counted</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: 600px; + 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); + + changer1.style.top = "250px"; + changer1.style.transform = "translateY(-50px)"; + // 250 - 50 = 200; old position is 100; hence scrollTop to counter is 100. + scroller1.scrollTop = 100; + + changer2.style.left = "220px"; + changer2.style.transform = "translateX(80px)"; + // 220 + 80 = 300; old position is 10; hence scrollTop to counter is 290. + scroller2.scrollLeft = 290; + + await waitForAnimationFrames(3); + assert_equals(watcher.score, 0); +}, "Shift with counter scroll and transform not counted."); + +</script> |