diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /gfx/layers/apz/test/mochitest/helper_bug1346632.html | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/layers/apz/test/mochitest/helper_bug1346632.html')
-rw-r--r-- | gfx/layers/apz/test/mochitest/helper_bug1346632.html | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_bug1346632.html b/gfx/layers/apz/test/mochitest/helper_bug1346632.html new file mode 100644 index 0000000000..d08afc1481 --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_bug1346632.html @@ -0,0 +1,69 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width; initial-scale=1.0"> + <title>Dragging the scrollbar on a page with a fixed-positioned element just past the right edge of the content</title> + <script type="application/javascript" src="apz_test_native_event_utils.js"></script> + <script type="application/javascript" src="apz_test_utils.js"></script> + <script src="/tests/SimpleTest/paint_listener.js"></script> + <style> + body { + height: 2000px; + } + #fixed { + width: 240px; + height: 100%; + position: fixed; + top: 0px; + right: -240px; + z-index: 1000; + overflow-y: scroll; + } + #fixed-content { + height: 2000px; + } + </style> + <script type="text/javascript"> +async function test() { + var root = document.scrollingElement; + var scrollPos = root.scrollTop; + var scrollPromise = new Promise((resolve, reject) => { + document.addEventListener("scroll", () => { + ok(root.scrollTop > scrollPos, "document scrolled after dragging scrollbar"); + resolve(); + }, {once: true}); + }); + + if (window.innerWidth == root.clientWidth) { + // No scrollbar, abort the test. This can happen e.g. on local macOS runs + // with OS settings to only show scrollbars on trackpad/mouse activity. + ok(false, "No scrollbars found, cannot run this test!"); + return; + } + + var scrollbarX = (window.innerWidth + root.clientWidth) / 2; + // Move the mouse to the scrollbar + await promiseNativeMouseEvent(root, scrollbarX, 100, nativeMouseMoveEventMsg()); + // mouse down + await promiseNativeMouseEvent(root, scrollbarX, 100, nativeMouseDownEventMsg()); + // drag vertically + await promiseNativeMouseEvent(root, scrollbarX, 150, nativeMouseMoveEventMsg()); + // wait for the scroll listener to fire + await scrollPromise; + // and release + await promiseNativeMouseEvent(root, scrollbarX, 150, nativeMouseUpEventMsg()); +} + +waitUntilApzStable() +.then(test) +.then(subtestDone, subtestFailed); + + </script> +</head> +<body> + <div id="fixed"> + <p id="fixed-content"></p> + </div> +</body> +</html> |