Commit 1ac51614 authored by Daniel Varga's avatar Daniel Varga
Browse files

Backed out 1 changesets (bug 1543940) for mochitest failure at...

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)
parent dd429306
Loading
Loading
Loading
Loading
+15 −18
Original line number Original line Diff line number Diff line
@@ -175,7 +175,6 @@ function Toolbox(target, selectedTool, hostType, contentWindow, frameId,
  this._onNewSelectedNodeFront = this._onNewSelectedNodeFront.bind(this);
  this._onNewSelectedNodeFront = this._onNewSelectedNodeFront.bind(this);
  this._onToolSelected = this._onToolSelected.bind(this);
  this._onToolSelected = this._onToolSelected.bind(this);
  this._onTargetClosed = this._onTargetClosed.bind(this);
  this._onTargetClosed = this._onTargetClosed.bind(this);
  this._onContextMenu = this._onContextMenu.bind(this);
  this.updateToolboxButtonsVisibility = this.updateToolboxButtonsVisibility.bind(this);
  this.updateToolboxButtonsVisibility = this.updateToolboxButtonsVisibility.bind(this);
  this.updateToolboxButtons = this.updateToolboxButtons.bind(this);
  this.updateToolboxButtons = this.updateToolboxButtons.bind(this);
  this.selectTool = this.selectTool.bind(this);
  this.selectTool = this.selectTool.bind(this);
@@ -515,6 +514,21 @@ Toolbox.prototype = {
      Services.prefs.addObserver("devtools.serviceWorkers.testing.enabled",
      Services.prefs.addObserver("devtools.serviceWorkers.testing.enabled",
                                 this._applyServiceWorkersTestingSettings);
                                 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.
      // Get the DOM element to mount the ToolboxController to.
      this._componentMount = this.doc.getElementById("toolbox-toolbar-mount");
      this._componentMount = this.doc.getElementById("toolbox-toolbar-mount");


@@ -638,7 +652,6 @@ Toolbox.prototype = {


    this._chromeEventHandler.addEventListener("keypress", this._splitConsoleOnKeypress);
    this._chromeEventHandler.addEventListener("keypress", this._splitConsoleOnKeypress);
    this._chromeEventHandler.addEventListener("focus", this._onFocus, true);
    this._chromeEventHandler.addEventListener("focus", this._onFocus, true);
    this._chromeEventHandler.addEventListener("contextmenu", this._onContextMenu);
  },
  },


  _removeChromeEventHandlerEvents: function() {
  _removeChromeEventHandlerEvents: function() {
@@ -654,7 +667,6 @@ Toolbox.prototype = {
    this._chromeEventHandler.removeEventListener("keypress",
    this._chromeEventHandler.removeEventListener("keypress",
      this._splitConsoleOnKeypress);
      this._splitConsoleOnKeypress);
    this._chromeEventHandler.removeEventListener("focus", this._onFocus, true);
    this._chromeEventHandler.removeEventListener("focus", this._onFocus, true);
    this._chromeEventHandler.removeEventListener("contextmenu", this._onContextMenu);


    this._chromeEventHandler = null;
    this._chromeEventHandler = null;
  },
  },
@@ -786,21 +798,6 @@ Toolbox.prototype = {
    }
    }
  },
  },


  _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() {
  _getDebugTargetData: function() {
    const url = new URL(this.win.location);
    const url = new URL(this.win.location);
    const searchParams = new this.win.URLSearchParams(url.search);
    const searchParams = new this.win.URLSearchParams(url.search);