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

Unified Diff: sky/engine/core/css/resolver/StyleResolver.cpp

Issue 844873002: Simplify the style sharing list code. (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/css/resolver/StyleResolver.h ('k') | sky/engine/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/resolver/StyleResolver.cpp
diff --git a/sky/engine/core/css/resolver/StyleResolver.cpp b/sky/engine/core/css/resolver/StyleResolver.cpp
index d78bb38fed1c5b639ca9cf0b86db1cd71f867d39..5a60e8f3f01f4f183367ca61a69396394d3c4dac 100644
--- a/sky/engine/core/css/resolver/StyleResolver.cpp
+++ b/sky/engine/core/css/resolver/StyleResolver.cpp
@@ -126,7 +126,6 @@ StyleResolver::StyleResolver(Document& document)
: m_document(document)
, m_printMediaType(false)
, m_styleResourceLoader(document.fetcher())
- , m_styleSharingDepth(0)
, m_styleResolverStatsSequence(0)
, m_accessCount(0)
{
@@ -217,22 +216,9 @@ void StyleResolver::addToStyleSharingList(Element& element)
list.prepend(&element);
}
-StyleSharingList& StyleResolver::styleSharingList()
-{
- m_styleSharingLists.resize(styleSharingMaxDepth);
-
- // We never put things at depth 0 into the list since that's only the <html> element
- // and it has no siblings or cousins to share with.
- unsigned depth = std::max(std::min(m_styleSharingDepth, styleSharingMaxDepth), 1u) - 1u;
-
- if (!m_styleSharingLists[depth])
- m_styleSharingLists[depth] = adoptPtr(new StyleSharingList);
- return *m_styleSharingLists[depth];
-}
-
void StyleResolver::clearStyleSharingList()
{
- m_styleSharingLists.resize(0);
+ m_styleSharingList.clear();
}
StyleResolver::~StyleResolver()
« no previous file with comments | « sky/engine/core/css/resolver/StyleResolver.h ('k') | sky/engine/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698