Bug 163606 - DOM Document adoptNode doesn't always connect event handlers
Summary: DOM Document adoptNode doesn't always connect event handlers
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-18 11:26 PDT by Brent Fulgham
Modified: 2022-09-18 19:17 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2016-10-18 11:26:43 PDT
If a Node containing an event handler is moved from one document to another, the event handler might not be registered with the new document if the old document has already been destroyed.

This appears to be due to some optimizations in the Node::didMoveToNewDocument" that check the original document for event handlers, and assume there's nothing to do if they have been purged. Unfortunately, this can cause us to fail to add event handlers when expected.
Comment 1 Ahmad Saleem 2022-09-17 00:06:58 PDT
@Brent - Is this still an issue? In Node.cpp, there is only this reference:

https://github.com/WebKit/WebKit/blob/3b347ab447d674df0e53063a8f80547d09b98035/Source/WebCore/dom/Node.cpp#L2178
Comment 2 Ryosuke Niwa 2022-09-18 19:17:19 PDT
I'm pretty sure we've fix this problem by now.