зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
56b65e99dd
Коммит
e47788ff1e
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче