From a0acf13c9c8dda3b434453f1d194806a18f457c1 Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Mon, 10 Aug 2020 14:37:50 +0000 Subject: [PATCH] Bug 1651033 - Prevent default for pointerup/down events with DevTools node picker r=gl Differential Revision: https://phabricator.services.mozilla.com/D86502 --- devtools/server/actors/accessibility/walker.js | 4 ++++ devtools/server/actors/inspector/node-picker.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/devtools/server/actors/accessibility/walker.js b/devtools/server/actors/accessibility/walker.js index 907271448054..3868effc5171 100644 --- a/devtools/server/actors/accessibility/walker.js +++ b/devtools/server/actors/accessibility/walker.js @@ -1109,6 +1109,8 @@ const AccessibleWalkerActor = ActorClassWithSpec(accessibleWalkerSpec, { target.addEventListener("dblclick", this._preventContentEvent, true); target.addEventListener("keydown", this.onKey, true); target.addEventListener("keyup", this._preventContentEvent, true); + target.addEventListener("pointerup", this._preventContentEvent, true); + target.addEventListener("pointerdown", this._preventContentEvent, true); }, /** @@ -1133,6 +1135,8 @@ const AccessibleWalkerActor = ActorClassWithSpec(accessibleWalkerSpec, { target.removeEventListener("dblclick", this._preventContentEvent, true); target.removeEventListener("keydown", this.onKey, true); target.removeEventListener("keyup", this._preventContentEvent, true); + target.removeEventListener("pointerup", this._preventContentEvent, true); + target.removeEventListener("pointerdown", this._preventContentEvent, true); this._resetStateAndReleaseTarget(); }, diff --git a/devtools/server/actors/inspector/node-picker.js b/devtools/server/actors/inspector/node-picker.js index fa7502996805..4839595eb6a9 100644 --- a/devtools/server/actors/inspector/node-picker.js +++ b/devtools/server/actors/inspector/node-picker.js @@ -250,6 +250,8 @@ class NodePicker { target.addEventListener("dblclick", this._preventContentEvent, true); target.addEventListener("keydown", this._onKey, true); target.addEventListener("keyup", this._preventContentEvent, true); + target.addEventListener("pointerup", this._preventContentEvent, true); + target.addEventListener("pointerdown", this._preventContentEvent, true); this._setSuppressedEventListener(this._onSuppressedEvent); } @@ -267,6 +269,8 @@ class NodePicker { target.removeEventListener("dblclick", this._preventContentEvent, true); target.removeEventListener("keydown", this._onKey, true); target.removeEventListener("keyup", this._preventContentEvent, true); + target.removeEventListener("pointerup", this._preventContentEvent, true); + target.removeEventListener("pointerdown", this._preventContentEvent, true); this._setSuppressedEventListener(null); }