Open Bug 1911377 Opened 4 months ago Updated 4 months ago

Pseudo-class lock not cleared when element is mutated

Categories

(DevTools :: Inspector, defect, P3)

Firefox 128
defect

Tracking

(Not tracked)

People

(Reporter: sebo, Unassigned)

References

Details

As described by Brian Grinstead in a related bug, the pseudo-class locks are currently not cleared when an element is manipulated, e.g. moved within the DOM. This is especially an issue for pseudo-classes that affect the ancestor chain like :hover and :active, as the pseudo-class lock may then incorrectly apply to them.

Example:

  1. Inspect the 'child' element on https://jsfiddle.net/SebastianZ/fon397sk/
  2. Set the :hover pseudo-lock on it
  3. Press m on the keyboard

⇒ appends the child to the <body>. OK
⇒ pseudo-class lock still applies to the 'parent' element. FAIL

As noted by Brian, a solution to this could be to keep track of the elements having explicit locks, clearing them when the elements are mutated, and then reapplying them if the elements are still in the DOM.

Sebastian

Thanks for the report and suggestion!

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.