Bug 123756 - Moving the node while handling DOMNodeRemovedFromDocument can force sending multiple DOMNodeRemovedFromDocument to nodes still in the DOM
Summary: Moving the node while handling DOMNodeRemovedFromDocument can force sending m...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-04 14:25 PST by Alexandru Chiculita
Modified: 2023-07-05 16:47 PDT (History)
2 users (show)

See Also:


Attachments
Test case (1.25 KB, text/html)
2013-11-04 14:25 PST, Alexandru Chiculita
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.