Backed out 1 changesets (bug 1543940) for mochitest failure at devtools/client/accessibility/test/mochitest/test_accessible_row_context_menu.html
authorDaniel Varga <dvarga@mozilla.com>
Wed, 08 May 2019 19:50:14 +0300
changeset 531909 6986b4b5c3db2c68d9b8d694d942c01a265a1afd
parent 531908 685e0cd74c2e8854e87ad8b0555a38a0f05bd605
child 531910 990c8a382cf38762b2d81bbcba3c56e1b9920bec
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1543940
milestone68.0a1
backs out7fe9661e8510f9bf0430573aaceb7ed478e472b2
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 1 changesets (bug 1543940) for mochitest failure at devtools/client/accessibility/test/mochitest/test_accessible_row_context_menu.html Backed out changeset 7fe9661e8510 (bug 1543940)
devtools/client/framework/toolbox.js
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -170,17 +170,16 @@ function Toolbox(target, selectedTool, h
   this._onPickerStarting = this._onPickerStarting.bind(this);
   this._onPickerStarted = this._onPickerStarted.bind(this);
   this._onPickerStopped = this._onPickerStopped.bind(this);
   this._onPickerCanceled = this._onPickerCanceled.bind(this);
   this._onInspectObject = this._onInspectObject.bind(this);
   this._onNewSelectedNodeFront = this._onNewSelectedNodeFront.bind(this);
   this._onToolSelected = this._onToolSelected.bind(this);
   this._onTargetClosed = this._onTargetClosed.bind(this);
-  this._onContextMenu = this._onContextMenu.bind(this);
   this.updateToolboxButtonsVisibility = this.updateToolboxButtonsVisibility.bind(this);
   this.updateToolboxButtons = this.updateToolboxButtons.bind(this);
   this.selectTool = this.selectTool.bind(this);
   this._pingTelemetrySelectTool = this._pingTelemetrySelectTool.bind(this);
   this.toggleSplitConsole = this.toggleSplitConsole.bind(this);
   this.toggleOptions = this.toggleOptions.bind(this);
   this.togglePaintFlashing = this.togglePaintFlashing.bind(this);
   this.toggleDragging = this.toggleDragging.bind(this);
@@ -510,16 +509,31 @@ Toolbox.prototype = {
       this.isReady = true;
 
       const framesPromise = this._listFrames();
 
       Services.prefs.addObserver("devtools.cache.disabled", this._applyCacheSettings);
       Services.prefs.addObserver("devtools.serviceWorkers.testing.enabled",
                                  this._applyServiceWorkersTestingSettings);
 
+      // Register listener for handling context menus in standard
+      // input elements: <input> and <textarea>.
+      // There is also support for custom input elements using
+      // .devtools-input class (e.g. CodeMirror instances).
+      this.doc.addEventListener("contextmenu", (e) => {
+        if (e.originalTarget.closest("input[type=text]") ||
+            e.originalTarget.closest("input[type=search]") ||
+            e.originalTarget.closest("input:not([type])") ||
+            e.originalTarget.closest(".devtools-input") ||
+            e.originalTarget.closest("textarea")) {
+          e.stopPropagation();
+          e.preventDefault();
+          this.openTextBoxContextMenu(e.screenX, e.screenY);
+        }
+      });
       // Get the DOM element to mount the ToolboxController to.
       this._componentMount = this.doc.getElementById("toolbox-toolbar-mount");
 
       this._mountReactComponent();
       this._buildDockOptions();
       this._buildTabs();
       this._applyCacheSettings();
       this._applyServiceWorkersTestingSettings();
@@ -633,33 +647,31 @@ Toolbox.prototype = {
     }
 
     // Add shortcuts and window-host-shortcuts that use the ChromeEventHandler as target.
     this._addShortcuts();
     this._addWindowHostShortcuts();
 
     this._chromeEventHandler.addEventListener("keypress", this._splitConsoleOnKeypress);
     this._chromeEventHandler.addEventListener("focus", this._onFocus, true);
-    this._chromeEventHandler.addEventListener("contextmenu", this._onContextMenu);
   },
 
   _removeChromeEventHandlerEvents: function() {
     if (!this._chromeEventHandler) {
       return;
     }
 
     // Remove shortcuts and window-host-shortcuts that use the ChromeEventHandler as
     // target.
     this._removeShortcuts();
     this._removeWindowHostShortcuts();
 
     this._chromeEventHandler.removeEventListener("keypress",
       this._splitConsoleOnKeypress);
     this._chromeEventHandler.removeEventListener("focus", this._onFocus, true);
-    this._chromeEventHandler.removeEventListener("contextmenu", this._onContextMenu);
 
     this._chromeEventHandler = null;
   },
 
   _addShortcuts: function() {
     // Create shortcuts instance for the toolbox
     if (!this.shortcuts) {
       this.shortcuts = new KeyShortcuts({
@@ -781,31 +793,16 @@ Toolbox.prototype = {
 
   _removeWindowHostShortcuts: function() {
     if (this._windowHostShortcuts) {
       this._windowHostShortcuts.destroy();
       this._windowHostShortcuts = null;
     }
   },
 
-  _onContextMenu: function(e) {
-    // Handle context menu events in standard input elements: <input> and <textarea>.
-    // Also support for custom input elements using .devtools-input class
-    // (e.g. CodeMirror instances).
-    if (e.originalTarget.closest("input[type=text]") ||
-        e.originalTarget.closest("input[type=search]") ||
-        e.originalTarget.closest("input:not([type])") ||
-        e.originalTarget.closest(".devtools-input") ||
-        e.originalTarget.closest("textarea")) {
-      e.stopPropagation();
-      e.preventDefault();
-      this.openTextBoxContextMenu(e.screenX, e.screenY);
-    }
-  },
-
   _getDebugTargetData: function() {
     const url = new URL(this.win.location);
     const searchParams = new this.win.URLSearchParams(url.search);
 
     const targetType = searchParams.get("type") || DEBUG_TARGET_TYPES.TAB;
 
     const remoteId = searchParams.get("remoteId");
     const runtimeInfo = remoteClientManager.getRuntimeInfoByRemoteId(remoteId);