mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-10 05:47:04 +00:00
Change round-trip testing for specified sub-properties of a shorthand to setthem all before looking at computed style, since, for example, the specifiedfont-family affects the computed line-height if the specified line-height is"normal". Bug 379809, r=dbaron
This commit is contained in:
parent
687c24bfdb
commit
c64c0e9a5a
@ -470,7 +470,7 @@ var gCSSProperties = {
|
||||
type: CSS_TYPE_TRUE_SHORTHAND,
|
||||
subproperties: [ "border-bottom-color", "border-bottom-style", "border-bottom-width" ],
|
||||
initial_values: [ "none", "medium", "currentColor", "none medium currentcolor" ],
|
||||
other_values: [ "solid", "thin", "green", "medium solid", "green solid", "10px solid", "thick solid" ],
|
||||
other_values: [ "solid", "thin", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
|
||||
invalid_values: [ "5%" ]
|
||||
},
|
||||
"border-bottom-color": {
|
||||
@ -522,7 +522,7 @@ var gCSSProperties = {
|
||||
type: CSS_TYPE_TRUE_SHORTHAND,
|
||||
subproperties: [ "border-left-color", "border-left-style", "border-left-width" ],
|
||||
initial_values: [ "none", "medium", "currentColor", "none medium currentcolor" ],
|
||||
other_values: [ "solid", "medium solid", "green solid", "10px solid", "thick solid" ],
|
||||
other_values: [ "solid", "thin", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
|
||||
invalid_values: [ "5%" ]
|
||||
},
|
||||
"border-left-color": {
|
||||
@ -557,7 +557,7 @@ var gCSSProperties = {
|
||||
type: CSS_TYPE_TRUE_SHORTHAND,
|
||||
subproperties: [ "border-right-color", "border-right-style", "border-right-width" ],
|
||||
initial_values: [ "none", "medium", "currentColor", "none medium currentcolor" ],
|
||||
other_values: [ "solid", "medium solid", "green solid", "10px solid", "thick solid" ],
|
||||
other_values: [ "solid", "thin", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
|
||||
invalid_values: [ "5%" ]
|
||||
},
|
||||
"border-right-color": {
|
||||
@ -610,7 +610,7 @@ var gCSSProperties = {
|
||||
type: CSS_TYPE_TRUE_SHORTHAND,
|
||||
subproperties: [ "border-top-color", "border-top-style", "border-top-width" ],
|
||||
initial_values: [ "none", "medium", "currentColor", "none medium currentcolor" ],
|
||||
other_values: [ "solid", "medium solid", "green solid", "10px solid", "thick solid" ],
|
||||
other_values: [ "solid", "thin", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
|
||||
invalid_values: [ "5%" ]
|
||||
},
|
||||
"border-top-color": {
|
||||
@ -802,12 +802,7 @@ var gCSSProperties = {
|
||||
subproperties: [ "font-style", "font-variant", "font-weight", "font-size", "line-height", "font-family", "font-stretch", "font-size-adjust" ],
|
||||
/* XXX could be sans-serif */
|
||||
initial_values: [ "medium serif" ],
|
||||
other_values: [ "large serif",
|
||||
/* XXXbz Commented this out for now because it
|
||||
fails line-height roundtripping on Mac
|
||||
somehow. See bug 379809 */
|
||||
/*"9px fantasy",*/
|
||||
"bold italic small-caps 24px/1.4 Times New Roman, serif", "caption", "icon", "menu", "message-box", "small-caption", "status-bar" ],
|
||||
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: []
|
||||
},
|
||||
"font-family": {
|
||||
|
@ -120,6 +120,8 @@ function xfail_ser_val(property, value)
|
||||
|
||||
// We output unneeded -moz-use-text-color only in the value getter and
|
||||
// not the serialization.
|
||||
// XXXbz is there any way we could actually filter for that, so that colors
|
||||
// other than green could be used in the property database here?
|
||||
if (property.match(/^border(|-bottom|-left|-right|-top)$/) &&
|
||||
!value.match(/(green|currentcolor)/i))
|
||||
return true;
|
||||
@ -250,6 +252,13 @@ function test_property(property)
|
||||
for (idx in info.subproperties) {
|
||||
var subprop = info.subproperties[idx];
|
||||
gDeclaration.setProperty(subprop, step1vals[idx], "");
|
||||
}
|
||||
|
||||
// Now that all the subprops are set, check their values. Note that we
|
||||
// need this in a separate loop, in case parts of the shorthand affect
|
||||
// the computed values of other parts.
|
||||
for (idx in info.subproperties) {
|
||||
var subprop = info.subproperties[idx];
|
||||
if (test_computed && !("backend_only" in gCSSProperties[subprop])) {
|
||||
func =
|
||||
xfail_idsersplitparse_compute(property, subprop, value, step1comps[idx])
|
||||
@ -274,8 +283,8 @@ function test_property(property)
|
||||
property + ": " + value + "'");
|
||||
}
|
||||
if (test_computed && "subproperties" in info) {
|
||||
gDeclaration.removeProperty(property);
|
||||
for (idx in info.subproperties) {
|
||||
gDeclaration.removeProperty(property);
|
||||
var subprop = info.subproperties[idx];
|
||||
if ("backend_only" in gCSSProperties[subprop])
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user