summaryrefslogtreecommitdiffstats
path: root/dom/events/test/test_deltaMode_lines_always_enabled.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/events/test/test_deltaMode_lines_always_enabled.html
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/events/test/test_deltaMode_lines_always_enabled.html')
-rw-r--r--dom/events/test/test_deltaMode_lines_always_enabled.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/dom/events/test/test_deltaMode_lines_always_enabled.html b/dom/events/test/test_deltaMode_lines_always_enabled.html
new file mode 100644
index 0000000000..b1c2f44046
--- /dev/null
+++ b/dom/events/test/test_deltaMode_lines_always_enabled.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Test for always-enabling lines deltaMode</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<script src="/tests/SimpleTest/EventUtils.js"></script>
+<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
+<p id="display"></p>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1684001">Mozilla Bug 1684001</a>
+<div id="overflow" style="height: 300vh"></div>
+<pre id="test"></pre>
+<script>
+SimpleTest.waitForExplicitFinish();
+
+const HACK_PREF = "dom.event.wheel-deltaMode-lines.always-enabled";
+
+(async function() {
+ await SimpleTest.promiseFocus(window);
+ await SpecialPowers.pushPrefEnv({
+ set: [
+ [HACK_PREF, document.domain],
+ ["test.events.async.enabled", true],
+ ],
+ });
+ // FYI: Cannot use scrollingElement because it's center may be outside of the viewport.
+ await promiseElementReadyForUserInput(document.querySelector("a[href]"));
+ await SpecialPowers.pushPrefEnv({
+ clear: [
+ ["test.events.async.enabled"],
+ ],
+ });
+
+ document.addEventListener("wheel", e => {
+ e.deltaY; /* access the delta unchecked */
+ is(e.deltaMode, WheelEvent.DOM_DELTA_LINE, "Accessing wheel event data should return lines even if unchecked, if the pref is enabled for that domain");
+ SimpleTest.finish();
+ }, { once: true });
+
+ synthesizeWheel(document.scrollingElement, 10, 10, { deltaY: 3.0, deltaMode: WheelEvent.DOM_DELTA_LINE });
+}());
+</script>