Backed out changeset 7f6996c8b32f (bug 1521712) for breaking firefox when devtools is opened a=backout
authorOana Pop Rus <opoprus@mozilla.com>
Thu, 24 Jan 2019 12:39:40 +0200
changeset 512371 5e7f43df5048
parent 512369 aafb99b4a1b4
child 512372 b402ba25c19b
child 512379 6d9ee6e9e6eb
push id10566
push userarchaeopteryx@coole-files.de
push dateMon, 28 Jan 2019 12:41:12 +0000
treeherdermozilla-beta@69a3d7c8d04b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1521712
milestone66.0a1
backs out7f6996c8b32f
first release with
nightly linux32
5e7f43df5048 / 66.0a1 / 20190124104034 / files
nightly linux64
5e7f43df5048 / 66.0a1 / 20190124104034 / files
nightly mac
5e7f43df5048 / 66.0a1 / 20190124104034 / files
nightly win32
5e7f43df5048 / 66.0a1 / 20190124104034 / files
nightly win64
5e7f43df5048 / 66.0a1 / 20190124104034 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 7f6996c8b32f (bug 1521712) for breaking firefox when devtools is opened a=backout
devtools/client/inspector/test/browser.ini
devtools/client/inspector/test/browser_inspector_highlighter-pick-scrollbar.js
devtools/server/actors/highlighters.js
--- a/devtools/client/inspector/test/browser.ini
+++ b/devtools/client/inspector/test/browser.ini
@@ -117,18 +117,16 @@ skip-if = os == 'win' # bug 1413442
 [browser_inspector_highlighter-inline.js]
 [browser_inspector_highlighter-keybinding_01.js]
 [browser_inspector_highlighter-keybinding_02.js]
 [browser_inspector_highlighter-keybinding_03.js]
 [browser_inspector_highlighter-keybinding_04.js]
 [browser_inspector_highlighter-measure_01.js]
 [browser_inspector_highlighter-measure_02.js]
 [browser_inspector_highlighter-options.js]
-[browser_inspector_highlighter-pick-scrollbar.js]
-skip-if = os != 'win' # Only test on windows where scrollbars are ... predictable
 [browser_inspector_highlighter-preview.js]
 [browser_inspector_highlighter-rulers_01.js]
 [browser_inspector_highlighter-rulers_02.js]
 [browser_inspector_highlighter-rulers_03.js]
 skip-if = (os == 'win' && !debug) # Bug 1449754
 [browser_inspector_highlighter-selector_01.js]
 [browser_inspector_highlighter-selector_02.js]
 [browser_inspector_highlighter-xbl.js]
deleted file mode 100644
--- a/devtools/client/inspector/test/browser_inspector_highlighter-pick-scrollbar.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-// Test that clicking on a scrollbar with the pick enabled does select the element that
-// the scrollbar belongs to (see bug 1521712)
-
-const TEST_URL = `data:text/html;charset=utf-8,
-  <div id="wrapper" style="width:300px;height:300px;overflow:scroll">
-    <div style="height:1000px;"></div>
-  </div>`;
-const TEST_NODE = "#wrapper";
-
-add_task(async function() {
-  const { toolbox, inspector } = await openInspectorForURL(TEST_URL);
-
-  info("Start picking");
-  await startPicker(toolbox);
-
-  info("Click on a scrollbar in the document and expect the test node to be selected");
-  const onSelect = inspector.once("inspector-updated");
-
-  const scrollbarWidth = await getScrollbarWidth(TEST_NODE);
-  const width = await getNodeWidth(TEST_NODE);
-  await BrowserTestUtils.synthesizeMouse(TEST_NODE,
-    width - scrollbarWidth / 2, 150, {}, gBrowser.selectedBrowser);
-
-  await onSelect;
-
-  is(inspector.selection.nodeFront.id, "wrapper", "The wrapper element was selected");
-});
-
-async function getScrollbarWidth(selector) {
-  return ContentTask.spawn(gBrowser.selectedBrowser, selector, s => {
-    const node = content.document.querySelector(s);
-    return node.offsetWidth - node.clientWidth;
-  });
-}
-
-async function getNodeWidth(selector) {
-  return ContentTask.spawn(gBrowser.selectedBrowser, selector, s => {
-    const node = content.document.querySelector(s);
-    const rect = node.getBoundingClientRect();
-    return rect.width;
-  });
-}
--- a/devtools/server/actors/highlighters.js
+++ b/devtools/server/actors/highlighters.js
@@ -406,19 +406,19 @@ exports.HighlighterActor = protocol.Acto
 
     // Pass the callback to setSuppressedEventListener as an EventListener.
     document.setSuppressedEventListener(callback ? { handleEvent: callback } : null);
   },
 
   _startPickerListeners: function() {
     const target = this._highlighterEnv.pageListenerTarget;
     target.addEventListener("mousemove", this._onHovered, true);
-    target.addEventListener("mouseup", this._onPick, true);
+    target.addEventListener("click", this._onPick, true);
     target.addEventListener("mousedown", this._preventContentEvent, true);
-    target.addEventListener("click", this._preventContentEvent, true);
+    target.addEventListener("mouseup", this._preventContentEvent, true);
     target.addEventListener("dblclick", this._preventContentEvent, true);
     target.addEventListener("keydown", this._onKey, true);
     target.addEventListener("keyup", this._preventContentEvent, true);
 
     this._setSuppressedEventListener(this._onSuppressedEvent.bind(this));
   },
 
   _stopPickerListeners: function() {