mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Backed out changeset ac282e15dc02 (bug 774122)
This commit is contained in:
parent
98c4ef5d6b
commit
83a09297e1
@ -653,9 +653,6 @@ protected:
|
||||
// True if we are in quirks mode; false in standards or almost standards mode
|
||||
bool mNavQuirkMode : 1;
|
||||
|
||||
// True when the hashless color quirk applies.
|
||||
bool mHashlessColorQuirk : 1;
|
||||
|
||||
// True if unsafe rules should be allowed
|
||||
bool mUnsafeRulesEnabled : 1;
|
||||
|
||||
@ -749,7 +746,6 @@ CSSParserImpl::CSSParserImpl()
|
||||
mNameSpaceMap(nsnull),
|
||||
mHavePushBack(false),
|
||||
mNavQuirkMode(false),
|
||||
mHashlessColorQuirk(false),
|
||||
mUnsafeRulesEnabled(false),
|
||||
mHTMLMediaMode(false),
|
||||
mParsingCompoundProperty(false)
|
||||
@ -3756,7 +3752,7 @@ CSSParserImpl::ParseColor(nsCSSValue& aValue)
|
||||
}
|
||||
|
||||
// try 'xxyyzz' without '#' prefix for compatibility with IE and Nav4x (bug 23236 and 45804)
|
||||
if (mHashlessColorQuirk) {
|
||||
if (mNavQuirkMode && !IsParsingCompoundProperty()) {
|
||||
// - If the string starts with 'a-f', the nsCSSScanner builds the
|
||||
// token as a eCSSToken_Ident and we can parse the string as a
|
||||
// 'xxyyzz' RGB color.
|
||||
@ -4557,7 +4553,7 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue,
|
||||
return ParseElement(aValue);
|
||||
}
|
||||
if ((aVariantMask & VARIANT_COLOR) != 0) {
|
||||
if (mHashlessColorQuirk || // NONSTANDARD: Nav interprets 'xxyyzz' values even without '#' prefix
|
||||
if ((mNavQuirkMode && !IsParsingCompoundProperty()) || // NONSTANDARD: Nav interprets 'xxyyzz' values even without '#' prefix
|
||||
(eCSSToken_ID == tk->mType) ||
|
||||
(eCSSToken_Ref == tk->mType) ||
|
||||
(eCSSToken_Ident == tk->mType) ||
|
||||
@ -5618,58 +5614,36 @@ static const nsCSSProperty kOutlineRadiusIDs[] = {
|
||||
bool
|
||||
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");
|
||||
if (mNavQuirkMode) {
|
||||
mHashlessColorQuirk =
|
||||
nsCSSProps::PropHasFlags(aPropID, CSS_PROPERTY_HASHLESS_COLOR_QUIRK);
|
||||
}
|
||||
|
||||
NS_ASSERTION(aPropID < eCSSProperty_COUNT, "index out of range");
|
||||
bool result;
|
||||
switch (nsCSSProps::PropertyParseType(aPropID)) {
|
||||
case CSS_PROPERTY_PARSE_INACCESSIBLE: {
|
||||
// The user can't use these
|
||||
REPORT_UNEXPECTED(PEInaccessibleProperty2);
|
||||
result = false;
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
case CSS_PROPERTY_PARSE_FUNCTION: {
|
||||
result = ParsePropertyByFunction(aPropID);
|
||||
break;
|
||||
return ParsePropertyByFunction(aPropID);
|
||||
}
|
||||
case CSS_PROPERTY_PARSE_VALUE: {
|
||||
result = false;
|
||||
nsCSSValue value;
|
||||
if (ParseSingleValueProperty(value, aPropID)) {
|
||||
if (ExpectEndProperty()) {
|
||||
AppendValue(aPropID, value);
|
||||
result = true;
|
||||
return true;
|
||||
}
|
||||
// XXX Report errors?
|
||||
}
|
||||
// XXX Report errors?
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
case CSS_PROPERTY_PARSE_VALUE_LIST: {
|
||||
result = ParseValueList(aPropID);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
result = false;
|
||||
NS_ABORT_IF_FALSE(false,
|
||||
"Property's flags field in nsCSSPropList.h is missing "
|
||||
"one of the CSS_PROPERTY_PARSE_* constants");
|
||||
break;
|
||||
return ParseValueList(aPropID);
|
||||
}
|
||||
}
|
||||
|
||||
if (mNavQuirkMode) {
|
||||
mHashlessColorQuirk = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
NS_ABORT_IF_FALSE(false,
|
||||
"Property's flags field in nsCSSPropList.h is missing "
|
||||
"one of the CSS_PROPERTY_PARSE_* constants");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -482,8 +482,7 @@ CSS_PROP_BACKGROUND(
|
||||
BackgroundColor,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
|
||||
CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
|
||||
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
|
||||
"",
|
||||
VARIANT_HC,
|
||||
nsnull,
|
||||
@ -593,8 +592,7 @@ CSS_PROP_BORDER(
|
||||
BorderBottomColor,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
|
||||
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
|
||||
CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
|
||||
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
|
||||
"",
|
||||
VARIANT_HCK,
|
||||
kBorderColorKTable,
|
||||
@ -649,8 +647,7 @@ CSS_PROP_SHORTHAND(
|
||||
border-color,
|
||||
border_color,
|
||||
BorderColor,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"")
|
||||
CSS_PROP_SHORTHAND(
|
||||
-moz-border-end,
|
||||
@ -788,8 +785,7 @@ CSS_PROP_SHORTHAND(
|
||||
border-left-color,
|
||||
border_left_color,
|
||||
BorderLeftColor,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"")
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_BORDER(
|
||||
@ -943,8 +939,7 @@ CSS_PROP_SHORTHAND(
|
||||
border-right-color,
|
||||
border_right_color,
|
||||
BorderRightColor,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"")
|
||||
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||
CSS_PROP_BORDER(
|
||||
@ -1181,8 +1176,7 @@ CSS_PROP_BORDER(
|
||||
BorderTopColor,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
|
||||
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
|
||||
CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
|
||||
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
|
||||
"",
|
||||
VARIANT_HCK,
|
||||
kBorderColorKTable,
|
||||
@ -1358,8 +1352,7 @@ CSS_PROP_COLOR(
|
||||
Color,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
|
||||
CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
|
||||
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
|
||||
"",
|
||||
VARIANT_HC,
|
||||
nsnull,
|
||||
|
@ -92,8 +92,7 @@ MOZ_STATIC_ASSERT((CSS_PROPERTY_PARSE_PROPERTY_MASK &
|
||||
// should enforce that the value of this property must be 1 or larger.
|
||||
#define CSS_PROPERTY_VALUE_AT_LEAST_ONE (2<<13)
|
||||
|
||||
// Does this property suppor the hashless hex color quirk in quirks mode?
|
||||
#define CSS_PROPERTY_HASHLESS_COLOR_QUIRK (1<<15)
|
||||
// NOTE: next free bit is (1<<15)
|
||||
|
||||
/**
|
||||
* Types of animatable values.
|
||||
|
@ -29,8 +29,6 @@ const CSS_TYPE_SHORTHAND_AND_LONGHAND = 2;
|
||||
// may not be the same as for the property's initial value.
|
||||
// invalid_values: Things that are not values for the property and
|
||||
// should be rejected.
|
||||
// quirks_values: Values that should be accepted in quirks mode only,
|
||||
// mapped to the values they are equivalent to.
|
||||
|
||||
// Helper functions used to construct gCSSProperties.
|
||||
|
||||
@ -150,7 +148,7 @@ var gCSSProperties = {
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "none" ],
|
||||
other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
|
||||
invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red", "ff00cc" ]
|
||||
invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red" ]
|
||||
},
|
||||
"-moz-border-end": {
|
||||
domProp: "MozBorderEnd",
|
||||
@ -168,7 +166,7 @@ var gCSSProperties = {
|
||||
get_computed: logical_box_prop_get_computed,
|
||||
initial_values: [ "currentColor" ],
|
||||
other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000", "000000" ]
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ]
|
||||
},
|
||||
"-moz-border-end-style": {
|
||||
domProp: "MozBorderEndStyle",
|
||||
@ -281,7 +279,7 @@ var gCSSProperties = {
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "none" ],
|
||||
other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
|
||||
invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red", "ff00cc" ]
|
||||
invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red" ]
|
||||
},
|
||||
"border-radius": {
|
||||
domProp: "borderRadius",
|
||||
@ -387,7 +385,7 @@ var gCSSProperties = {
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "none" ],
|
||||
other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
|
||||
invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red", "ff00cc" ]
|
||||
invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red" ]
|
||||
},
|
||||
"-moz-border-start": {
|
||||
domProp: "MozBorderStart",
|
||||
@ -405,7 +403,7 @@ var gCSSProperties = {
|
||||
get_computed: logical_box_prop_get_computed,
|
||||
initial_values: [ "currentColor" ],
|
||||
other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000", "000000" ]
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ]
|
||||
},
|
||||
"-moz-border-start-style": {
|
||||
domProp: "MozBorderStartStyle",
|
||||
@ -442,7 +440,7 @@ var gCSSProperties = {
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "none" ],
|
||||
other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
|
||||
invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red", "ff00cc" ]
|
||||
invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red" ]
|
||||
},
|
||||
"-moz-box-align": {
|
||||
domProp: "MozBoxAlign",
|
||||
@ -831,7 +829,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "green" },
|
||||
initial_values: [ "currentColor", "-moz-use-text-color" ],
|
||||
other_values: [ "red", "blue", "#ffff00" ],
|
||||
invalid_values: [ "ffff00" ]
|
||||
invalid_values: [ ]
|
||||
},
|
||||
"-moz-column-width": {
|
||||
domProp: "MozColumnWidth",
|
||||
@ -1470,8 +1468,6 @@ var gCSSProperties = {
|
||||
invalid_values: [
|
||||
/* mixes with keywords have to be in correct order */
|
||||
"50% left", "top 50%",
|
||||
/* no quirks mode colors */
|
||||
"-moz-radial-gradient(10% bottom, ffffff, black) scroll no-repeat",
|
||||
/* 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 */
|
||||
@ -1516,8 +1512,7 @@ var gCSSProperties = {
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "transparent", "rgba(255, 127, 15, 0)", "hsla(240, 97%, 50%, 0.0)", "rgba(0, 0, 0, 0)", "rgba(255,255,255,-3.7)" ],
|
||||
other_values: [ "green", "rgb(255, 0, 128)", "#fc2", "#96ed2a", "black", "rgba(255,255,0,3)" ],
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000", "rgb(255.0,0.387,3489)" ],
|
||||
quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" },
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000", "rgb(255.0,0.387,3489)" ]
|
||||
},
|
||||
"background-image": {
|
||||
domProp: "backgroundImage",
|
||||
@ -1798,8 +1793,6 @@ var gCSSProperties = {
|
||||
"-moz-element(#a a)",
|
||||
"-moz-element(#a+a)",
|
||||
"-moz-element(#a()",
|
||||
/* no quirks mode colors */
|
||||
"linear-gradient(red, ff00ff)",
|
||||
/* 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))",
|
||||
@ -2112,7 +2105,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%" ]
|
||||
},
|
||||
"border-bottom": {
|
||||
domProp: "borderBottom",
|
||||
@ -2130,8 +2123,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "black" },
|
||||
initial_values: [ "currentColor", "-moz-use-text-color" ],
|
||||
other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ],
|
||||
quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" },
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ]
|
||||
},
|
||||
"border-bottom-style": {
|
||||
domProp: "borderBottomStyle",
|
||||
@ -2175,8 +2167,7 @@ var gCSSProperties = {
|
||||
subproperties: [ "border-top-color", "border-right-color", "border-bottom-color", "border-left-color" ],
|
||||
initial_values: [ "currentColor", "currentColor currentColor", "currentColor currentColor currentColor", "currentColor currentColor currentcolor CURRENTcolor" ],
|
||||
other_values: [ "green", "currentColor green", "currentColor currentColor green", "currentColor currentColor currentColor green", "rgba(255,128,0,0.5)", "transparent" ],
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ],
|
||||
quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" },
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ]
|
||||
},
|
||||
"border-left": {
|
||||
domProp: "borderLeft",
|
||||
@ -2194,8 +2185,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "black" },
|
||||
initial_values: [ "currentColor", "-moz-use-text-color" ],
|
||||
other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ],
|
||||
quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" },
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ]
|
||||
},
|
||||
"border-left-style": {
|
||||
domProp: "borderLeftStyle",
|
||||
@ -2240,8 +2230,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "black" },
|
||||
initial_values: [ "currentColor", "-moz-use-text-color" ],
|
||||
other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ],
|
||||
quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" },
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ]
|
||||
},
|
||||
"border-right-style": {
|
||||
domProp: "borderRightStyle",
|
||||
@ -2304,8 +2293,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "black" },
|
||||
initial_values: [ "currentColor", "-moz-use-text-color" ],
|
||||
other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ],
|
||||
quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a" },
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ]
|
||||
},
|
||||
"border-top-style": {
|
||||
domProp: "borderTopStyle",
|
||||
@ -2415,8 +2403,7 @@ var gCSSProperties = {
|
||||
/* XXX should test currentColor, but may or may not be initial */
|
||||
initial_values: [ "black", "#000" ],
|
||||
other_values: [ "green", "#f3c", "#fed292", "rgba(45,300,12,2)", "transparent", "-moz-nativehyperlinktext", "rgba(255,128,0,0.5)" ],
|
||||
invalid_values: [ "#f", "#ff", "#ffff", "#fffff", "#fffffff", "#ffffffff", "#fffffffff" ],
|
||||
quirks_values: { "000000": "#000000", "96ed2a": "#96ed2a", "fff": "#ffffff", "ffffff": "#ffffff", },
|
||||
invalid_values: [ "fff", "ffffff", "#f", "#ff", "#ffff", "#fffff", "#fffffff", "#ffffffff", "#fffffffff" ]
|
||||
},
|
||||
"content": {
|
||||
domProp: "content",
|
||||
@ -2938,7 +2925,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "black" },
|
||||
initial_values: [ "currentColor", "-moz-use-text-color" ], // XXX should be invert
|
||||
other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000", "000000", "cc00ff" ]
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ]
|
||||
},
|
||||
"outline-offset": {
|
||||
domProp: "outlineOffset",
|
||||
@ -3211,7 +3198,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "black" },
|
||||
initial_values: [ "currentColor", "-moz-use-text-color" ],
|
||||
other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000", "000000", "ff00ff" ]
|
||||
invalid_values: [ "#0", "#00", "#0000", "#00000", "#0000000", "#00000000", "#000000000" ]
|
||||
},
|
||||
"-moz-text-decoration-line": {
|
||||
domProp: "MozTextDecorationLine",
|
||||
@ -3582,7 +3569,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "blue" },
|
||||
initial_values: [ "black", "#000", "#000000", "rgb(0,0,0)", "rgba(0,0,0,1)" ],
|
||||
other_values: [ "green", "#fc3", "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green', "none", "currentColor" ],
|
||||
invalid_values: [ "000000", "ff00ff" ]
|
||||
invalid_values: []
|
||||
},
|
||||
"fill-opacity": {
|
||||
domProp: "fillOpacity",
|
||||
@ -3615,7 +3602,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "blue" },
|
||||
initial_values: [ "black", "#000", "#000000", "rgb(0,0,0)", "rgba(0,0,0,1)" ],
|
||||
other_values: [ "green", "#fc3", "currentColor" ],
|
||||
invalid_values: [ "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green', "000000", "ff00ff" ]
|
||||
invalid_values: [ "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green' ]
|
||||
},
|
||||
"flood-opacity": {
|
||||
domProp: "floodOpacity",
|
||||
@ -3640,7 +3627,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "blue" },
|
||||
initial_values: [ "white", "#fff", "#ffffff", "rgb(255,255,255)", "rgba(255,255,255,1.0)", "rgba(255,255,255,42.0)" ],
|
||||
other_values: [ "green", "#fc3", "currentColor" ],
|
||||
invalid_values: [ "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green', "000000", "ff00ff" ]
|
||||
invalid_values: [ "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green' ]
|
||||
},
|
||||
"marker": {
|
||||
domProp: "marker",
|
||||
@ -3698,7 +3685,7 @@ var gCSSProperties = {
|
||||
prerequisites: { "color": "blue" },
|
||||
initial_values: [ "black", "#000", "#000000", "rgb(0,0,0)", "rgba(0,0,0,1)" ],
|
||||
other_values: [ "green", "#fc3", "currentColor" ],
|
||||
invalid_values: [ "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green', "000000", "ff00ff" ]
|
||||
invalid_values: [ "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green' ]
|
||||
},
|
||||
"stop-opacity": {
|
||||
domProp: "stopOpacity",
|
||||
@ -3714,7 +3701,7 @@ var gCSSProperties = {
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "none" ],
|
||||
other_values: [ "black", "#000", "#000000", "rgb(0,0,0)", "rgba(0,0,0,1)", "green", "#fc3", "url('#myserver')", "url(foo.svg#myserver)", 'url("#myserver") green', "currentColor" ],
|
||||
invalid_values: [ "000000", "ff00ff" ]
|
||||
invalid_values: []
|
||||
},
|
||||
"stroke-dasharray": {
|
||||
domProp: "strokeDasharray",
|
||||
|
@ -8,9 +8,8 @@
|
||||
<script type="text/javascript" src="property_database.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body onload="run()">
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<iframe id="quirks" src="data:text/html,<div id='testnode'></div>"></iframe>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
<div id="testnode"></div>
|
||||
@ -19,76 +18,42 @@
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var gDeclaration = document.getElementById("testnode").style;
|
||||
|
||||
function check_not_accepted(decl, property, info, badval)
|
||||
{
|
||||
decl.setProperty(property, badval, "");
|
||||
|
||||
is(decl.getPropertyValue(property), "",
|
||||
"invalid value '" + badval + "' not accepted for '" + property +
|
||||
"' property");
|
||||
|
||||
if ("subproperties" in info) {
|
||||
for (var sidx in info.subproperties) {
|
||||
var subprop = info.subproperties[sidx];
|
||||
is(decl.getPropertyValue(subprop), "",
|
||||
"invalid value '" + badval + "' not accepted for '" + property +
|
||||
"' property when testing subproperty '" + subprop + "'");
|
||||
}
|
||||
}
|
||||
|
||||
decl.removeProperty(property);
|
||||
var gKnownFails = {
|
||||
"pitch-range": [ " -0.01", "100.2", "108", "-3" ],
|
||||
"richness": [ " -0.01", "100.2", "108", "-3" ],
|
||||
"stress": [ " -0.01", "100.2", "108", "-3" ],
|
||||
"volume": [ " -0.01", "100.2", "108", "-3" ]
|
||||
}
|
||||
|
||||
function run()
|
||||
{
|
||||
var gDeclaration = document.getElementById("testnode").style;
|
||||
var gQuirksDeclaration = document.getElementById("quirks").contentDocument
|
||||
.getElementById("testnode").style;
|
||||
for (var property in gCSSProperties) {
|
||||
var info = gCSSProperties[property];
|
||||
for (var idx in info.invalid_values) {
|
||||
var badval = info.invalid_values[idx];
|
||||
|
||||
for (var property in gCSSProperties) {
|
||||
var info = gCSSProperties[property];
|
||||
for (var idx in info.invalid_values) {
|
||||
check_not_accepted(gDeclaration, property, info,
|
||||
info.invalid_values[idx]);
|
||||
check_not_accepted(gQuirksDeclaration, property, info,
|
||||
info.invalid_values[idx]);
|
||||
}
|
||||
gDeclaration.setProperty(property, badval, "");
|
||||
|
||||
if ("quirks_values" in info) {
|
||||
for (var quirkval in info.quirks_values) {
|
||||
var standardval = info.quirks_values[quirkval];
|
||||
check_not_accepted(gDeclaration, property, info, quirkval);
|
||||
var func = is;
|
||||
if (property in gKnownFails &&
|
||||
gKnownFails[property].indexOf(badval) != -1)
|
||||
func = todo_is;
|
||||
|
||||
gQuirksDeclaration.setProperty(property, quirkval, "");
|
||||
gDeclaration.setProperty(property, standardval, "");
|
||||
var quirkret = gQuirksDeclaration.getPropertyValue(property);
|
||||
var standardret = gDeclaration.getPropertyValue(property);
|
||||
isnot(quirkret, "", property + ": " + quirkval +
|
||||
" should be accepted in quirks mode");
|
||||
is(quirkret, standardret, property + ": " + quirkval + " result");
|
||||
func(gDeclaration.getPropertyValue(property), "",
|
||||
"invalid value '" + badval + "' not accepted for '" + property +
|
||||
"' property");
|
||||
|
||||
if ("subproperties" in info) {
|
||||
for (var sidx in info.subproperties) {
|
||||
var subprop = info.subproperties[sidx];
|
||||
var quirksub = gQuirksDeclaration.getPropertyValue(subprop);
|
||||
var standardsub = gDeclaration.getPropertyValue(subprop);
|
||||
isnot(quirksub, "", property + ": " + quirkval +
|
||||
" should be accepted in quirks mode" +
|
||||
" when testing subproperty " + subprop);
|
||||
is(quirksub, standardsub, property + ": " + quirkval + " result" +
|
||||
" when testing subproperty " + subprop);
|
||||
}
|
||||
}
|
||||
|
||||
gQuirksDeclaration.removeProperty(property);
|
||||
gDeclaration.removeProperty(property);
|
||||
if ("subproperties" in info) {
|
||||
for (var sidx in info.subproperties) {
|
||||
var subprop = info.subproperties[sidx];
|
||||
func(gDeclaration.getPropertyValue(subprop), "",
|
||||
"invalid value '" + badval + "' not accepted for '" + property +
|
||||
"' property when testing subproperty '" + subprop + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SimpleTest.finish();
|
||||
gDeclaration.removeProperty(property);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user