diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /gfx/layers/apz/test/mochitest/helper_bug1806400-2.html | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/layers/apz/test/mochitest/helper_bug1806400-2.html')
-rw-r--r-- | gfx/layers/apz/test/mochitest/helper_bug1806400-2.html | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_bug1806400-2.html b/gfx/layers/apz/test/mochitest/helper_bug1806400-2.html new file mode 100644 index 0000000000..8d2eeca58d --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_bug1806400-2.html @@ -0,0 +1,58 @@ +<!DOCTYPE html> +<html> +<meta name="viewport" content="width=device-width; initial-scale=0.4"> +<title>Tests that double-tap-to-zoom never activates elements inside a scrollable container</title> +<script src="/tests/SimpleTest/SimpleTest.js"></script> + <script src="/tests/SimpleTest/paint_listener.js"></script> +<script src="apz_test_utils.js"></script> +<script src="apz_test_native_event_utils.js"></script> +<style> +#scrollable { + height: 50vh; + width: 50vw; + background: yellow; + overflow: scroll; +} + +#scrollabletarget { + height: 200vh; + width: 200vh; + background: green; +} + +#scrollabletarget:active { + background: red; +} + +</style> +<div id="scrollable"> + <div id="scrollabletarget"> + </div> +</div> +<script> +async function test() { + ok(!scrollabletarget.matches(":active"), "should not be active initially"); + + let rAFID = requestAnimationFrame(function ensureInactive() { + let isActive = scrollabletarget.matches(":active"); + ok(!isActive, "Element activation should never happen!"); + if (!isActive) { + rAFID = requestAnimationFrame(ensureInactive); + } + }); + + await doubleTapOn(scrollabletarget, 50, 50, false /* useTouchpad */); + + cancelAnimationFrame(rAFID); +} + +if (getPlatform() != "mac" && getPlatform() != "android") { + ok(true, "Skipping test because double-tap-zoom isn't allowed on " + getPlatform()); + subtestDone(); +} else { + waitUntilApzStable() + .then(test) + .then(subtestDone, subtestFailed); +} +</script> +</html> |