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

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

Issue 837883002: Store features in the ScopedStyleResoolver. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Simpler even. 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
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 4449fb74a1a26215206a040be66417069b68f8b2..521b28c73670fd751cac71251eabd4566b38047c 100644
--- a/sky/engine/core/css/resolver/StyleResolver.cpp
+++ b/sky/engine/core/css/resolver/StyleResolver.cpp
@@ -126,7 +126,6 @@ static RuleSet& defaultStyles()
StyleResolver::StyleResolver(Document& document)
: m_document(document)
- , m_needCollectFeatures(false)
, m_printMediaType(false)
, m_styleResourceLoader(document.fetcher())
, m_styleSharingDepth(0)
@@ -190,19 +189,10 @@ void StyleResolver::appendAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet> >
void StyleResolver::finishAppendAuthorStyleSheets()
{
- collectFeatures();
-
if (document().renderView() && document().renderView()->style())
document().renderView()->style()->font().update(document().styleEngine()->fontSelector());
}
-void StyleResolver::resetRuleFeatures()
-{
- // Need to recreate RuleFeatureSet.
- m_features.clear();
- m_needCollectFeatures = true;
-}
-
void StyleResolver::processScopedRules(const RuleSet& authorRules, CSSStyleSheet* parentStyleSheet, unsigned parentIndex, ContainerNode& scope)
{
const Vector<RawPtr<StyleRuleKeyframes> > keyframesRules = authorRules.keyframesRules();
@@ -220,27 +210,6 @@ void StyleResolver::processScopedRules(const RuleSet& authorRules, CSSStyleSheet
}
}
-void StyleResolver::resetAuthorStyle(TreeScope& treeScope)
-{
- treeScope.scopedStyleResolver().resetAuthorStyle();
- resetRuleFeatures();
-}
-
-void StyleResolver::collectFeatures()
-{
- m_features.clear();
- m_features.add(defaultStyles().features());
-
- document().styleEngine()->collectScopedStyleFeaturesTo(m_features);
-
- m_needCollectFeatures = false;
-}
-
-bool StyleResolver::hasRulesForId(const AtomicString& id) const
-{
- return m_features.hasSelectorForId(id);
-}
-
void StyleResolver::addToStyleSharingList(Element& element)
{
// Never add elements to the style sharing list if we're not in a recalcStyle,
@@ -395,7 +364,6 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS
ASSERT(document().frame());
ASSERT(document().settings());
ASSERT(!hasPendingAuthorStyleSheets());
- ASSERT(!m_needCollectFeatures);
// Once an element has a renderer, we don't try to destroy it, since otherwise the renderer
// will vanish if a style recalc happens during loading.
@@ -417,7 +385,7 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS
StyleResolverState state(document(), element, defaultParent);
if (sharingBehavior == AllowStyleSharing && state.parentStyle()) {
- SharedStyleFinder styleFinder(state.elementContext(), m_features, *this);
+ SharedStyleFinder styleFinder(state.elementContext(), *this);
if (RefPtr<RenderStyle> sharedStyle = styleFinder.findSharedStyle())
return sharedStyle.release();
}

Powered by Google App Engine
This is Rietveld 408576698