Skip to content

Commit dedf2fa

Browse files
vinhillmoz-wptsync-bot
authored andcommitted
Make touch and wheel events without non-passive listeners uncancelable.
According to the spec https://w3c.github.io/touch-events/#cancelability, the touchstart, touchend and touchmove events should be uncancelable if there are no non-passive listeners. According to https://w3c.github.io/uievents/#cancelability-of-wheel-events, this also holds for wheel events. Differential Revision: https://phabricator.services.mozilla.com/D218199 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1356293 gecko-commit: c57d28db5a72ffce969424f9302d5d315d148d75 gecko-reviewers: dom-core, edgar
1 parent 0985173 commit dedf2fa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<meta charset=utf-8>
3+
<title></title>
4+
<script src=/resources/testharness.js></script>
5+
<script src=/resources/testharnessreport.js></script>
6+
<script>
7+
async_test((t) => {
8+
const et = new EventTarget();
9+
et.addEventListener('test', t.step_func_done((e) => {
10+
assert_true(e.cancelable);
11+
}), {passive: true});
12+
et.dispatchEvent(new Event('test', {cancelable: true}));
13+
}, "A generic event with only passive listeners remains cancelable");
14+
</script>

0 commit comments

Comments
 (0)