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

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

Issue 815653002: Remove global list map of TreeScope to StyleSheetCollection. (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') | sky/engine/core/dom/shadow/ShadowRoot.cpp » ('j') | 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 3af09ff1d2fd3931da403de39e3bec0f8d6ef0e0..c7da9590c878007171989597712e04688c6ed679 100644
--- a/sky/engine/core/dom/TreeScope.cpp
+++ b/sky/engine/core/dom/TreeScope.cpp
@@ -34,6 +34,7 @@
#include "sky/engine/core/dom/Element.h"
#include "sky/engine/core/dom/ElementTraversal.h"
#include "sky/engine/core/dom/NodeRenderStyle.h"
+#include "sky/engine/core/dom/StyleSheetCollection.h"
#include "sky/engine/core/dom/TreeScopeAdopter.h"
#include "sky/engine/core/dom/shadow/ElementShadow.h"
#include "sky/engine/core/dom/shadow/ShadowRoot.h"
@@ -55,12 +56,11 @@ TreeScope::TreeScope(ContainerNode& rootNode, Document& document)
, m_document(&document)
, m_parentTreeScope(&document)
, m_scopedStyleResolver(ScopedStyleResolver::create(*this))
+ , m_styleSheets(StyleSheetCollection::create(*this))
, m_guardRefCount(0)
{
ASSERT(rootNode != document);
-#if !ENABLE(OILPAN)
m_parentTreeScope->guardRef();
-#endif
m_rootNode->setTreeScope(this);
}
@@ -69,6 +69,7 @@ TreeScope::TreeScope(Document& document)
, m_document(&document)
, m_parentTreeScope(nullptr)
, m_scopedStyleResolver(ScopedStyleResolver::create(*this))
+ , m_styleSheets(StyleSheetCollection::create(*this))
, m_guardRefCount(0)
{
m_rootNode->setTreeScope(this);
@@ -407,8 +408,8 @@ bool TreeScope::hasSameStyles(TreeScope& other)
{
if (this == &other)
return true;
- const Vector<RefPtr<blink::CSSStyleSheet> >& list = document().styleEngine()->activeAuthorStyleSheetsFor(*this);
- const Vector<RefPtr<blink::CSSStyleSheet> >& otherList = document().styleEngine()->activeAuthorStyleSheetsFor(other);
+ const Vector<RefPtr<blink::CSSStyleSheet> >& list = styleSheets().activeAuthorStyleSheets();
+ const Vector<RefPtr<blink::CSSStyleSheet> >& otherList = other.styleSheets().activeAuthorStyleSheets();
if (list.size() != otherList.size())
return false;
« no previous file with comments | « sky/engine/core/dom/TreeScope.h ('k') | sky/engine/core/dom/shadow/ShadowRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698