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

Unified Diff: sky/engine/core/dom/shadow/ShadowRoot.cpp

Issue 844133002: Simplify tree scope tracking in StyleEngine. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/core/dom/StyleSheetCollection.cpp ('k') | sky/engine/core/html/HTMLStyleElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/shadow/ShadowRoot.cpp
diff --git a/sky/engine/core/dom/shadow/ShadowRoot.cpp b/sky/engine/core/dom/shadow/ShadowRoot.cpp
index 0faf6614c561d4a2cd9a734b6fddee1ba233ec1b..f2084717f2611d634fab3b1abd9a182f5df1dc5c 100644
--- a/sky/engine/core/dom/shadow/ShadowRoot.cpp
+++ b/sky/engine/core/dom/shadow/ShadowRoot.cpp
@@ -29,6 +29,7 @@
#include "sky/engine/bindings/core/v8/ExceptionState.h"
#include "sky/engine/core/css/resolver/StyleResolver.h"
+#include "sky/engine/core/dom/Document.h"
#include "sky/engine/core/dom/ElementTraversal.h"
#include "sky/engine/core/dom/StyleEngine.h"
#include "sky/engine/core/dom/Text.h"
@@ -112,6 +113,9 @@ void ShadowRoot::insertedInto(ContainerNode* insertionPoint)
{
DocumentFragment::insertedInto(insertionPoint);
+ if (inActiveDocument())
+ document().styleEngine()->addTreeScope(*this);
+
if (ShadowRoot* root = host()->containingShadowRoot())
root->addChildShadowRoot();
}
@@ -124,6 +128,9 @@ void ShadowRoot::removedFrom(ContainerNode* insertionPoint)
if (root)
root->removeChildShadowRoot();
+ if (inActiveDocument())
+ document().styleEngine()->removeTreeScope(*this);
+
DocumentFragment::removedFrom(insertionPoint);
}
« no previous file with comments | « sky/engine/core/dom/StyleSheetCollection.cpp ('k') | sky/engine/core/html/HTMLStyleElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698