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