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

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

Issue 848483003: Simplify media query handling for stylesheets. (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/ScopedStyleResolver.h ('k') | sky/engine/core/css/resolver/StyleResolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/resolver/ScopedStyleResolver.cpp
diff --git a/sky/engine/core/css/resolver/ScopedStyleResolver.cpp b/sky/engine/core/css/resolver/ScopedStyleResolver.cpp
index 16ff234f70507ff8517b24af93f302453ef1f666..7688fed1484d7da153ebbb6c6a68462f601f727d 100644
--- a/sky/engine/core/css/resolver/ScopedStyleResolver.cpp
+++ b/sky/engine/core/css/resolver/ScopedStyleResolver.cpp
@@ -46,15 +46,11 @@ ScopedStyleResolver::ScopedStyleResolver(TreeScope& scope)
void ScopedStyleResolver::appendStyleSheet(CSSStyleSheet& sheet)
{
- Document& document = m_scope.document();
- StyleResolver& styleResolver = document.styleResolver();
- MediaQueryEvaluator& medium = styleResolver.medium();
+ MediaQueryEvaluator medium(m_scope.document().view());
- if (sheet.mediaQueries() && !medium.eval(sheet.mediaQueries(), &m_viewportDependentMediaQueryResults))
+ if (sheet.mediaQueries() && !medium.eval(sheet.mediaQueries()))
return;
- styleResolver.addMediaQueryAffectedByViewportChange(m_viewportDependentMediaQueryResults);
-
const RuleSet& ruleSet = sheet.contents()->ensureRuleSet();
m_features.add(ruleSet.features());
}
@@ -77,17 +73,11 @@ void ScopedStyleResolver::updateActiveStyleSheets()
toShadowRoot(root).host()->setNeedsStyleRecalc(SubtreeStyleChange);
m_features.clear();
- m_viewportDependentMediaQueryResults.clear();
for (RefPtr<CSSStyleSheet>& sheet : m_authorStyleSheets)
appendStyleSheet(*sheet);
}
-const MediaQueryResultList& ScopedStyleResolver::viewportDependentMediaQueryResults() const
-{
- return m_viewportDependentMediaQueryResults;
-}
-
void ScopedStyleResolver::addStyleSheetCandidateNode(HTMLStyleElement& element)
{
ASSERT(element.inActiveDocument());
« no previous file with comments | « sky/engine/core/css/resolver/ScopedStyleResolver.h ('k') | sky/engine/core/css/resolver/StyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698