Limit the unitless length quirk to the properties where it's needed, per http://simon.html5.org/specs/quirks-mode#the-unitless-length-quirk . (Bug 774122, patch 2) r=bzbarsky

This commit is contained in:
L. David Baron 2012-07-16 01:10:06 -04:00
parent 3327b3e93b
commit d179f669a9
4 changed files with 172 additions and 94 deletions

View File

@ -656,6 +656,9 @@ protected:
// True when the hashless color quirk applies.
bool mHashlessColorQuirk : 1;
// True when the unitless length quirk applies.
bool mUnitlessLengthQuirk : 1;
// True if unsafe rules should be allowed
bool mUnsafeRulesEnabled : 1;
@ -750,6 +753,7 @@ CSSParserImpl::CSSParserImpl()
mHavePushBack(false),
mNavQuirkMode(false),
mHashlessColorQuirk(false),
mUnitlessLengthQuirk(false),
mUnsafeRulesEnabled(false),
mHTMLMediaMode(false),
mParsingCompoundProperty(false)
@ -4395,9 +4399,15 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue,
PRInt32 aVariantMask,
const PRInt32 aKeywordTable[])
{
NS_ASSERTION(IsParsingCompoundProperty() ||
((~aVariantMask) & (VARIANT_LENGTH|VARIANT_COLOR)),
"cannot distinguish lengths and colors in quirks mode");
NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR)) ||
!(aVariantMask & VARIANT_NUMBER),
"can't distinguish colors from numbers");
NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR)) ||
!(mUnitlessLengthQuirk && (aVariantMask & VARIANT_LENGTH)),
"can't distinguish colors from lengths");
NS_ASSERTION(!(mUnitlessLengthQuirk && (aVariantMask & VARIANT_LENGTH)) ||
!(aVariantMask & VARIANT_NUMBER),
"can't distinguish lengths from numbers");
NS_ABORT_IF_FALSE(!(aVariantMask & VARIANT_IDENTIFIER) ||
!(aVariantMask & VARIANT_IDENTIFIER_NO_INHERIT),
"must not set both VARIANT_IDENTIFIER and "
@ -4501,7 +4511,7 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue,
aValue.SetPercentValue(tk->mNumber);
return true;
}
if (mNavQuirkMode && !IsParsingCompoundProperty()) { // NONSTANDARD: Nav interprets unitless numbers as px
if (mUnitlessLengthQuirk) { // NONSTANDARD: Nav interprets unitless numbers as px
if (((aVariantMask & VARIANT_LENGTH) != 0) &&
(eCSSToken_Number == tk->mType)) {
aValue.SetFloatValue(tk->mNumber, eCSSUnit_Pixel);
@ -5621,9 +5631,13 @@ CSSParserImpl::ParseProperty(nsCSSProperty aPropID)
// Can't use AutoRestore<bool> because it's a bitfield.
NS_ABORT_IF_FALSE(!mHashlessColorQuirk,
"hashless color quirk should not be set");
NS_ABORT_IF_FALSE(!mUnitlessLengthQuirk,
"unitless length quirk should not be set");
if (mNavQuirkMode) {
mHashlessColorQuirk =
nsCSSProps::PropHasFlags(aPropID, CSS_PROPERTY_HASHLESS_COLOR_QUIRK);
mUnitlessLengthQuirk =
nsCSSProps::PropHasFlags(aPropID, CSS_PROPERTY_UNITLESS_LENGTH_QUIRK);
}
NS_ASSERTION(aPropID < eCSSProperty_COUNT, "index out of range");
@ -5667,6 +5681,7 @@ CSSParserImpl::ParseProperty(nsCSSProperty aPropID)
if (mNavQuirkMode) {
mHashlessColorQuirk = false;
mUnitlessLengthQuirk = false;
}
return result;

View File

@ -629,7 +629,8 @@ CSS_PROP_BORDER(
BorderBottomWidth,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_HKL | VARIANT_CALC,
kBorderWidthKTable,
@ -892,7 +893,8 @@ CSS_PROP_SHORTHAND(
border-left-width,
border_left_width,
BorderLeftWidth,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"")
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_BORDER(
@ -1047,7 +1049,8 @@ CSS_PROP_SHORTHAND(
border-right-width,
border_right_width,
BorderRightWidth,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"")
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_BORDER(
@ -1217,7 +1220,8 @@ CSS_PROP_BORDER(
BorderTopWidth,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_HKL | VARIANT_CALC,
kBorderWidthKTable,
@ -1227,7 +1231,8 @@ CSS_PROP_SHORTHAND(
border-width,
border_width,
BorderWidth,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"")
CSS_PROP_SHORTHAND(
border-radius,
@ -1346,7 +1351,8 @@ CSS_PROP_DISPLAY(
clip,
clip,
Clip,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
0,
nsnull,
@ -1687,7 +1693,8 @@ CSS_PROP_FONT(
FontSize,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE,
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_HKLP | VARIANT_SYSFONT | VARIANT_CALC,
kFontSizeKTable,
@ -1770,7 +1777,8 @@ CSS_PROP_POSITION(
Height,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC,
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_AHLP | VARIANT_CALC,
nsnull,
@ -1801,7 +1809,8 @@ CSS_PROP_POSITION(
left,
Left,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_STORES_CALC,
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_AHLP | VARIANT_CALC,
nsnull,
@ -1812,7 +1821,8 @@ CSS_PROP_TEXT(
letter_spacing,
LetterSpacing,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE,
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
nsnull,
@ -1871,7 +1881,8 @@ CSS_PROP_SHORTHAND(
margin,
margin,
Margin,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"")
CSS_PROP_MARGIN(
margin-bottom,
@ -1879,7 +1890,8 @@ CSS_PROP_MARGIN(
MarginBottom,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_STORES_CALC,
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_AHLP | VARIANT_CALC,
nsnull,
@ -1909,7 +1921,8 @@ CSS_PROP_SHORTHAND(
margin-left,
margin_left,
MarginLeft,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"")
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_MARGIN(
@ -1954,7 +1967,8 @@ CSS_PROP_SHORTHAND(
margin-right,
margin_right,
MarginRight,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"")
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_MARGIN(
@ -2021,7 +2035,8 @@ CSS_PROP_MARGIN(
MarginTop,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_STORES_CALC,
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_AHLP | VARIANT_CALC,
nsnull,
@ -2201,7 +2216,8 @@ CSS_PROP_SHORTHAND(
padding,
padding,
Padding,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"")
CSS_PROP_PADDING(
padding-bottom,
@ -2210,7 +2226,8 @@ CSS_PROP_PADDING(
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_STORES_CALC,
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_HLP | VARIANT_CALC,
nsnull,
@ -2241,7 +2258,8 @@ CSS_PROP_SHORTHAND(
padding-left,
padding_left,
PaddingLeft,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"")
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_PADDING(
@ -2287,7 +2305,8 @@ CSS_PROP_SHORTHAND(
padding-right,
padding_right,
PaddingRight,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"")
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_PADDING(
@ -2357,7 +2376,8 @@ CSS_PROP_PADDING(
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_STORES_CALC,
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_HLP | VARIANT_CALC,
nsnull,
@ -2444,7 +2464,8 @@ CSS_PROP_POSITION(
right,
Right,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_STORES_CALC,
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_AHLP | VARIANT_CALC,
nsnull,
@ -2666,7 +2687,8 @@ CSS_PROP_POSITION(
top,
Top,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_STORES_CALC,
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_AHLP | VARIANT_CALC,
nsnull,
@ -2823,7 +2845,8 @@ CSS_PROP_POSITION(
Width,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC,
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_AHKLP | VARIANT_CALC,
kWidthKTable,
@ -2854,7 +2877,8 @@ CSS_PROP_TEXT(
word_spacing,
WordSpacing,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE,
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
"",
VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
nsnull,

View File

@ -95,6 +95,9 @@ MOZ_STATIC_ASSERT((CSS_PROPERTY_PARSE_PROPERTY_MASK &
// Does this property suppor the hashless hex color quirk in quirks mode?
#define CSS_PROPERTY_HASHLESS_COLOR_QUIRK (1<<15)
// Does this property suppor the unitless length quirk in quirks mode?
#define CSS_PROPERTY_UNITLESS_LENGTH_QUIRK (1<<16)
/**
* Types of animatable values.
*/

View File

@ -159,7 +159,7 @@ var gCSSProperties = {
subproperties: [ "-moz-border-end-color", "-moz-border-end-style", "-moz-border-end-width" ],
initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
invalid_values: [ "5%" ]
invalid_values: [ "5%", "5", "5 green none" ]
},
"-moz-border-end-color": {
domProp: "MozBorderEndColor",
@ -197,7 +197,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 5em)",
],
invalid_values: [ "5%" ]
invalid_values: [ "5%", "5" ]
},
"border-image": {
domProp: "borderImage",
@ -303,7 +303,7 @@ var gCSSProperties = {
"2px 2px calc(2px + 1%) 2px",
"1px 2px 2px 2px / 2px 2px calc(2px + 1%) 2px",
],
invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px" ]
invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px", "2", "2 2", "2px 2px 2px 2px / 2px 2px 2 2px" ]
},
"border-bottom-left-radius": {
domProp: "borderBottomLeftRadius",
@ -322,7 +322,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
},
"border-bottom-right-radius": {
domProp: "borderBottomRightRadius",
@ -341,7 +341,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
},
"border-top-left-radius": {
domProp: "borderTopLeftRadius",
@ -360,7 +360,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
},
"border-top-right-radius": {
domProp: "borderTopRightRadius",
@ -379,7 +379,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
},
"-moz-border-right-colors": {
domProp: "MozBorderRightColors",
@ -396,7 +396,7 @@ var gCSSProperties = {
subproperties: [ "-moz-border-start-color", "-moz-border-start-style", "-moz-border-start-width" ],
initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
invalid_values: [ "5%" ]
invalid_values: [ "5%", "5", "5 green solid" ]
},
"-moz-border-start-color": {
domProp: "MozBorderStartColor",
@ -434,7 +434,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 5em)",
],
invalid_values: [ "5%" ]
invalid_values: [ "5%", "5" ]
},
"-moz-border-top-colors": {
domProp: "MozBorderTopColors",
@ -534,7 +534,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 5em)",
],
invalid_values: [ "3%", "-1px" ]
invalid_values: [ "3%", "-1px", "4" ]
},
"-moz-column-rule": {
domProp: "MozColumnRule",
@ -542,9 +542,9 @@ var gCSSProperties = {
type: CSS_TYPE_TRUE_SHORTHAND,
prerequisites: { "color": "green" },
subproperties: [ "-moz-column-rule-width", "-moz-column-rule-style", "-moz-column-rule-color" ],
initial_values: [ "medium none currentColor" ],
other_values: [ "2px blue solid", "red dotted 1px", "ridge 4px orange" ],
invalid_values: [ "2px 3px 4px red", "dotted dashed", "5px dashed green 3px" ]
initial_values: [ "medium none currentColor", "none", "medium", "currentColor" ],
other_values: [ "2px blue solid", "red dotted 1px", "ridge 4px orange", "5px solid" ],
invalid_values: [ "2px 3px 4px red", "dotted dashed", "5px dashed green 3px", "5 solid", "5 green solid" ]
},
"-moz-column-rule-width": {
domProp: "MozColumnRuleWidth",
@ -1037,7 +1037,7 @@ var gCSSProperties = {
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
other_values: [ "rect(3px 20px 15px 4px)", "rect(17px, 21px, 33px, 2px)" ],
invalid_values: []
invalid_values: [ "rect(17px, 21px, 33, 2px)" ]
},
"-moz-margin-end": {
domProp: "MozMarginEnd",
@ -1055,7 +1055,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: []
invalid_values: [ "5" ]
},
"-moz-margin-start": {
domProp: "MozMarginStart",
@ -1073,7 +1073,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: []
invalid_values: [ "5" ]
},
"-moz-outline-radius": {
domProp: "MozOutlineRadius",
@ -1095,7 +1095,7 @@ var gCSSProperties = {
"2px 2px calc(2px + 1%) 2px",
"1px 2px 2px 2px / 2px 2px calc(2px + 1%) 2px",
],
invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px" ]
invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px", "2", "2 2", "2px 2px 2px 2px / 2px 2px 2 2px" ]
},
"-moz-outline-radius-bottomleft": {
domProp: "MozOutlineRadiusBottomleft",
@ -1114,7 +1114,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
},
"-moz-outline-radius-bottomright": {
domProp: "MozOutlineRadiusBottomright",
@ -1133,7 +1133,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
},
"-moz-outline-radius-topleft": {
domProp: "MozOutlineRadiusTopleft",
@ -1152,7 +1152,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
},
"-moz-outline-radius-topright": {
domProp: "MozOutlineRadiusTopright",
@ -1171,7 +1171,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
},
"-moz-padding-end": {
domProp: "MozPaddingEnd",
@ -1187,7 +1187,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: []
invalid_values: [ "5" ]
},
"-moz-padding-start": {
domProp: "MozPaddingStart",
@ -1203,7 +1203,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: []
invalid_values: [ "5" ]
},
"resize": {
domProp: "resize",
@ -1276,6 +1276,8 @@ var gCSSProperties = {
"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)",
] : []),
invalid_values: ["1px", "#0000ff", "red", "auto",
"translatex(1)", "translatey(1)", "translate(2)",
"translate(-3, -4)",
"translatex(1px 1px)", "translatex(translatex(1px))",
"translatex(#0000ff)", "translatex(red)", "translatey()",
"matrix(1px, 2px, 3px, 4px, 5px, 6px)", "scale(150%)",
@ -1472,6 +1474,10 @@ var gCSSProperties = {
"50% left", "top 50%",
/* no quirks mode colors */
"-moz-radial-gradient(10% bottom, ffffff, black) scroll no-repeat",
/* no quirks mode lengths */
"-moz-linear-gradient(10 10px -45deg, red, blue) repeat",
"-moz-linear-gradient(10px 10 -45deg, red, blue) repeat",
"linear-gradient(red -99, yellow, green, blue 120%)",
/* bug 258080: don't accept background-position separated */
"left url(404.png) top", "top url(404.png) left",
/* not allowed to have color in non-bottom layer */
@ -1800,6 +1806,12 @@ var gCSSProperties = {
"-moz-element(#a()",
/* no quirks mode colors */
"linear-gradient(red, ff00ff)",
/* no quirks mode colors */
"-moz-radial-gradient(10% bottom, ffffff, black) scroll no-repeat",
/* no quirks mode lengths */
"-moz-linear-gradient(10 10px -45deg, red, blue) repeat",
"-moz-linear-gradient(10px 10 -45deg, red, blue) repeat",
"linear-gradient(red -99, yellow, green, blue 120%)",
/* Old syntax */
"-moz-linear-gradient(10px 10px, 20px, 30px 30px, 40px, from(blue), to(red))",
"-moz-radial-gradient(20px 20px, 10px 10px, from(green), to(#ff00ff))",
@ -2062,7 +2074,7 @@ var gCSSProperties = {
"top 20%", "bottom 20%", "50% left", "top 50%",
"50% bottom 10%", "right 10% 50%", "left right",
"top bottom", "left 10% right",
"top 20px bottom 20px", "left left" ]
"top 20px bottom 20px", "left left", "20 20" ]
},
"background-repeat": {
domProp: "backgroundRepeat",
@ -2103,7 +2115,7 @@ var gCSSProperties = {
"calc(-20px) calc(-50%)",
"calc(-20%) calc(-50%)"
],
invalid_values: [ "contain contain", "cover cover", "cover auto", "auto cover", "contain cover", "cover contain", "-5px 3px", "3px -5px", "auto -5px", "-5px auto" ]
invalid_values: [ "contain contain", "cover cover", "cover auto", "auto cover", "contain cover", "cover contain", "-5px 3px", "3px -5px", "auto -5px", "-5px auto", "5 3" ]
},
"border": {
domProp: "border",
@ -2112,7 +2124,7 @@ var gCSSProperties = {
subproperties: [ "border-bottom-color", "border-bottom-style", "border-bottom-width", "border-left-color", "border-left-style", "border-left-width", "border-right-color", "border-right-style", "border-right-width", "border-top-color", "border-top-style", "border-top-width", "-moz-border-top-colors", "-moz-border-right-colors", "-moz-border-bottom-colors", "-moz-border-left-colors", "border-image-source", "border-image-slice", "border-image-width", "border-image-outset", "border-image-repeat" ],
initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor", "calc(4px - 1px) none" ],
other_values: [ "solid", "medium solid", "green solid", "10px solid", "thick solid", "calc(2px) solid blue" ],
invalid_values: [ "5%", "medium solid ff00ff" ]
invalid_values: [ "5%", "medium solid ff00ff", "5 solid green" ]
},
"border-bottom": {
domProp: "borderBottom",
@ -2121,7 +2133,7 @@ var gCSSProperties = {
subproperties: [ "border-bottom-color", "border-bottom-style", "border-bottom-width" ],
initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
invalid_values: [ "5%" ]
invalid_values: [ "5%", "5", "5 solid green" ]
},
"border-bottom-color": {
domProp: "borderBottomColor",
@ -2158,7 +2170,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 5em)",
],
invalid_values: [ "5%" ]
invalid_values: [ "5%" ],
quirks_values: { "5": "5px" },
},
"border-collapse": {
domProp: "borderCollapse",
@ -2185,7 +2198,7 @@ var gCSSProperties = {
subproperties: [ "border-left-color", "border-left-style", "border-left-width" ],
initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
invalid_values: [ "5%" ]
invalid_values: [ "5%", "5", "5 solid green" ]
},
"border-left-color": {
domProp: "borderLeftColor",
@ -2222,7 +2235,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 5em)",
],
invalid_values: [ "5%" ]
invalid_values: [ "5%" ],
quirks_values: { "5": "5px" },
},
"border-right": {
domProp: "borderRight",
@ -2231,7 +2245,7 @@ var gCSSProperties = {
subproperties: [ "border-right-color", "border-right-style", "border-right-width" ],
initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
invalid_values: [ "5%" ]
invalid_values: [ "5%", "5", "5 solid green" ]
},
"border-right-color": {
domProp: "borderRightColor",
@ -2268,7 +2282,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 5em)",
],
invalid_values: [ "5%" ]
invalid_values: [ "5%" ],
quirks_values: { "5": "5px" },
},
"border-spacing": {
domProp: "borderSpacing",
@ -2295,7 +2310,7 @@ var gCSSProperties = {
subproperties: [ "border-top-color", "border-top-style", "border-top-width" ],
initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
invalid_values: [ "5%" ]
invalid_values: [ "5%", "5", "5 solid green" ]
},
"border-top-color": {
domProp: "borderTopColor",
@ -2332,7 +2347,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 5em)",
],
invalid_values: [ "5%" ]
invalid_values: [ "5%" ],
quirks_values: { "5": "5px" },
},
"border-width": {
domProp: "borderWidth",
@ -2342,7 +2358,8 @@ var gCSSProperties = {
prerequisites: { "border-style": "solid" },
initial_values: [ "medium", "3px", "medium medium", "3px medium medium", "medium 3px medium medium", "calc(3px) 3px calc(5px - 2px) calc(2px - -1px)" ],
other_values: [ "thin", "thick", "1px", "2em", "2px 0 0px 1em", "calc(2em)" ],
invalid_values: [ "5%" ]
invalid_values: [ "5%" ],
quirks_values: { "5": "5px" },
},
"bottom": {
domProp: "bottom",
@ -2360,7 +2377,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: []
invalid_values: [ "5" ]
},
"box-shadow": {
domProp: "boxShadow",
@ -2382,7 +2399,7 @@ var gCSSProperties = {
"calc(2px) calc(2px) calc(2px)",
"calc(2px) calc(2px) calc(2px) calc(2px)"
],
invalid_values: [ "3% 3%", "1px 1px 1px 1px 1px", "2px 2px, none", "red 2px 2px blue", "inherit, 2px 2px", "2px 2px, inherit", "2px 2px -5px", "inset 4px 4px black inset", "inset inherit", "inset none" ]
invalid_values: [ "3% 3%", "1px 1px 1px 1px 1px", "2px 2px, none", "red 2px 2px blue", "inherit, 2px 2px", "2px 2px, inherit", "2px 2px -5px", "inset 4px 4px black inset", "inset inherit", "inset none", "3 3", "3px 3", "3 3px", "3px 3px 3", "3px 3px 3px 3" ]
},
"caption-side": {
domProp: "captionSide",
@ -2406,7 +2423,8 @@ var gCSSProperties = {
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
other_values: [ "rect(0 0 0 0)", "rect(auto,auto,auto,auto)", "rect(3px, 4px, 4em, 0)", "rect(auto, 3em, 4pt, 2px)", "rect(2px 3px 4px 5px)" ],
invalid_values: [ "rect(auto, 3em, 2%, 5px)" ]
invalid_values: [ "rect(auto, 3em, 2%, 5px)" ],
quirks_values: { "rect(1, 2, 3, 4)": "rect(1px, 2px, 3px, 4px)" },
},
"color": {
domProp: "color",
@ -2512,7 +2530,7 @@ var gCSSProperties = {
subproperties: [ "font-style", "font-variant", "font-weight", "font-size", "line-height", "font-family", "font-stretch", "font-size-adjust", "-moz-font-feature-settings", "-moz-font-language-override" ],
initial_values: [ (gInitialFontFamilyIsSansSerif ? "medium sans-serif" : "medium serif") ],
other_values: [ "large serif", "9px fantasy", "bold italic small-caps 24px/1.4 Times New Roman, serif", "caption", "icon", "menu", "message-box", "small-caption", "status-bar" ],
invalid_values: []
invalid_values: [ "9 fantasy" ]
},
"font-family": {
domProp: "fontFamily",
@ -2567,7 +2585,8 @@ var gCSSProperties = {
"calc(-50%)",
"calc(-1px)"
],
invalid_values: [ "-2em", "-50%", "-1px" ]
invalid_values: [ "-2em", "-50%", "-1px" ],
quirks_values: { "5": "5px" },
},
"font-size-adjust": {
domProp: "fontSizeAdjust",
@ -2624,7 +2643,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "none", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available" ]
invalid_values: [ "none", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available" ],
quirks_values: { "5": "5px" },
},
"ime-mode": {
domProp: "imeMode",
@ -2650,7 +2670,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: []
invalid_values: [],
quirks_values: { "5": "5px" },
},
"letter-spacing": {
domProp: "letterSpacing",
@ -2661,7 +2682,8 @@ var gCSSProperties = {
"calc(0px)", "calc(1em)", "calc(1em + 3px)",
"calc(15px / 2)", "calc(15px/2)", "calc(-3px)"
],
invalid_values: []
invalid_values: [],
quirks_values: { "5": "5px" },
},
"line-height": {
domProp: "lineHeight",
@ -2741,7 +2763,8 @@ var gCSSProperties = {
subproperties: [ "margin-top", "margin-right", "margin-bottom", "margin-left" ],
initial_values: [ "0", "0px 0 0em", "0% 0px 0em 0pt" ],
other_values: [ "3px 0", "2em 4px 2pt", "1em 2em 3px 4px" ],
invalid_values: []
invalid_values: [],
quirks_values: { "5": "5px", "3px 6px 2 5px": "3px 6px 2px 5px" },
},
"margin-bottom": {
domProp: "marginBottom",
@ -2757,7 +2780,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ ]
invalid_values: [ ],
quirks_values: { "5": "5px" },
},
"margin-left": {
domProp: "marginLeft",
@ -2774,7 +2798,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "..25px", ".+5px", ".px", "-.px", "++5px", "-+4px", "+-3px", "--7px", "+-.6px", "-+.5px", "++.7px", "--.4px" ]
invalid_values: [ "..25px", ".+5px", ".px", "-.px", "++5px", "-+4px", "+-3px", "--7px", "+-.6px", "-+.5px", "++.7px", "--.4px" ],
quirks_values: { "5": "5px" },
},
"margin-right": {
domProp: "marginRight",
@ -2791,7 +2816,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ ]
invalid_values: [ ],
quirks_values: { "5": "5px" },
},
"margin-top": {
domProp: "marginTop",
@ -2807,7 +2833,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ ]
invalid_values: [ ],
quirks_values: { "5": "5px" },
},
"marker-offset": {
domProp: "markerOffset",
@ -2842,7 +2869,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "auto", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available" ]
invalid_values: [ "auto", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available", "5" ]
},
"max-width": {
domProp: "maxWidth",
@ -2859,7 +2886,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "auto" ]
invalid_values: [ "auto", "5" ]
},
"min-height": {
domProp: "minHeight",
@ -2874,7 +2901,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "none", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available" ]
invalid_values: [ "none", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available", "5" ]
},
"min-width": {
domProp: "minWidth",
@ -2889,7 +2916,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ "none" ]
invalid_values: [ "none", "5" ]
},
"opacity": {
domProp: "opacity",
@ -2929,7 +2956,7 @@ var gCSSProperties = {
"currentColor", "none medium currentcolor"
],
other_values: [ "solid", "medium solid", "green solid", "10px solid", "thick solid" ],
invalid_values: [ "5%" ]
invalid_values: [ "5%", "5", "5 solid green" ]
},
"outline-color": {
domProp: "outlineColor",
@ -2973,7 +3000,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 5em)",
],
invalid_values: [ "5%" ]
invalid_values: [ "5%", "5" ]
},
"overflow": {
domProp: "overflow",
@ -3010,7 +3037,8 @@ var gCSSProperties = {
subproperties: [ "padding-top", "padding-right", "padding-bottom", "padding-left" ],
initial_values: [ "0", "0px 0 0em", "0% 0px 0em 0pt", "calc(0px) calc(0em) calc(-2px) calc(-1%)" ],
other_values: [ "3px 0", "2em 4px 2pt", "1em 2em 3px 4px" ],
invalid_values: []
invalid_values: [],
quirks_values: { "5": "5px", "3px 6px 2 5px": "3px 6px 2px 5px" },
},
"padding-bottom": {
domProp: "paddingBottom",
@ -3024,7 +3052,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ ]
invalid_values: [ ],
quirks_values: { "5": "5px" },
},
"padding-left": {
domProp: "paddingLeft",
@ -3039,7 +3068,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ ]
invalid_values: [ ],
quirks_values: { "5": "5px" },
},
"padding-right": {
domProp: "paddingRight",
@ -3054,7 +3084,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ ]
invalid_values: [ ],
quirks_values: { "5": "5px" },
},
"padding-top": {
domProp: "paddingTop",
@ -3068,7 +3099,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: [ ]
invalid_values: [ ],
quirks_values: { "5": "5px" },
},
"page": {
domProp: "page",
@ -3146,7 +3178,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: []
invalid_values: [],
quirks_values: { "5": "5px" },
},
"size": {
/* XXX not a real property; applies only to page context */
@ -3242,7 +3275,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: []
invalid_values: [ "5" ]
},
"text-overflow": {
domProp: "textOverflow",
@ -3271,7 +3304,7 @@ var gCSSProperties = {
"calc(2px) calc(2px)",
"calc(2px) calc(2px) calc(2px)",
],
invalid_values: [ "3% 3%", "2px 2px -5px", "2px 2px 2px 2px", "2px 2px, none", "none, 2px 2px", "inherit, 2px 2px", "2px 2px, inherit",
invalid_values: [ "3% 3%", "2px 2px -5px", "2px 2px 2px 2px", "2px 2px, none", "none, 2px 2px", "inherit, 2px 2px", "2px 2px, inherit", "2 2px", "2px 2", "2px 2px 2", "2px 2px 2px 2",
"calc(2px) calc(2px) calc(2px) calc(2px)"
]
},
@ -3299,7 +3332,8 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: []
invalid_values: [],
quirks_values: { "5": "5px" },
},
"transition": {
domProp: "transition",
@ -3363,7 +3397,7 @@ var gCSSProperties = {
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: []
invalid_values: [ "5" ]
},
"visibility": {
domProp: "visibility",
@ -3485,7 +3519,8 @@ var gCSSProperties = {
"calc(3em / 100% * 3em)",
"calc(3em * (3em / 100%))",
"calc(3em * 3em / 100%)",
]
],
quirks_values: { "5": "5px" },
},
"word-break": {
domProp: "wordBreak",
@ -3507,7 +3542,8 @@ var gCSSProperties = {
"calc(15px / 2)", "calc(15px/2)",
"calc(-2em)"
],
invalid_values: []
invalid_values: [],
quirks_values: { "5": "5px" },
},
"word-wrap": {
domProp: "wordWrap",