Bug 199036 - Web Inspector: don't show popover for hovered token when editor scrolls due to find previous/next
Summary: Web Inspector: don't show popover for hovered token when editor scrolls due t...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-06-19 14:36 PDT by Matt Baker
Modified: 2019-06-19 16:47 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2019-06-19 14:36:15 PDT
Summary:
Don't show popover for hovered token when editor scrolls due to find previous/next. It is super annoying.

Steps to Reproduce:
1. Pause in the debugger
2. Cursor should be over the text editor
3. Hit Cmd-F and search for text that appears throughout the script
4. Hit Enter to scroll through matches
=> Eventually the cursor can appear over a symbol in the editor, causing a popover to appear

Note:
This bug is fairly easy to reproduce, but really depends on the cursor position and may take some trial and error to trigger.
Comment 1 Radar WebKit Bug Importer 2019-06-19 14:36:36 PDT
<rdar://problem/51913772>
Comment 2 Matt Baker 2019-06-19 15:32:35 PDT
Investigating returning early when event.movementX === 0 && event.movementY === 0. While this holds when the editor scrolls due to find previous/next, I'm worried it could cause false positives.
Comment 3 Matt Baker 2019-06-19 16:47:52 PDT
(In reply to Matt Baker from comment #2)
> Investigating returning early when event.movementX === 0 && event.movementY
> === 0. While this holds when the editor scrolls due to find previous/next,
> I'm worried it could cause false positives.

Ignoring mousemoves for which event.movementX and event.movementY are zero fixes the problem. However, this will cause real mouse movements within the editor to be dropped. Granted these are just for very minute movements of the cursor. Still, I'm hesitant to make the change before exhausting other possible solutions.

Note:
It looks like the mousemove event that CodeMirrorTokenTrackingController detects when revealing search results in the editor is triggered when the search text is programmatically selected:

selectedTextRange (TextEditor.js:217)
_revealSearchResult (TextEditor.js:1117)
_revealFirstSearchResultAfterCursor (TextEditor.js:1259)
markRanges (TextEditor.js:400)
runInOp (codemirror.js:3743)
addSearchResults (TextEditor.js:404)
searchResultCallback (SourceCodeTextEditor.js:245)
...