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

Unified Diff: Source/core/css/CSSParser-in.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/CSSDefaultStyleSheets.cpp ('k') | Source/core/css/RuleSet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSParser-in.cpp
diff --git a/Source/core/css/CSSParser-in.cpp b/Source/core/css/CSSParser-in.cpp
index 4abb3507fe520c9ed724d435592383d24d0a0616..94526f5980c868fbc4d7d663900adb0ac49b0da1 100644
--- a/Source/core/css/CSSParser-in.cpp
+++ b/Source/core/css/CSSParser-in.cpp
@@ -1680,7 +1680,8 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
return false;
if (inViewport()) {
- if (!RuntimeEnabledFeatures::cssViewportEnabled())
+ // Allow @viewport rules from UA stylesheets even if the feature is disabled.
+ if (!RuntimeEnabledFeatures::cssViewportEnabled() && m_context.mode != UASheetMode)
return false;
return parseViewportProperty(propId, important);
@@ -11634,7 +11635,8 @@ unsigned CSSParser::safeUserStringTokenOffset()
StyleRuleBase* CSSParser::createViewportRule()
{
- if (!RuntimeEnabledFeatures::cssViewportEnabled()) {
+ // Allow @viewport rules from UA stylesheets even if the feature is disabled.
+ if (!RuntimeEnabledFeatures::cssViewportEnabled() && m_context.mode != UASheetMode) {
endRuleBody(true);
return 0;
}
@@ -11655,7 +11657,7 @@ StyleRuleBase* CSSParser::createViewportRule()
bool CSSParser::parseViewportProperty(CSSPropertyID propId, bool important)
{
- ASSERT(RuntimeEnabledFeatures::cssViewportEnabled());
+ ASSERT(RuntimeEnabledFeatures::cssViewportEnabled() || m_context.mode == UASheetMode);
CSSParserValue* value = m_valueList->current();
if (!value)
@@ -11715,7 +11717,7 @@ bool CSSParser::parseViewportProperty(CSSPropertyID propId, bool important)
bool CSSParser::parseViewportShorthand(CSSPropertyID propId, CSSPropertyID first, CSSPropertyID second, bool important)
{
- ASSERT(RuntimeEnabledFeatures::cssViewportEnabled());
+ ASSERT(RuntimeEnabledFeatures::cssViewportEnabled() || m_context.mode == UASheetMode);
unsigned numValues = m_valueList->size();
if (numValues > 2)
« no previous file with comments | « Source/core/css/CSSDefaultStyleSheets.cpp ('k') | Source/core/css/RuleSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698