Bug 773296 - Part 25: Parse variable declarations in @supports conditions. r=dbaron

Since we cannot parse and discard a white space token after the ':' in a
custom property declaration, we instead explicitly skip over it when
parsing a non-custom property's value.
This commit is contained in:
Cameron McCormack 2013-12-12 13:09:46 +11:00
Родитель 56b65e99dd
Коммит e47788ff1e
1 изменённых файлов: 22 добавлений и 5 удалений

Просмотреть файл

@ -3691,18 +3691,35 @@ CSSParserImpl::ParseSupportsConditionInParensInsideParens(bool& aConditionMet)
return false;
}
if (ExpectSymbol(')', true)) {
UngetToken();
return false;
}
nsCSSProperty propID = nsCSSProps::LookupProperty(propertyName,
nsCSSProps::eEnabled);
if (propID == eCSSProperty_UNKNOWN) {
if (ExpectSymbol(')', true)) {
UngetToken();
return false;
}
aConditionMet = false;
SkipUntil(')');
UngetToken();
} else if (propID == eCSSPropertyExtra_variable) {
if (ExpectSymbol(')', false)) {
UngetToken();
return false;
}
CSSVariableDeclarations::Type variableType;
nsString variableValue;
aConditionMet =
ParseVariableDeclaration(&variableType, variableValue) &&
ParsePriority() != ePriority_Error;
if (!aConditionMet) {
SkipUntil(')');
UngetToken();
}
} else {
if (ExpectSymbol(')', true)) {
UngetToken();
return false;
}
aConditionMet = ParseProperty(propID) &&
ParsePriority() != ePriority_Error;
if (!aConditionMet) {