Closed Bug 1358983 Opened 8 years ago Closed 5 years ago

The Node highlighter sometimes stays visible even if the node isn't hovered anymore

Categories

(DevTools :: Inspector, defect, P2)

defect

Tracking

(firefox69 fixed)

RESOLVED FIXED
Firefox 69
Tracking Status
firefox69 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(2 files)

Attached video highlighter_bug.mov (deleted) —
STR: 1. Go the the console 2. Log some elements (e.g. `$$("body *")`) 3. Quickly move your cursor over a logged node ER: The highlighter isn't displayed AR: Sometimes, the highlighter stays on screen (See attached screencast) ---- In the console, we're using the highlighter `highlightDomValueGrip` functions (http://searchfox.org/mozilla-central/source/devtools/client/framework/toolbox-highlighter-utils.js#224-256), which does work asynchronously. The highlighter is called on mouseover, and the unhighlight on mouseout (see http://searchfox.org/mozilla-central/source/devtools/client/webconsole/new-console-output/components/grip-message-body.js#65-66). So it may occurs, if you pass your cursor over a node quickly, that the handler for the mouseout event is fired before the highlighter is shown, which led the highlighter to be displayed even if the node isn't highlighted anymore. This could be solved by the consumer of the highlighter's functions, but it would be better if we could handled that directly in the highlighter so we don't have to deal with this in all the consumers. Feel free to tell me I'm wrong and that it should/can only be handled by the consumer.
Component: Developer Tools: Framework → Developer Tools: Inspector
DevTools bug triage (filter on CLIMBING SHOES).
Priority: -- → P2
Product: Firefox → DevTools
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

Due to how highlighters work, it requires the inspector to be initialized.
It can happen than the user will mouseenter/mouseout on an element that
calls highlight/unhighlight very quickly.
Since the hightlight can take some time, it might happen that the unhighlight
call is handled first, before the highlight call, meaning that we now have an
highlighter displayed, even though the user isn't hovering anything that
should cause this anymore.

This patch introduces a new toolbox function called getHighlighter that
returns an object with a highlight and aunhighlightfunction. We keep a reference to any possible pendinghighlightcall so we can wait for it to be done inunhighlight`, before destroying it.

The console makes use of the new helper function, and a test is added to ensure
we don't have zombie highlighters anymore.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
Blocks: 1561281
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: