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

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 23742003: Use css-device-adapt constraining for legacy viewport tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review issue: one assignent per line/statement Created 7 years, 3 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 | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/css/resolver/ViewportStyleResolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 0341b1eedf196c5b80a67577b2bcaad7176b61c9..4ec4369c6bf13f5e4fb85d89deecac35ae3d800a 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -178,8 +178,7 @@ void StyleResolver::finishAppendAuthorStyleSheets()
if (document().renderer() && document().renderer()->style())
document().renderer()->style()->font().update(fontSelector());
- if (RuntimeEnabledFeatures::cssViewportEnabled())
- collectViewportRules();
+ collectViewportRules();
}
void StyleResolver::resetAuthorStyle(const ContainerNode* scopingNode)
@@ -976,11 +975,13 @@ PassRefPtr<RenderStyle> StyleResolver::styleForPage(int pageIndex)
void StyleResolver::collectViewportRules()
{
- ASSERT(RuntimeEnabledFeatures::cssViewportEnabled());
+ collectViewportRules(CSSDefaultStyleSheets::defaultStyle, UserAgentOrigin);
+
+ if (document().isMobileDocument())
+ collectViewportRules(CSSDefaultStyleSheets::xhtmlMobileProfileStyle(), UserAgentOrigin);
- collectViewportRules(CSSDefaultStyleSheets::defaultStyle);
if (m_ruleSets.userStyle())
- collectViewportRules(m_ruleSets.userStyle());
+ collectViewportRules(m_ruleSets.userStyle(), UserAgentOrigin);
if (ScopedStyleResolver* scopedResolver = m_styleTree.scopedStyleResolverForDocument())
scopedResolver->collectViewportRulesTo(this);
@@ -988,13 +989,13 @@ void StyleResolver::collectViewportRules()
viewportStyleResolver()->resolve();
}
-void StyleResolver::collectViewportRules(RuleSet* rules)
+void StyleResolver::collectViewportRules(RuleSet* rules, ViewportOrigin origin)
{
- ASSERT(RuntimeEnabledFeatures::cssViewportEnabled());
-
rules->compactRulesIfNeeded();
const Vector<StyleRuleViewport*>& viewportRules = rules->viewportRules();
+ if (origin == AuthorOrigin && viewportRules.size())
+ viewportStyleResolver()->setHasAuthorStyle();
for (size_t i = 0; i < viewportRules.size(); ++i)
viewportStyleResolver()->addViewportRule(viewportRules[i]);
}
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/css/resolver/ViewportStyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698