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) |