Revert "Backed out changeset ed389b1ea7da (bug 1532397) for debugger failure CLOSED TREE"
authorJason Laster <jlaster@mozilla.com>
Tue, 05 Mar 2019 22:34:19 -0500
changeset 520403 e5ee6318c92dff0548e29a78bdfe74d4168015ac
parent 520402 03d1b41cdfc057a5355d1e839151ff71f558d9a5
child 520404 8231eda0cbd435de8aef597e8cea7fc75a4a910b
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1532397
milestone67.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
Revert "Backed out changeset ed389b1ea7da (bug 1532397) for debugger failure CLOSED TREE" This reverts commit d97dce2b582c47b155883a2bd1118faacf12046f.
devtools/client/debugger/new/src/components/Editor/Preview/index.js
--- a/devtools/client/debugger/new/src/components/Editor/Preview/index.js
+++ b/devtools/client/debugger/new/src/components/Editor/Preview/index.js
@@ -45,20 +45,24 @@ function inPopup(e) {
     relatedTarget.closest(".popover") ||
     relatedTarget.classList.contains("debug-expression");
 
   return pop;
 }
 
 function getElementFromPos(pos: DOMRect) {
   // $FlowIgnore
-  return document.elementFromPoint(
+  // We need to use element*s*AtPoint because the tooltip overlays
+  // the token and thus an undesirable element may be returned
+  const elementsAtPoint = [...document.elementsFromPoint(
     pos.x + pos.width / 2,
     pos.y + pos.height / 2
-  );
+  )];
+
+  return elementsAtPoint.find(el => el.className.startsWith("cm-"));
 }
 
 class Preview extends PureComponent<Props, State> {
   target = null;
   constructor(props) {
     super(props);
     this.state = { selecting: false };
   }