Index: third_party/WebKit/Source/core/dom/Node.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp |
index caf5618827c3424f3f6e8939958d3761287ee1f4..645d4f09f0b73b9781c24e4ae3eaed6b28bc99d5 100644 |
--- a/third_party/WebKit/Source/core/dom/Node.cpp |
+++ b/third_party/WebKit/Source/core/dom/Node.cpp |
@@ -1808,6 +1808,11 @@ ExecutionContext* Node::getExecutionContext() const { |
return document().contextDocument(); |
} |
+void Node::willMoveToNewDocument() { |
+ if (document().frameHost()) |
bokan
2017/01/12 16:54:48
Could we pass in the newDocument and only do this
wjmaclean
2017/01/13 17:40:30
Done.
|
+ document().frameHost()->eventHandlerRegistry().didMoveOutOfFrameHost(*this); |
+} |
+ |
void Node::didMoveToNewDocument(Document& oldDocument) { |
TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(oldDocument); |
@@ -1820,14 +1825,8 @@ void Node::didMoveToNewDocument(Document& oldDocument) { |
} |
oldDocument.markers().removeMarkers(this); |
- if (oldDocument.frameHost() && !document().frameHost()) |
- oldDocument.frameHost()->eventHandlerRegistry().didMoveOutOfFrameHost( |
- *this); |
- else if (document().frameHost() && !oldDocument.frameHost()) |
+ if (document().frameHost()) |
bokan
2017/01/12 16:54:48
And to match the above, add a check that we're mov
wjmaclean
2017/01/13 17:40:30
Done.
Let me know if a DCHECK is what you had int
|
document().frameHost()->eventHandlerRegistry().didMoveIntoFrameHost(*this); |
- else if (oldDocument.frameHost() != document().frameHost()) |
- EventHandlerRegistry::didMoveBetweenFrameHosts( |
- *this, oldDocument.frameHost(), document().frameHost()); |
if (const HeapVector<TraceWrapperMember<MutationObserverRegistration>>* |
registry = mutationObserverRegistry()) { |