mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-24 16:17:29 +09:00
Issue #2045 - Part 4: Parse "revert" in property values wherever "unset" is allowed
This commit is contained in:
parent
b0f0972314
commit
9105c58a30
6 changed files with 113 additions and 67 deletions
|
|
@ -154,6 +154,7 @@ TimingParams::ParseEasing(const nsAString& aEasing,
|
||||||
case eCSSUnit_Inherit:
|
case eCSSUnit_Inherit:
|
||||||
case eCSSUnit_Initial:
|
case eCSSUnit_Initial:
|
||||||
case eCSSUnit_Unset:
|
case eCSSUnit_Unset:
|
||||||
|
case eCSSUnit_Revert:
|
||||||
case eCSSUnit_TokenStream:
|
case eCSSUnit_TokenStream:
|
||||||
case eCSSUnit_Null:
|
case eCSSUnit_Null:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -2731,6 +2731,7 @@ PropertyIsInheritOrInitial(Declaration* aDeclaration, const nsCSSPropertyID aPro
|
||||||
const nsCSSValue* filterVal =
|
const nsCSSValue* filterVal =
|
||||||
aDeclaration->GetNormalBlock()->ValueFor(aProperty);
|
aDeclaration->GetNormalBlock()->ValueFor(aProperty);
|
||||||
return (!filterVal || (filterVal->GetUnit() == eCSSUnit_Unset ||
|
return (!filterVal || (filterVal->GetUnit() == eCSSUnit_Unset ||
|
||||||
|
filterVal->GetUnit() == eCSSUnit_Revert ||
|
||||||
filterVal->GetUnit() == eCSSUnit_Inherit ||
|
filterVal->GetUnit() == eCSSUnit_Inherit ||
|
||||||
filterVal->GetUnit() == eCSSUnit_Initial));
|
filterVal->GetUnit() == eCSSUnit_Initial));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ FontFaceSet::ParseFontShorthandForMatching(
|
||||||
|
|
||||||
const nsCSSValue* family = data->ValueFor(eCSSProperty_font_family);
|
const nsCSSValue* family = data->ValueFor(eCSSProperty_font_family);
|
||||||
if (family->GetUnit() != eCSSUnit_FontFamilyList) {
|
if (family->GetUnit() != eCSSUnit_FontFamilyList) {
|
||||||
// We got inherit, initial, unset, a system font, or a token stream.
|
// We got inherit, initial, unset, revert, a system font, or a token stream.
|
||||||
aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
|
aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -474,6 +474,7 @@ CSS_KEY(repeat, repeat)
|
||||||
CSS_KEY(repeat-x, repeat_x)
|
CSS_KEY(repeat-x, repeat_x)
|
||||||
CSS_KEY(repeat-y, repeat_y)
|
CSS_KEY(repeat-y, repeat_y)
|
||||||
CSS_KEY(reverse, reverse)
|
CSS_KEY(reverse, reverse)
|
||||||
|
CSS_KEY(revert, revert)
|
||||||
CSS_KEY(ridge, ridge)
|
CSS_KEY(ridge, ridge)
|
||||||
CSS_KEY(right, right)
|
CSS_KEY(right, right)
|
||||||
CSS_KEY(rl, rl)
|
CSS_KEY(rl, rl)
|
||||||
|
|
|
||||||
|
|
@ -1170,8 +1170,9 @@ protected:
|
||||||
nsString& aValue);
|
nsString& aValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a CSS variable value. This could be 'initial', 'inherit', 'unset'
|
* Parses a CSS variable value. This could be 'initial', 'inherit', 'unset',
|
||||||
* or a token stream, which may or may not include variable references.
|
* 'revert', or a token stream, which may or may not include variable
|
||||||
|
* references.
|
||||||
*
|
*
|
||||||
* @param aType Out parameter into which the type of the variable value
|
* @param aType Out parameter into which the type of the variable value
|
||||||
* will be stored.
|
* will be stored.
|
||||||
|
|
@ -8206,6 +8207,10 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue,
|
||||||
aValue.SetUnsetValue();
|
aValue.SetUnsetValue();
|
||||||
return CSSParseResult::Ok;
|
return CSSParseResult::Ok;
|
||||||
}
|
}
|
||||||
|
else if (eCSSKeyword_revert == keyword) {
|
||||||
|
aValue.SetRevertValue(mLevel);
|
||||||
|
return CSSParseResult::Ok;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ((aVariantMask & VARIANT_NONE) != 0) {
|
if ((aVariantMask & VARIANT_NONE) != 0) {
|
||||||
if (eCSSKeyword_none == keyword) {
|
if (eCSSKeyword_none == keyword) {
|
||||||
|
|
@ -8405,7 +8410,8 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue,
|
||||||
!(tk->mIdent.LowerCaseEqualsLiteral("inherit") ||
|
!(tk->mIdent.LowerCaseEqualsLiteral("inherit") ||
|
||||||
tk->mIdent.LowerCaseEqualsLiteral("initial") ||
|
tk->mIdent.LowerCaseEqualsLiteral("initial") ||
|
||||||
(tk->mIdent.LowerCaseEqualsLiteral("unset") &&
|
(tk->mIdent.LowerCaseEqualsLiteral("unset") &&
|
||||||
nsLayoutUtils::UnsetValueEnabled())))) {
|
nsLayoutUtils::UnsetValueEnabled()) ||
|
||||||
|
tk->mIdent.LowerCaseEqualsLiteral("revert")))) {
|
||||||
aValue.SetStringValue(tk->mIdent, eCSSUnit_Ident);
|
aValue.SetStringValue(tk->mIdent, eCSSUnit_Ident);
|
||||||
return CSSParseResult::Ok;
|
return CSSParseResult::Ok;
|
||||||
}
|
}
|
||||||
|
|
@ -8475,6 +8481,7 @@ CSSParserImpl::ParseCustomIdent(nsCSSValue& aValue,
|
||||||
if (keyword == eCSSKeyword_inherit ||
|
if (keyword == eCSSKeyword_inherit ||
|
||||||
keyword == eCSSKeyword_initial ||
|
keyword == eCSSKeyword_initial ||
|
||||||
keyword == eCSSKeyword_unset ||
|
keyword == eCSSKeyword_unset ||
|
||||||
|
keyword == eCSSKeyword_revert ||
|
||||||
keyword == eCSSKeyword_default ||
|
keyword == eCSSKeyword_default ||
|
||||||
(aPropertyKTable &&
|
(aPropertyKTable &&
|
||||||
nsCSSProps::FindIndexOfKeyword(keyword, aPropertyKTable) >= 0)) {
|
nsCSSProps::FindIndexOfKeyword(keyword, aPropertyKTable) >= 0)) {
|
||||||
|
|
@ -8696,7 +8703,7 @@ bool
|
||||||
CSSParserImpl::ParseImageOrientation(nsCSSValue& aValue)
|
CSSParserImpl::ParseImageOrientation(nsCSSValue& aValue)
|
||||||
{
|
{
|
||||||
if (ParseSingleTokenVariant(aValue, VARIANT_INHERIT, nullptr)) {
|
if (ParseSingleTokenVariant(aValue, VARIANT_INHERIT, nullptr)) {
|
||||||
// 'inherit', 'initial' and 'unset' must be alone
|
// 'inherit', 'initial', 'unset', and 'revert' must be alone
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8810,7 +8817,7 @@ CSSParserImpl::ParseElement(nsCSSValue& aValue)
|
||||||
bool
|
bool
|
||||||
CSSParserImpl::ParseFlex()
|
CSSParserImpl::ParseFlex()
|
||||||
{
|
{
|
||||||
// First check for inherit / initial / unset
|
// First check for inherit / initial / unset / revert
|
||||||
nsCSSValue tmpVal;
|
nsCSSValue tmpVal;
|
||||||
if (ParseSingleTokenVariant(tmpVal, VARIANT_INHERIT, nullptr)) {
|
if (ParseSingleTokenVariant(tmpVal, VARIANT_INHERIT, nullptr)) {
|
||||||
AppendValue(eCSSProperty_flex_grow, tmpVal);
|
AppendValue(eCSSProperty_flex_grow, tmpVal);
|
||||||
|
|
@ -10318,7 +10325,8 @@ bool
|
||||||
CSSParserImpl::ParseInitialLetter()
|
CSSParserImpl::ParseInitialLetter()
|
||||||
{
|
{
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'inherit', 'initial', 'unset', 'none', and 'normal' must be alone
|
// 'inherit', 'initial', 'unset', 'revert', 'none', and 'normal'
|
||||||
|
// must be alone
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NORMAL,
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NORMAL,
|
||||||
nullptr)) {
|
nullptr)) {
|
||||||
nsCSSValue first, second;
|
nsCSSValue first, second;
|
||||||
|
|
@ -11572,8 +11580,14 @@ CSSParserImpl::ParseChoice(nsCSSValue aValues[],
|
||||||
}
|
}
|
||||||
found = ((1 << aNumIDs) - 1);
|
found = ((1 << aNumIDs) - 1);
|
||||||
}
|
}
|
||||||
|
else if (eCSSUnit_Revert == aValues[0].GetUnit()) { // one revert, all revert
|
||||||
|
for (loop = 1; loop < aNumIDs; loop++) {
|
||||||
|
aValues[loop].SetRevertValue(mLevel);
|
||||||
|
}
|
||||||
|
found = ((1 << aNumIDs) - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else { // more than one value, verify no inherits, initials or unsets
|
else { // more than one value, verify no inherits, initials, unsets, or reverts
|
||||||
for (loop = 0; loop < aNumIDs; loop++) {
|
for (loop = 0; loop < aNumIDs; loop++) {
|
||||||
if (eCSSUnit_Inherit == aValues[loop].GetUnit()) {
|
if (eCSSUnit_Inherit == aValues[loop].GetUnit()) {
|
||||||
found = -1;
|
found = -1;
|
||||||
|
|
@ -11587,6 +11601,10 @@ CSSParserImpl::ParseChoice(nsCSSValue aValues[],
|
||||||
found = -1;
|
found = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if (eCSSUnit_Revert == aValues[loop].GetUnit()) {
|
||||||
|
found = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11625,12 +11643,13 @@ CSSParserImpl::ParseBoxProperties(const nsCSSPropertyID aPropIDs[])
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (1 < count) { // verify no more than single inherit, initial or unset
|
if (1 < count) { // verify no more than single inherit, initial, unset, or revert
|
||||||
NS_FOR_CSS_SIDES (index) {
|
NS_FOR_CSS_SIDES (index) {
|
||||||
nsCSSUnit unit = (result.*(nsCSSRect::sides[index])).GetUnit();
|
nsCSSUnit unit = (result.*(nsCSSRect::sides[index])).GetUnit();
|
||||||
if (eCSSUnit_Inherit == unit ||
|
if (eCSSUnit_Inherit == unit ||
|
||||||
eCSSUnit_Initial == unit ||
|
eCSSUnit_Initial == unit ||
|
||||||
eCSSUnit_Unset == unit) {
|
eCSSUnit_Unset == unit ||
|
||||||
|
eCSSUnit_Revert == unit) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11734,10 +11753,11 @@ CSSParserImpl::ParseBoxCornerRadius(nsCSSPropertyID aPropID)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// optional second value (forbidden if first value is inherit/initial/unset)
|
// optional second value (forbidden if first value is inherit/initial/unset/revert)
|
||||||
if (dimenX.GetUnit() != eCSSUnit_Inherit &&
|
if (dimenX.GetUnit() != eCSSUnit_Inherit &&
|
||||||
dimenX.GetUnit() != eCSSUnit_Initial &&
|
dimenX.GetUnit() != eCSSUnit_Initial &&
|
||||||
dimenX.GetUnit() != eCSSUnit_Unset) {
|
dimenX.GetUnit() != eCSSUnit_Unset &&
|
||||||
|
dimenX.GetUnit() != eCSSUnit_Revert) {
|
||||||
if (ParseNonNegativeVariant(dimenY, VARIANT_LP | VARIANT_CALC, nullptr) ==
|
if (ParseNonNegativeVariant(dimenY, VARIANT_LP | VARIANT_CALC, nullptr) ==
|
||||||
CSSParseResult::Error) {
|
CSSParseResult::Error) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -11795,12 +11815,14 @@ CSSParserImpl::ParseBoxCornerRadiiInternals(nsCSSValue array[])
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if 'initial', 'inherit' or 'unset' was used, it must be the only value
|
// if 'initial', 'inherit', 'unset', or 'revert' was used, it
|
||||||
|
// must be the only value
|
||||||
if (countX > 1 || countY > 0) {
|
if (countX > 1 || countY > 0) {
|
||||||
nsCSSUnit unit = dimenX.mTop.GetUnit();
|
nsCSSUnit unit = dimenX.mTop.GetUnit();
|
||||||
if (eCSSUnit_Inherit == unit ||
|
if (eCSSUnit_Inherit == unit ||
|
||||||
eCSSUnit_Initial == unit ||
|
eCSSUnit_Initial == unit ||
|
||||||
eCSSUnit_Unset == unit)
|
eCSSUnit_Unset == unit ||
|
||||||
|
eCSSUnit_Revert == unit)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -12547,6 +12569,7 @@ CSSParserImpl::ParseFontDescriptorValue(nsCSSFontDesc aDescID,
|
||||||
aValue.GetUnit() != eCSSUnit_Inherit &&
|
aValue.GetUnit() != eCSSUnit_Inherit &&
|
||||||
aValue.GetUnit() != eCSSUnit_Initial &&
|
aValue.GetUnit() != eCSSUnit_Initial &&
|
||||||
aValue.GetUnit() != eCSSUnit_Unset &&
|
aValue.GetUnit() != eCSSUnit_Unset &&
|
||||||
|
aValue.GetUnit() != eCSSUnit_Revert &&
|
||||||
(aValue.GetUnit() != eCSSUnit_Enumerated ||
|
(aValue.GetUnit() != eCSSUnit_Enumerated ||
|
||||||
(aValue.GetIntValue() != NS_STYLE_FONT_WEIGHT_BOLDER &&
|
(aValue.GetIntValue() != NS_STYLE_FONT_WEIGHT_BOLDER &&
|
||||||
aValue.GetIntValue() != NS_STYLE_FONT_WEIGHT_LIGHTER)));
|
aValue.GetIntValue() != NS_STYLE_FONT_WEIGHT_LIGHTER)));
|
||||||
|
|
@ -12611,7 +12634,7 @@ CSSParserImpl::ParseImageLayers(const nsCSSPropertyID aTable[])
|
||||||
// background-color can only be set once, so it's not a list.
|
// background-color can only be set once, so it's not a list.
|
||||||
nsCSSValue color;
|
nsCSSValue color;
|
||||||
|
|
||||||
// Check first for inherit/initial/unset.
|
// Check first for inherit/initial/unset/revert.
|
||||||
if (ParseSingleTokenVariant(color, VARIANT_INHERIT, nullptr)) {
|
if (ParseSingleTokenVariant(color, VARIANT_INHERIT, nullptr)) {
|
||||||
// must be alone
|
// must be alone
|
||||||
for (const nsCSSPropertyID* subprops =
|
for (const nsCSSPropertyID* subprops =
|
||||||
|
|
@ -12808,7 +12831,8 @@ CSSParserImpl::ParseImageLayersItem(
|
||||||
int32_t dummy;
|
int32_t dummy;
|
||||||
if (keyword == eCSSKeyword_inherit ||
|
if (keyword == eCSSKeyword_inherit ||
|
||||||
keyword == eCSSKeyword_initial ||
|
keyword == eCSSKeyword_initial ||
|
||||||
keyword == eCSSKeyword_unset) {
|
keyword == eCSSKeyword_unset ||
|
||||||
|
keyword == eCSSKeyword_revert) {
|
||||||
return false;
|
return false;
|
||||||
} else if (keyword == eCSSKeyword_none) {
|
} else if (keyword == eCSSKeyword_none) {
|
||||||
if (haveImage)
|
if (haveImage)
|
||||||
|
|
@ -12971,7 +12995,7 @@ CSSParserImpl::ParseImageLayersItem(
|
||||||
if (haveColor)
|
if (haveColor)
|
||||||
return false;
|
return false;
|
||||||
haveColor = true;
|
haveColor = true;
|
||||||
// Note: This parses 'inherit', 'initial' and 'unset', but
|
// Note: This parses 'inherit', 'initial', 'unset', and 'revert', but
|
||||||
// we've already checked for them, so it's ok.
|
// we've already checked for them, so it's ok.
|
||||||
if (ParseSingleValueProperty(aState.mColor,
|
if (ParseSingleValueProperty(aState.mColor,
|
||||||
aTable[nsStyleImageLayers::color]) !=
|
aTable[nsStyleImageLayers::color]) !=
|
||||||
|
|
@ -12995,7 +13019,7 @@ CSSParserImpl::ParseValueList(nsCSSPropertyID aPropID)
|
||||||
{
|
{
|
||||||
// aPropID is a single value prop-id
|
// aPropID is a single value prop-id
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'initial', 'inherit' and 'unset' stand alone, no list permitted.
|
// 'initial', 'inherit', 'unset', and 'revert' stand alone, no list permitted.
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
||||||
nsCSSValueList* item = value.SetListValue();
|
nsCSSValueList* item = value.SetListValue();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
@ -13018,7 +13042,7 @@ bool
|
||||||
CSSParserImpl::ParseImageLayerRepeat(nsCSSPropertyID aPropID)
|
CSSParserImpl::ParseImageLayerRepeat(nsCSSPropertyID aPropID)
|
||||||
{
|
{
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'initial', 'inherit' and 'unset' stand alone, no list permitted.
|
// 'initial', 'inherit', 'unset', and 'revert' stand alone, no list permitted.
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
||||||
nsCSSValuePair valuePair;
|
nsCSSValuePair valuePair;
|
||||||
if (!ParseImageLayerRepeatValues(valuePair)) {
|
if (!ParseImageLayerRepeatValues(valuePair)) {
|
||||||
|
|
@ -13068,7 +13092,7 @@ CSSParserImpl::ParseImageLayerRepeatValues(nsCSSValuePair& aValue)
|
||||||
bool
|
bool
|
||||||
CSSParserImpl::ParseImageLayerPosition(const nsCSSPropertyID aTable[])
|
CSSParserImpl::ParseImageLayerPosition(const nsCSSPropertyID aTable[])
|
||||||
{
|
{
|
||||||
// 'initial', 'inherit' and 'unset' stand alone, no list permitted.
|
// 'initial', 'inherit', 'unset', and 'revert' stand alone, no list permitted.
|
||||||
nsCSSValue position;
|
nsCSSValue position;
|
||||||
if (ParseSingleTokenVariant(position, VARIANT_INHERIT, nullptr)) {
|
if (ParseSingleTokenVariant(position, VARIANT_INHERIT, nullptr)) {
|
||||||
AppendValue(aTable[nsStyleImageLayers::positionX], position);
|
AppendValue(aTable[nsStyleImageLayers::positionX], position);
|
||||||
|
|
@ -13109,7 +13133,7 @@ bool
|
||||||
CSSParserImpl::ParseImageLayerPositionCoord(nsCSSPropertyID aPropID, bool aIsHorizontal)
|
CSSParserImpl::ParseImageLayerPositionCoord(nsCSSPropertyID aPropID, bool aIsHorizontal)
|
||||||
{
|
{
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'initial', 'inherit' and 'unset' stand alone, no list permitted.
|
// 'initial', 'inherit', 'unset', and 'revert' stand alone, no list permitted.
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
||||||
nsCSSValue itemValue;
|
nsCSSValue itemValue;
|
||||||
if (!ParseImageLayerPositionCoordItem(itemValue, aIsHorizontal)) {
|
if (!ParseImageLayerPositionCoordItem(itemValue, aIsHorizontal)) {
|
||||||
|
|
@ -13144,8 +13168,8 @@ CSSParserImpl::ParseImageLayerPositionCoord(nsCSSPropertyID aPropID, bool aIsHor
|
||||||
* like "top," "left center," etc.
|
* like "top," "left center," etc.
|
||||||
*
|
*
|
||||||
* @param aOut The nsCSSValuePair in which to place the result.
|
* @param aOut The nsCSSValuePair in which to place the result.
|
||||||
* @param aAcceptsInherit If true, 'inherit', 'initial' and 'unset' are
|
* @param aAcceptsInherit If true, 'inherit', 'initial', 'unset', and 'revert'
|
||||||
* legal values
|
* are legal values
|
||||||
* @param aAllowExplicitCenter If true, 'center' is a legal value
|
* @param aAllowExplicitCenter If true, 'center' is a legal value
|
||||||
* @return Whether or not the operation succeeded.
|
* @return Whether or not the operation succeeded.
|
||||||
*/
|
*/
|
||||||
|
|
@ -13164,7 +13188,8 @@ bool CSSParserImpl::ParseBoxPositionValues(nsCSSValuePair &aOut,
|
||||||
} else if (result == CSSParseResult::Ok) {
|
} else if (result == CSSParseResult::Ok) {
|
||||||
if (eCSSUnit_Inherit == xValue.GetUnit() ||
|
if (eCSSUnit_Inherit == xValue.GetUnit() ||
|
||||||
eCSSUnit_Initial == xValue.GetUnit() ||
|
eCSSUnit_Initial == xValue.GetUnit() ||
|
||||||
eCSSUnit_Unset == xValue.GetUnit()) { // both are inherit, initial or unset
|
eCSSUnit_Unset == xValue.GetUnit() ||
|
||||||
|
eCSSUnit_Revert == xValue.GetUnit()) { // both are inherit, initial, unset, or revert
|
||||||
yValue = xValue;
|
yValue = xValue;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -13578,7 +13603,7 @@ bool
|
||||||
CSSParserImpl::ParseImageLayerSize(nsCSSPropertyID aPropID)
|
CSSParserImpl::ParseImageLayerSize(nsCSSPropertyID aPropID)
|
||||||
{
|
{
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'initial', 'inherit' and 'unset' stand alone, no list permitted.
|
// 'initial', 'inherit', 'unset', and 'revert' stand alone, no list permitted.
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
||||||
nsCSSValuePair valuePair;
|
nsCSSValuePair valuePair;
|
||||||
if (!ParseImageLayerSizeValues(valuePair)) {
|
if (!ParseImageLayerSizeValues(valuePair)) {
|
||||||
|
|
@ -13606,8 +13631,8 @@ CSSParserImpl::ParseImageLayerSize(nsCSSPropertyID aPropID)
|
||||||
* Parses two values that correspond to lengths for the background-size
|
* Parses two values that correspond to lengths for the background-size
|
||||||
* property. These can be one or two lengths (or the 'auto' keyword) or
|
* property. These can be one or two lengths (or the 'auto' keyword) or
|
||||||
* percentages corresponding to the element's dimensions or the single keywords
|
* percentages corresponding to the element's dimensions or the single keywords
|
||||||
* 'contain' or 'cover'. 'initial', 'inherit' and 'unset' must be handled by
|
* 'contain' or 'cover'. 'initial', 'inherit', 'unset', and 'revert' must be
|
||||||
* the caller if desired.
|
* handled by the caller if desired.
|
||||||
*
|
*
|
||||||
* @param aOut The nsCSSValuePair in which to place the result.
|
* @param aOut The nsCSSValuePair in which to place the result.
|
||||||
* @return Whether or not the operation succeeded.
|
* @return Whether or not the operation succeeded.
|
||||||
|
|
@ -13705,8 +13730,8 @@ CSSParserImpl::ParseBorderImageSlice(bool aAcceptsInherit,
|
||||||
|
|
||||||
if (aAcceptsInherit &&
|
if (aAcceptsInherit &&
|
||||||
ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
||||||
// Keywords "inherit", "initial" and "unset" can not be mixed, so we
|
// Keywords "inherit", "initial", "unset", and "revert" can not be
|
||||||
// are done.
|
// mixed, so we are done.
|
||||||
AppendValue(eCSSProperty_border_image_slice, value);
|
AppendValue(eCSSProperty_border_image_slice, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -13756,8 +13781,8 @@ CSSParserImpl::ParseBorderImageWidth(bool aAcceptsInherit)
|
||||||
|
|
||||||
if (aAcceptsInherit &&
|
if (aAcceptsInherit &&
|
||||||
ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
||||||
// Keywords "inherit", "initial" and "unset" can not be mixed, so we
|
// Keywords "inherit", "initial", "unset", and "revert" can not be
|
||||||
// are done.
|
// mixed, so we are done.
|
||||||
AppendValue(eCSSProperty_border_image_width, value);
|
AppendValue(eCSSProperty_border_image_width, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -13779,8 +13804,8 @@ CSSParserImpl::ParseBorderImageOutset(bool aAcceptsInherit)
|
||||||
|
|
||||||
if (aAcceptsInherit &&
|
if (aAcceptsInherit &&
|
||||||
ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
||||||
// Keywords "inherit", "initial" and "unset" can not be mixed, so we
|
// Keywords "inherit", "initial", "unset", and "revert" can not be
|
||||||
// are done.
|
// mixed, so we are done.
|
||||||
AppendValue(eCSSProperty_border_image_outset, value);
|
AppendValue(eCSSProperty_border_image_outset, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -13800,8 +13825,8 @@ CSSParserImpl::ParseBorderImageRepeat(bool aAcceptsInherit)
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
if (aAcceptsInherit &&
|
if (aAcceptsInherit &&
|
||||||
ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
||||||
// Keywords "inherit", "initial" and "unset" can not be mixed, so we
|
// Keywords "inherit", "initial", "unset", and "revert" can not be
|
||||||
// are done.
|
// mixed, so we are done.
|
||||||
AppendValue(eCSSProperty_border_image_repeat, value);
|
AppendValue(eCSSProperty_border_image_repeat, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -13840,7 +13865,8 @@ CSSParserImpl::ParseBorderImage()
|
||||||
AppendValue(eCSSProperty_border_image_width, value);
|
AppendValue(eCSSProperty_border_image_width, value);
|
||||||
AppendValue(eCSSProperty_border_image_outset, value);
|
AppendValue(eCSSProperty_border_image_outset, value);
|
||||||
AppendValue(eCSSProperty_border_image_repeat, value);
|
AppendValue(eCSSProperty_border_image_repeat, value);
|
||||||
// Keywords "inherit", "initial" and "unset" can't be mixed, so we are done.
|
// Keywords "inherit", "initial", "unset", and "revert" can not be
|
||||||
|
// mixed, so we are done.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -13994,8 +14020,9 @@ CSSParserImpl::ParseBorderSide(const nsCSSPropertyID aPropIDs[],
|
||||||
case eCSSUnit_Inherit:
|
case eCSSUnit_Inherit:
|
||||||
case eCSSUnit_Initial:
|
case eCSSUnit_Initial:
|
||||||
case eCSSUnit_Unset:
|
case eCSSUnit_Unset:
|
||||||
|
case eCSSUnit_Revert:
|
||||||
extraValue = values[0];
|
extraValue = values[0];
|
||||||
// Set value of border-image properties to initial/inherit/unset
|
// Set value of border-image properties to initial/inherit/unset/revert
|
||||||
AppendValue(eCSSProperty_border_image_source, extraValue);
|
AppendValue(eCSSProperty_border_image_source, extraValue);
|
||||||
AppendValue(eCSSProperty_border_image_slice, extraValue);
|
AppendValue(eCSSProperty_border_image_slice, extraValue);
|
||||||
AppendValue(eCSSProperty_border_image_width, extraValue);
|
AppendValue(eCSSProperty_border_image_width, extraValue);
|
||||||
|
|
@ -14036,7 +14063,8 @@ bool
|
||||||
CSSParserImpl::ParseBorderColors(nsCSSPropertyID aProperty)
|
CSSParserImpl::ParseBorderColors(nsCSSPropertyID aProperty)
|
||||||
{
|
{
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'inherit', 'initial', 'unset' and 'none' are only allowed on their own
|
// 'inherit', 'initial', 'unset', 'revert', and 'none' are only allowed
|
||||||
|
// on their own
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
|
||||||
nullptr)) {
|
nullptr)) {
|
||||||
nsCSSValueList *cur = value.SetListValue();
|
nsCSSValueList *cur = value.SetListValue();
|
||||||
|
|
@ -14423,8 +14451,8 @@ CSSParserImpl::ParseContent()
|
||||||
"content keyword tables out of sync");
|
"content keyword tables out of sync");
|
||||||
|
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'inherit', 'initial', 'unset', 'normal', 'none', and 'alt-content' must
|
// 'inherit', 'initial', 'unset', 'revert', 'normal', 'none', and
|
||||||
// be alone
|
// 'alt-content' must be alone
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_HMK | VARIANT_NONE,
|
if (!ParseSingleTokenVariant(value, VARIANT_HMK | VARIANT_NONE,
|
||||||
kContentSolitaryKWs)) {
|
kContentSolitaryKWs)) {
|
||||||
nsCSSValueList* cur = value.SetListValue();
|
nsCSSValueList* cur = value.SetListValue();
|
||||||
|
|
@ -14494,7 +14522,7 @@ bool
|
||||||
CSSParserImpl::ParseCursor()
|
CSSParserImpl::ParseCursor()
|
||||||
{
|
{
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'inherit', 'initial' and 'unset' must be alone
|
// 'inherit', 'initial', 'unset', and 'revert' must be alone
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) {
|
||||||
nsCSSValueList* cur = value.SetListValue();
|
nsCSSValueList* cur = value.SetListValue();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
@ -14538,7 +14566,8 @@ CSSParserImpl::ParseFont()
|
||||||
if (ParseSingleTokenVariant(family, VARIANT_HK, nsCSSProps::kFontKTable)) {
|
if (ParseSingleTokenVariant(family, VARIANT_HK, nsCSSProps::kFontKTable)) {
|
||||||
if (eCSSUnit_Inherit == family.GetUnit() ||
|
if (eCSSUnit_Inherit == family.GetUnit() ||
|
||||||
eCSSUnit_Initial == family.GetUnit() ||
|
eCSSUnit_Initial == family.GetUnit() ||
|
||||||
eCSSUnit_Unset == family.GetUnit()) {
|
eCSSUnit_Unset == family.GetUnit() ||
|
||||||
|
eCSSUnit_Revert == family.GetUnit()) {
|
||||||
AppendValue(eCSSProperty__x_system_font, nsCSSValue(eCSSUnit_None));
|
AppendValue(eCSSProperty__x_system_font, nsCSSValue(eCSSUnit_None));
|
||||||
AppendValue(eCSSProperty_font_family, family);
|
AppendValue(eCSSProperty_font_family, family);
|
||||||
AppendValue(eCSSProperty_font_style, family);
|
AppendValue(eCSSProperty_font_style, family);
|
||||||
|
|
@ -14606,7 +14635,8 @@ CSSParserImpl::ParseFont()
|
||||||
if (found < 0 ||
|
if (found < 0 ||
|
||||||
eCSSUnit_Inherit == values[kFontStyleIndex].GetUnit() ||
|
eCSSUnit_Inherit == values[kFontStyleIndex].GetUnit() ||
|
||||||
eCSSUnit_Initial == values[kFontStyleIndex].GetUnit() ||
|
eCSSUnit_Initial == values[kFontStyleIndex].GetUnit() ||
|
||||||
eCSSUnit_Unset == values[kFontStyleIndex].GetUnit()) { // illegal data
|
eCSSUnit_Unset == values[kFontStyleIndex].GetUnit() ||
|
||||||
|
eCSSUnit_Revert == values[kFontStyleIndex].GetUnit() ) { // illegal data
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((found & (1 << kFontStyleIndex)) == 0) {
|
if ((found & (1 << kFontStyleIndex)) == 0) {
|
||||||
|
|
@ -14664,7 +14694,8 @@ CSSParserImpl::ParseFont()
|
||||||
if (ParseFamily(family)) {
|
if (ParseFamily(family)) {
|
||||||
if (eCSSUnit_Inherit != family.GetUnit() &&
|
if (eCSSUnit_Inherit != family.GetUnit() &&
|
||||||
eCSSUnit_Initial != family.GetUnit() &&
|
eCSSUnit_Initial != family.GetUnit() &&
|
||||||
eCSSUnit_Unset != family.GetUnit()) {
|
eCSSUnit_Unset != family.GetUnit() &&
|
||||||
|
eCSSUnit_Revert != family.GetUnit()) {
|
||||||
AppendValue(eCSSProperty__x_system_font, nsCSSValue(eCSSUnit_None));
|
AppendValue(eCSSProperty__x_system_font, nsCSSValue(eCSSUnit_None));
|
||||||
AppendValue(eCSSProperty_font_family, family);
|
AppendValue(eCSSProperty_font_family, family);
|
||||||
AppendValue(eCSSProperty_font_style, values[kFontStyleIndex]);
|
AppendValue(eCSSProperty_font_style, values[kFontStyleIndex]);
|
||||||
|
|
@ -14709,7 +14740,8 @@ CSSParserImpl::ParseFontSynthesis(nsCSSValue& aValue)
|
||||||
if (eCSSUnit_None == aValue.GetUnit() ||
|
if (eCSSUnit_None == aValue.GetUnit() ||
|
||||||
eCSSUnit_Initial == aValue.GetUnit() ||
|
eCSSUnit_Initial == aValue.GetUnit() ||
|
||||||
eCSSUnit_Inherit == aValue.GetUnit() ||
|
eCSSUnit_Inherit == aValue.GetUnit() ||
|
||||||
eCSSUnit_Unset == aValue.GetUnit())
|
eCSSUnit_Unset == aValue.GetUnit() ||
|
||||||
|
eCSSUnit_Revert == aValue.GetUnit() )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -15329,6 +15361,9 @@ CSSParserImpl::ParseFamily(nsCSSValue& aValue)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case eCSSKeyword_revert:
|
||||||
|
aValue.SetRevertValue(mLevel);
|
||||||
|
return true;
|
||||||
case eCSSKeyword__moz_use_system_font:
|
case eCSSKeyword__moz_use_system_font:
|
||||||
if (!IsParsingCompoundProperty()) {
|
if (!IsParsingCompoundProperty()) {
|
||||||
aValue.SetSystemFontValue();
|
aValue.SetSystemFontValue();
|
||||||
|
|
@ -15362,6 +15397,7 @@ CSSParserImpl::ParseFamily(nsCSSValue& aValue)
|
||||||
case eCSSKeyword_inherit:
|
case eCSSKeyword_inherit:
|
||||||
case eCSSKeyword_initial:
|
case eCSSKeyword_initial:
|
||||||
case eCSSKeyword_default:
|
case eCSSKeyword_default:
|
||||||
|
case eCSSKeyword_revert:
|
||||||
case eCSSKeyword__moz_use_system_font:
|
case eCSSKeyword__moz_use_system_font:
|
||||||
return false;
|
return false;
|
||||||
case eCSSKeyword_unset:
|
case eCSSKeyword_unset:
|
||||||
|
|
@ -16034,7 +16070,7 @@ bool
|
||||||
CSSParserImpl::ParseTextAlign(nsCSSValue& aValue, const KTableEntry aTable[])
|
CSSParserImpl::ParseTextAlign(nsCSSValue& aValue, const KTableEntry aTable[])
|
||||||
{
|
{
|
||||||
if (ParseSingleTokenVariant(aValue, VARIANT_INHERIT, nullptr)) {
|
if (ParseSingleTokenVariant(aValue, VARIANT_INHERIT, nullptr)) {
|
||||||
// 'inherit', 'initial' and 'unset' must be alone
|
// 'inherit', 'initial', 'unset', and 'revert' must be alone
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -16129,7 +16165,7 @@ bool
|
||||||
CSSParserImpl::ParseTextOverflow(nsCSSValue& aValue)
|
CSSParserImpl::ParseTextOverflow(nsCSSValue& aValue)
|
||||||
{
|
{
|
||||||
if (ParseSingleTokenVariant(aValue, VARIANT_INHERIT, nullptr)) {
|
if (ParseSingleTokenVariant(aValue, VARIANT_INHERIT, nullptr)) {
|
||||||
// 'inherit', 'initial' and 'unset' must be alone
|
// 'inherit', 'initial', 'unset', and 'revert' must be alone
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -16160,7 +16196,7 @@ CSSParserImpl::ParseTouchAction(nsCSSValue& aValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto and None keywords aren't allowed in conjunction with others.
|
// Auto and None keywords aren't allowed in conjunction with others.
|
||||||
// Also inherit, initial and unset values are available.
|
// Also inherit, initial, unset, and revert values are available.
|
||||||
if (eCSSUnit_Enumerated != aValue.GetUnit()) {
|
if (eCSSUnit_Enumerated != aValue.GetUnit()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -16665,7 +16701,7 @@ bool
|
||||||
CSSParserImpl::ParseTransform(bool aIsPrefixed, bool aDisallowRelativeValues)
|
CSSParserImpl::ParseTransform(bool aIsPrefixed, bool aDisallowRelativeValues)
|
||||||
{
|
{
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'inherit', 'initial', 'unset' and 'none' must be alone
|
// 'inherit', 'initial', 'unset', 'revert', and 'none' must be alone
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
|
||||||
nullptr)) {
|
nullptr)) {
|
||||||
nsCSSValueSharedList* list = new nsCSSValueSharedList;
|
nsCSSValueSharedList* list = new nsCSSValueSharedList;
|
||||||
|
|
@ -16951,7 +16987,8 @@ bool
|
||||||
CSSParserImpl::ParseShapeOutside(nsCSSValue& aValue)
|
CSSParserImpl::ParseShapeOutside(nsCSSValue& aValue)
|
||||||
{
|
{
|
||||||
if (ParseSingleTokenVariant(aValue, VARIANT_HUO, nullptr)) {
|
if (ParseSingleTokenVariant(aValue, VARIANT_HUO, nullptr)) {
|
||||||
// 'inherit', 'initial', 'unset', 'none', and <image> url must be alone.
|
// 'inherit', 'initial', 'unset', 'revert', 'none', and
|
||||||
|
// <image> url must be alone.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -16975,9 +17012,10 @@ bool CSSParserImpl::ParseTransformOrigin(bool aPerspective)
|
||||||
// a pair, and to keep the computation code simple.
|
// a pair, and to keep the computation code simple.
|
||||||
if (position.mXValue.GetUnit() == eCSSUnit_Inherit ||
|
if (position.mXValue.GetUnit() == eCSSUnit_Inherit ||
|
||||||
position.mXValue.GetUnit() == eCSSUnit_Initial ||
|
position.mXValue.GetUnit() == eCSSUnit_Initial ||
|
||||||
position.mXValue.GetUnit() == eCSSUnit_Unset) {
|
position.mXValue.GetUnit() == eCSSUnit_Unset ||
|
||||||
|
position.mXValue.GetUnit() == eCSSUnit_Revert) {
|
||||||
MOZ_ASSERT(position.mXValue == position.mYValue,
|
MOZ_ASSERT(position.mXValue == position.mYValue,
|
||||||
"inherit/initial/unset only half?");
|
"inherit/initial/unset/revert only half?");
|
||||||
AppendValue(prop, position.mXValue);
|
AppendValue(prop, position.mXValue);
|
||||||
} else {
|
} else {
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
|
|
@ -17154,7 +17192,7 @@ bool
|
||||||
CSSParserImpl::ParseFilter()
|
CSSParserImpl::ParseFilter()
|
||||||
{
|
{
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'inherit', 'initial', 'unset' and 'none' must be alone
|
// 'inherit', 'initial', 'unset', 'revert', and 'none' must be alone
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
|
||||||
nullptr)) {
|
nullptr)) {
|
||||||
nsCSSValueList* cur = value.SetListValue();
|
nsCSSValueList* cur = value.SetListValue();
|
||||||
|
|
@ -17183,7 +17221,7 @@ bool
|
||||||
CSSParserImpl::ParseTransitionProperty()
|
CSSParserImpl::ParseTransitionProperty()
|
||||||
{
|
{
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'inherit', 'initial', 'unset' and 'none' must be alone
|
// 'inherit', 'initial', 'unset', 'revert', and 'none' must be alone
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
|
||||||
nullptr)) {
|
nullptr)) {
|
||||||
// Accept a list of arbitrary identifiers. They should be
|
// Accept a list of arbitrary identifiers. They should be
|
||||||
|
|
@ -17199,13 +17237,14 @@ CSSParserImpl::ParseTransitionProperty()
|
||||||
}
|
}
|
||||||
if (cur->mValue.GetUnit() == eCSSUnit_Ident) {
|
if (cur->mValue.GetUnit() == eCSSUnit_Ident) {
|
||||||
nsDependentString str(cur->mValue.GetStringBufferValue());
|
nsDependentString str(cur->mValue.GetStringBufferValue());
|
||||||
// Exclude 'none', 'inherit', 'initial' and 'unset' according to the
|
// Exclude 'none', 'inherit', 'initial', 'unset', and 'revert'
|
||||||
// same rules as for 'counter-reset' in CSS 2.1.
|
// according to the same rules as for 'counter-reset' in CSS 2.1.
|
||||||
if (str.LowerCaseEqualsLiteral("none") ||
|
if (str.LowerCaseEqualsLiteral("none") ||
|
||||||
str.LowerCaseEqualsLiteral("inherit") ||
|
str.LowerCaseEqualsLiteral("inherit") ||
|
||||||
str.LowerCaseEqualsLiteral("initial") ||
|
str.LowerCaseEqualsLiteral("initial") ||
|
||||||
(str.LowerCaseEqualsLiteral("unset") &&
|
(str.LowerCaseEqualsLiteral("unset") &&
|
||||||
nsLayoutUtils::UnsetValueEnabled())) {
|
nsLayoutUtils::UnsetValueEnabled()) ||
|
||||||
|
str.LowerCaseEqualsLiteral("revert")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -17346,9 +17385,9 @@ CSSParserImpl::ParseAnimationOrTransitionShorthand(
|
||||||
size_t aNumProperties)
|
size_t aNumProperties)
|
||||||
{
|
{
|
||||||
nsCSSValue tempValue;
|
nsCSSValue tempValue;
|
||||||
// first see if 'inherit', 'initial' or 'unset' is specified. If one is,
|
// first see if 'inherit', 'initial', 'unset', or 'revert' is specified.
|
||||||
// it can be the only thing specified, so don't attempt to parse any
|
// If one is, it can be the only thing specified, so don't attempt to
|
||||||
// additional properties
|
// parse any additional properties
|
||||||
if (ParseSingleTokenVariant(tempValue, VARIANT_INHERIT, nullptr)) {
|
if (ParseSingleTokenVariant(tempValue, VARIANT_INHERIT, nullptr)) {
|
||||||
for (uint32_t i = 0; i < aNumProperties; ++i) {
|
for (uint32_t i = 0; i < aNumProperties; ++i) {
|
||||||
AppendValue(aProperties[i], tempValue);
|
AppendValue(aProperties[i], tempValue);
|
||||||
|
|
@ -17473,7 +17512,7 @@ CSSParserImpl::ParseTransition()
|
||||||
// Make two checks on the list for 'transition-property':
|
// Make two checks on the list for 'transition-property':
|
||||||
// + If there is more than one item, then none of the items can be
|
// + If there is more than one item, then none of the items can be
|
||||||
// 'none'.
|
// 'none'.
|
||||||
// + None of the items can be 'inherit', 'initial' or 'unset'.
|
// + None of the items can be 'inherit', 'initial', 'unset', or 'revert'.
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(kTransitionProperties[3] == eCSSProperty_transition_property,
|
MOZ_ASSERT(kTransitionProperties[3] == eCSSProperty_transition_property,
|
||||||
"array index mismatch");
|
"array index mismatch");
|
||||||
|
|
@ -17496,7 +17535,8 @@ CSSParserImpl::ParseTransition()
|
||||||
if (str.EqualsLiteral("inherit") ||
|
if (str.EqualsLiteral("inherit") ||
|
||||||
str.EqualsLiteral("initial") ||
|
str.EqualsLiteral("initial") ||
|
||||||
(str.EqualsLiteral("unset") &&
|
(str.EqualsLiteral("unset") &&
|
||||||
nsLayoutUtils::UnsetValueEnabled())) {
|
nsLayoutUtils::UnsetValueEnabled()) ||
|
||||||
|
str.EqualsLiteral("revert")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -17665,7 +17705,7 @@ CSSParserImpl::ParseShadowList(nsCSSPropertyID aProperty)
|
||||||
bool isBoxShadow = aProperty == eCSSProperty_box_shadow;
|
bool isBoxShadow = aProperty == eCSSProperty_box_shadow;
|
||||||
|
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
// 'inherit', 'initial', 'unset' and 'none' must be alone
|
// 'inherit', 'initial', 'unset', 'revert', and 'none' must be alone
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
|
||||||
nullptr)) {
|
nullptr)) {
|
||||||
nsCSSValueList* cur = value.SetListValue();
|
nsCSSValueList* cur = value.SetListValue();
|
||||||
|
|
@ -17752,7 +17792,8 @@ CSSParserImpl::ParseDasharray()
|
||||||
{
|
{
|
||||||
nsCSSValue value;
|
nsCSSValue value;
|
||||||
|
|
||||||
// 'inherit', 'initial', 'unset' and 'none' are only allowed on their own
|
// 'inherit', 'initial', 'unset', 'revert' and 'none' are only allowed
|
||||||
|
// on their own
|
||||||
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE |
|
if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE |
|
||||||
VARIANT_OPENTYPE_SVG_KEYWORD,
|
VARIANT_OPENTYPE_SVG_KEYWORD,
|
||||||
nsCSSProps::kStrokeContextValueKTable)) {
|
nsCSSProps::kStrokeContextValueKTable)) {
|
||||||
|
|
@ -18116,8 +18157,8 @@ CSSParserImpl::ParseValueWithVariables(CSSVariableDeclarations::Type* aType,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for 'initial', 'inherit' or 'unset' as the first non-white space
|
// Look for 'initial', 'inherit', 'unset', or 'revert' as the first
|
||||||
// token.
|
// non-white space token.
|
||||||
CSSVariableDeclarations::Type type = CSSVariableDeclarations::eTokenStream;
|
CSSVariableDeclarations::Type type = CSSVariableDeclarations::eTokenStream;
|
||||||
if (mToken.mType == eCSSToken_Ident) {
|
if (mToken.mType == eCSSToken_Ident) {
|
||||||
if (mToken.mIdent.LowerCaseEqualsLiteral("initial")) {
|
if (mToken.mIdent.LowerCaseEqualsLiteral("initial")) {
|
||||||
|
|
@ -18126,6 +18167,8 @@ CSSParserImpl::ParseValueWithVariables(CSSVariableDeclarations::Type* aType,
|
||||||
type = CSSVariableDeclarations::eInherit;
|
type = CSSVariableDeclarations::eInherit;
|
||||||
} else if (mToken.mIdent.LowerCaseEqualsLiteral("unset")) {
|
} else if (mToken.mIdent.LowerCaseEqualsLiteral("unset")) {
|
||||||
type = CSSVariableDeclarations::eUnset;
|
type = CSSVariableDeclarations::eUnset;
|
||||||
|
} else if (mToken.mIdent.LowerCaseEqualsLiteral("revert")) {
|
||||||
|
type = CSSVariableDeclarations::eRevert;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
// 'inherit' and 'initial'
|
// 'inherit' and 'initial'
|
||||||
#define VARIANT_OPACITY 0x008000 // Take floats and percents as input, output float.
|
#define VARIANT_OPACITY 0x008000 // Take floats and percents as input, output float.
|
||||||
#define VARIANT_AUTO 0x010000 // A
|
#define VARIANT_AUTO 0x010000 // A
|
||||||
#define VARIANT_INHERIT 0x020000 // H eCSSUnit_Initial, eCSSUnit_Inherit, eCSSUnit_Unset
|
#define VARIANT_INHERIT 0x020000 // H eCSSUnit_Initial, eCSSUnit_Inherit, eCSSUnit_Unset, eCSSUnit_Revert
|
||||||
#define VARIANT_NONE 0x040000 // O
|
#define VARIANT_NONE 0x040000 // O
|
||||||
#define VARIANT_NORMAL 0x080000 // M
|
#define VARIANT_NORMAL 0x080000 // M
|
||||||
#define VARIANT_SYSFONT 0x100000 // eCSSUnit_System_Font
|
#define VARIANT_SYSFONT 0x100000 // eCSSUnit_System_Font
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue