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

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

Issue 810893002: Remove global set of ScopedStyleResolvers. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/TreeScope.cpp
diff --git a/sky/engine/core/dom/TreeScope.cpp b/sky/engine/core/dom/TreeScope.cpp
index d38bd66bacb174f853894441dab734bf15aa2bba..3af09ff1d2fd3931da403de39e3bec0f8d6ef0e0 100644
--- a/sky/engine/core/dom/TreeScope.cpp
+++ b/sky/engine/core/dom/TreeScope.cpp
@@ -54,9 +54,8 @@ TreeScope::TreeScope(ContainerNode& rootNode, Document& document)
: m_rootNode(&rootNode)
, m_document(&document)
, m_parentTreeScope(&document)
-#if !ENABLE(OILPAN)
+ , m_scopedStyleResolver(ScopedStyleResolver::create(*this))
, m_guardRefCount(0)
-#endif
{
ASSERT(rootNode != document);
#if !ENABLE(OILPAN)
@@ -69,16 +68,14 @@ TreeScope::TreeScope(Document& document)
: m_rootNode(document)
, m_document(&document)
, m_parentTreeScope(nullptr)
-#if !ENABLE(OILPAN)
+ , m_scopedStyleResolver(ScopedStyleResolver::create(*this))
, m_guardRefCount(0)
-#endif
{
m_rootNode->setTreeScope(this);
}
TreeScope::~TreeScope()
{
-#if !ENABLE(OILPAN)
ASSERT(!m_guardRefCount);
m_rootNode->setTreeScope(0);
@@ -89,7 +86,6 @@ TreeScope::~TreeScope()
if (m_parentTreeScope)
m_parentTreeScope->guardDeref();
-#endif
}
bool TreeScope::isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(const TreeScope& scope) const
@@ -129,19 +125,6 @@ void TreeScope::setParentTreeScope(TreeScope& newParentScope)
setDocument(newParentScope.document());
}
-ScopedStyleResolver& TreeScope::ensureScopedStyleResolver()
-{
- RELEASE_ASSERT(this);
- if (!m_scopedStyleResolver)
- m_scopedStyleResolver = ScopedStyleResolver::create(*this);
- return *m_scopedStyleResolver;
-}
-
-void TreeScope::clearScopedStyleResolver()
-{
- m_scopedStyleResolver.clear();
-}
-
Element* TreeScope::getElementById(const AtomicString& elementId) const
{
if (elementId.isEmpty())
« no previous file with comments | « sky/engine/core/dom/TreeScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698