Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Unified Diff: third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp

Issue 2170383002: CustomElements: adopt node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge conflict resolution Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
diff --git a/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp b/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
index 6ea5268b104431212a4f3d25fab9302855c1fd02..38bb640565c3f9034fd62191e05117c794bc33b4 100644
--- a/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp
@@ -25,8 +25,10 @@
#include "core/dom/TreeScopeAdopter.h"
#include "core/dom/Attr.h"
+#include "core/dom/Node.h"
#include "core/dom/NodeRareData.h"
#include "core/dom/NodeTraversal.h"
+#include "core/dom/custom/CustomElement.h"
#include "core/dom/shadow/ElementShadow.h"
#include "core/dom/shadow/ShadowRoot.h"
@@ -128,6 +130,11 @@ inline void TreeScopeAdopter::moveNodeToNewDocument(Node& node, Document& oldDoc
oldDocument.moveNodeIteratorsToNewDocument(node, newDocument);
+ if (node.getCustomElementState() == CustomElementState::Custom) {
+ Element& element = toElement(node);
+ CustomElement::enqueueAdoptedCallback(&element);
+ }
+
if (node.isShadowRoot())
toShadowRoot(node).setDocument(newDocument);
« no previous file with comments | « third_party/WebKit/Source/core/dom/ElementRareData.cpp ('k') | third_party/WebKit/Source/core/dom/custom/CustomElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698