Open Bug 1465456 Opened 6 years ago Updated 2 years ago

Inspector - highlight remains visible when element is deleted

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(firefox-esr52 wontfix, firefox-esr60 wontfix, firefox60 wontfix, firefox61 fix-optional, firefox62 affected)

Tracking Status
firefox-esr52 --- wontfix
firefox-esr60 --- wontfix
firefox60 --- wontfix
firefox61 --- fix-optional
firefox62 --- affected

People

(Reporter: cfogel, Unassigned)

Details

Attachments

(1 file)

[Affected versions]:
- Firefox 60.0.1, Firefox 61.0b9, Firefox 62.0a1 (2018-05-29)

[Affected platforms]:
- Windows 7x32, Windows 10x64, Ubuntu 16.04, MacOS 10.12.6

[Steps to reproduce]:
1. Launch Firefox;
2. Right click any element in page(preferably an image);
3. Click on the Inspect Element;
4. In the Rules tab, click on the Highlight Element button;
5. In the Inspector tab, click on the element above the selected one;
6. Move the mouse back on the inspected one;
7. Press the Delete key on the keyboard;

[Expected result]:
- The highlight from step 4 is removed once the element is deleted

[Actual result]:
- The highlight is still visible even if the whole content is deleted.

[Additional notes]:
- attached screen-cast with the issue;
Product: Firefox → DevTools
Component: Object Inspector → Inspector
I think the fix for this should probably go in this function https://searchfox.org/mozilla-central/rev/dc3585e58b427c3a8a7c01712fe54ebe118a3ce2/devtools/server/actors/highlighters/utils/markup.js#107-133

Whenever the highlighter re-highlights the node, it checks if the node is still valid. It turns out this isNodeValid function keeps on returning true even if the node has been deleted, which in this case, takes the node out of the document (its parentNode property is null).

The last check in this function should be enough (checking the bindingParent), but it seems to still returns the old parent node. 
So maybe we should also make the function returns false when node.parentNode is null.
Priority: -- → P3
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: