Merge mozilla-central to autoland. a=merge CLOSED TREE
authorOana Pop Rus <opoprus@mozilla.com>
Thu, 24 Jan 2019 12:46:18 +0200
changeset 515253 b402ba25c19b2e41e0ce3f98b5a9f2c673134846
parent 515251 e8f7f92df2a36cb449884fdf920986955ddc307f (current diff)
parent 515252 5e7f43df50482670ee86c203ec1e90ab1fbafd4d (diff)
child 515263 7a3cc3042d048fb467e303fe362e94e9a8160632
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone66.0a1
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
Merge mozilla-central to autoland. a=merge CLOSED TREE
devtools/client/inspector/test/browser_inspector_highlighter-pick-scrollbar.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() {