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

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: 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
Index: Source/core/css/CSSParser-in.cpp
diff --git a/Source/core/css/CSSParser-in.cpp b/Source/core/css/CSSParser-in.cpp
index 500e47197112ea7a11162a52b5e25b710b76b917..381a6da90f1da0c47c70adabdee3b70086b80fe7 100644
--- a/Source/core/css/CSSParser-in.cpp
+++ b/Source/core/css/CSSParser-in.cpp
@@ -1717,7 +1717,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
}
if (inViewport()) {
- if (!RuntimeEnabledFeatures::cssViewportEnabled())
+ if (!RuntimeEnabledFeatures::cssViewportEnabled() && m_context.mode != UASheetMode)
kenneth.r.christiansen 2013/09/02 09:10:49 Add comment: // Allow @viewport rules from UA styl
rune 2013/09/02 11:53:39 Done.
return false;
return parseViewportProperty(propId, important);
@@ -11634,7 +11634,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)
return 0;
m_allowImportRules = m_allowNamespaceDeclarations = false;
@@ -11653,7 +11654,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)
@@ -11713,7 +11714,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)

Powered by Google App Engine
This is Rietveld 408576698