Bug 123756

Summary: Moving the node while handling DOMNodeRemovedFromDocument can force sending multiple DOMNodeRemovedFromDocument to nodes still in the DOM
Product: WebKit Reporter: Alexandru Chiculita <achicu>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test case none

Description Alexandru Chiculita 2013-11-04 14:25:29 PST
1. Open the attached example.
2. Click Move nodes.
3. Notice how DOMNodeRemovedFromDocument is even for elements that are still part of the DOM.

The code iterates on the children of the removed node. If one of the children is moved while handling its DOMNodeRemovedFromDocument event, the runtime will continue from its new location and send the events to all the nodes using the new location.
Comment 1 Alexandru Chiculita 2013-11-04 14:25:49 PST
Created attachment 215954 [details]
Test case
Comment 2 Lucas Forschler 2019-02-06 09:19:04 PST
Mass move bugs into the DOM component.
Comment 3 Ahmad Saleem 2023-07-05 16:46:54 PDT
*** Safari 16.5.1 ***

DOMNodeRemovedFromDocument for target_element
DOMNodeRemovedFromDocument for element1
DOMNodeRemovedFromDocument for element2
DOMNodeRemovedFromDocument for element3
DOMNodeRemovedFromDocument for element3
DOMNodeRemovedFromDocument for element_that_is_not_removed
DOMNodeRemovedFromDocument for log

*** Chrome Canary 117 ***

DOMNodeRemovedFromDocument for target_element
DOMNodeRemovedFromDocument for element1
DOMNodeRemovedFromDocument for element2
DOMNodeRemovedFromDocument for element3
DOMNodeRemovedFromDocument for element3
DOMNodeRemovedFromDocument for element_that_is_not_removed
DOMNodeRemovedFromDocument for log

________

Firefox Nightly 117 didn't generate anything.