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

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

Issue 519003003: Tell synthetic attribute nodes inside shadow DOM about move to new Document (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeScopeAdopter.cpp
diff --git a/Source/core/dom/TreeScopeAdopter.cpp b/Source/core/dom/TreeScopeAdopter.cpp
index 471396f739e2c89ce7db8209076a1dd3b31832da..68683fa9a0ba381231a860f9eb95da4049cab905 100644
--- a/Source/core/dom/TreeScopeAdopter.cpp
+++ b/Source/core/dom/TreeScopeAdopter.cpp
@@ -88,6 +88,13 @@ void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument,
ASSERT(oldDocument != newDocument);
for (Node* node = &root; node; node = NodeTraversal::next(*node, &root)) {
moveNodeToNewDocument(*node, oldDocument, newDocument);
+
+ if (node->hasSyntheticAttrChildNodes()) {
+ WillBeHeapVector<RefPtrWillBeMember<Attr> >& attrs = *toElement(node)->attrNodeList();
+ for (unsigned i = 0; i < attrs.size(); ++i)
+ moveTreeToNewDocument(*attrs[i], oldDocument, newDocument);
+ }
+
for (ShadowRoot* shadow = node->youngestShadowRoot(); shadow; shadow = shadow->olderShadowRoot())
moveTreeToNewDocument(*shadow, oldDocument, newDocument);
}
« no previous file with comments | « LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698