[Webkit-unassigned] [Bug 235047] Web Inspector: Inline swatch popovers should hide when inline swatches are removed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 24 17:38:43 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=235047

--- Comment #2 from Nikita Vasilyev <nvasilyev at apple.com> ---
The bug affects all instances of popovers. For instance, CSS documentation popovers also don't hide when selecting a different element.

Possible resolutions:

1. Detect when the inline swatch element is removed from DOM, and hide its popover.

1.1 DOMNodeRemoved event. This event is deprecated and it's relatively slow https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent.

1.2 MutationObserver, that has replaced DOM Mutation Events (such as DOMNodeRemoved). However, to track if inline swatch element is removed we'd have to potentially observe document.body with {subtree: true} option, which would be an insane overkill for our task.

1.3 setInterval that is active only when the popover is visible and checks for swatchElement.isConnected.

2. Add logic for every case where an inline swatch is removed from DOM (such as SpreadsheetStyleProperty#detached).
Cons: fastest execution.
Pros: adds code complexity.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220125/f1afac49/attachment.htm>


More information about the webkit-unassigned mailing list