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

Unified Diff: sky/engine/core/dom/TreeScopeAdopter.cpp

Issue 759663003: Only allow one shadowRoot. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: ojan review. Created 6 years, 1 month 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 | « sky/engine/core/dom/TreeScope.cpp ('k') | sky/engine/core/dom/TreeScopeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/TreeScopeAdopter.cpp
diff --git a/sky/engine/core/dom/TreeScopeAdopter.cpp b/sky/engine/core/dom/TreeScopeAdopter.cpp
index f378ee517a7c8798c2c4e291c75fc5fc5d44b1b5..441eb59ce8209375f9f2e09c86813f6c092dfe3b 100644
--- a/sky/engine/core/dom/TreeScopeAdopter.cpp
+++ b/sky/engine/core/dom/TreeScopeAdopter.cpp
@@ -37,9 +37,7 @@ void TreeScopeAdopter::moveTreeToNewScope(Node& root) const
{
ASSERT(needsScopeChange());
-#if !ENABLE(OILPAN)
oldScope().guardRef();
-#endif
Document& oldDocument = oldScope().document();
Document& newDocument = newScope().document();
@@ -54,16 +52,14 @@ void TreeScopeAdopter::moveTreeToNewScope(Node& root) const
if (!node->isElementNode())
continue;
- for (ShadowRoot* shadow = node->youngestShadowRoot(); shadow; shadow = shadow->olderShadowRoot()) {
+ if (ShadowRoot* shadow = node->shadowRoot()) {
shadow->setParentTreeScope(newScope());
if (willMoveToNewDocument)
moveTreeToNewDocument(*shadow, oldDocument, newDocument);
}
}
-#if !ENABLE(OILPAN)
oldScope().guardDeref();
-#endif
}
void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument, Document& newDocument) const
@@ -72,7 +68,7 @@ void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument,
for (Node* node = &root; node; node = NodeTraversal::next(*node, &root)) {
moveNodeToNewDocument(*node, oldDocument, newDocument);
- for (ShadowRoot* shadow = node->youngestShadowRoot(); shadow; shadow = shadow->olderShadowRoot())
+ if (ShadowRoot* shadow = node->shadowRoot())
moveTreeToNewDocument(*shadow, oldDocument, newDocument);
}
}
« no previous file with comments | « sky/engine/core/dom/TreeScope.cpp ('k') | sky/engine/core/dom/TreeScopeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698