Web Inspector: Popover dismissed while attempting to move cursor inside
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 May 2018 16:25:27 +0000 (16:25 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 May 2018 16:25:27 +0000 (16:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185741
<rdar://problem/40340938>

Reviewed by Joseph Pecoraro.

Hovering a token within the bounds of the current popover should not
show a new popover. This prevents the popover from being dismissed when
the cursor passes over a token under the transparent portion of the
popover frame.

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._showPopover):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232189 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js

index df2613e..7ef7991 100644 (file)
@@ -1,3 +1,19 @@
+2018-05-25  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: Popover dismissed while attempting to move cursor inside
+        https://bugs.webkit.org/show_bug.cgi?id=185741
+        <rdar://problem/40340938>
+
+        Reviewed by Joseph Pecoraro.
+
+        Hovering a token within the bounds of the current popover should not
+        show a new popover. This prevents the popover from being dismissed when
+        the cursor passes over a token under the transparent portion of the
+        popover frame.
+
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WI.SourceCodeTextEditor.prototype._showPopover):
+
 2018-05-22  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r232052.
index 9653b95..7c1ad7b 100644 (file)
@@ -1815,6 +1815,12 @@ WI.SourceCodeTextEditor = class SourceCodeTextEditor extends WI.TextEditor
             var rects = this.rectsForRange(candidate.hoveredTokenRange);
             bounds = WI.Rect.unionOfRects(rects);
 
+            if (this._popover && this._popover.visible) {
+                let intersection = bounds.intersectionWithRect(this._popover.frame);
+                if (intersection.size.width && intersection.size.height)
+                    return;
+            }
+
             shouldHighlightRange = true;
         }