You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Popover: spec for dealing with element removal is incorrect #9161
I agree that the spec is broken for this case. The difference between the spec and at least the Chromium implementation is that the spec for remove runs the removing steps at step 15, but removes the node from the tree before that, at step 11. The Chromium impl runs that call to HidePopoverInternal before the node is removed from the tree.
I'm not sure what the best way to fix the spec is. Seems like there might need to be "before removing steps" added before step 11 or something? @josepharhar@annevk@nt1m
Does it make sense to fire all of the events in this case?
We discussed this at great length during the spec PR review. The problem is that events can't be fired synchronously during removal, so we'd have to queue the events in this case, which leads to myriad problems like out of order events. So we decided that the best course of action was not firing events in this case.
Activity
jakearchibald commentedon Apr 13, 2023
I think the behaviour here needs some design. Does it make sense to fire all of the events in this case?
mfreed7 commentedon Apr 14, 2023
I agree that the spec is broken for this case. The difference between the spec and at least the Chromium implementation is that the spec for remove runs the removing steps at step 15, but removes the node from the tree before that, at step 11. The Chromium impl runs that call to HidePopoverInternal before the node is removed from the tree.
I'm not sure what the best way to fix the spec is. Seems like there might need to be "before removing steps" added before step 11 or something? @josepharhar @annevk @nt1m
mfreed7 commentedon Apr 14, 2023
We discussed this at great length during the spec PR review. The problem is that events can't be fired synchronously during removal, so we'd have to queue the events in this case, which leads to myriad problems like out of order events. So we decided that the best course of action was not firing events in this case.
nt1m commentedon Apr 14, 2023
Yes, WebKit also runs removing steps before removing the node from the tree. That part of the spec is definitely broken here.
Add before removing steps
josepharhar commentedon Apr 17, 2023
I opened a DOM PR to add "before removing steps" that can hook into here: whatwg/dom#1185
Ignore DOM state when hiding popovers if needed
Ignore DOM state when hiding popovers if needed
josepharhar commentedon Jun 26, 2023
I opened an HTML PR which should make the above DOM PR obsolete by fixing this bug in a different way #9457
Fix hiding popovers that are removed or moved between documents