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 /gfx/layers/apz/test/mochitest/helper_wheelevents_handoff_on_iframe.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/layers/apz/test/mochitest/helper_wheelevents_handoff_on_iframe.html')
-rw-r--r-- | gfx/layers/apz/test/mochitest/helper_wheelevents_handoff_on_iframe.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_wheelevents_handoff_on_iframe.html b/gfx/layers/apz/test/mochitest/helper_wheelevents_handoff_on_iframe.html new file mode 100644 index 0000000000..79101b2ca5 --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_wheelevents_handoff_on_iframe.html @@ -0,0 +1,52 @@ +<head> + <meta name="viewport" content="width=device-width; initial-scale=1.0"> + <title>Test that wheel events on an unscrollable OOP iframe are handoff-ed</title> + <script src="apz_test_native_event_utils.js"></script> + <script src="apz_test_utils.js"></script> + <script src="/tests/SimpleTest/paint_listener.js"></script> + <style> + iframe { + height: 201px; + border: none; + } + </style> +</head> +<body> + <div id="iframe-container" style="overflow-y: scroll; height: 200px;"> + <iframe src="https://example.com/tests/gfx/layers/apz/test/mochitest/helper_wheelevents_handoff_on_iframe_child.html"></iframe> + </div> + <div style="height: 200vh;"></div> + <script type="application/javascript"> +async function test() { + const scrollContainer = document.querySelector("#iframe-container"); + let scrollEventPromise = waitForScrollEvent(scrollContainer); + + // Send a wheel event on the iframe. + const iframe = document.querySelector("iframe"); + await synthesizeNativeWheel(iframe, 50, 50, 0, -50); + await scrollEventPromise; + + // The wheel event should be handoff-ed to the parent scroll container. + is(scrollContainer.scrollTop, scrollContainer.scrollTopMax, + "The scroll position in the parent scroll container should be at the bottom"); + + // Make sure the wheel event wasn't handoff-ed to the root scroller. + is(window.scrollY, 0, "The root scroll position should be 0"); + + await promiseFrame(); + scrollEventPromise = waitForScrollEvent(window); + // Send a wheel event on the iframe again. + await synthesizeNativeWheel(iframe, 50, 50, 0, -50); + await scrollEventPromise; + + // Now it should be handoff-ed to the root scroller. + ok(window.scrollY > 0, + "The wheel event should have been handoff-ed to the root scroller"); +} + +waitUntilApzStable() +.then(test) +.then(subtestDone, subtestFailed); + + </script> +</body> |