Bug 975741: Store the initial value of 'perspective' as 'none' rather than the (invalid value) '0' to make storage of 'none' consistent, and remove workaround from nsComputedDOMStyle computed value implementation. r=heycam

This commit is contained in:
L. David Baron 2014-02-24 15:27:53 -08:00
parent 0026a0fe5d
commit 4fd06dded6
4 changed files with 4 additions and 9 deletions

View File

@ -1233,12 +1233,7 @@ CSSValue*
nsComputedDOMStyle::DoGetPerspective()
{
nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue;
if (StyleDisplay()->mChildPerspective.GetUnit() == eStyleUnit_Coord &&
StyleDisplay()->mChildPerspective.GetCoordValue() == 0.0) {
val->SetIdent(eCSSKeyword_none);
} else {
SetValueToCoord(val, StyleDisplay()->mChildPerspective, false);
}
SetValueToCoord(val, StyleDisplay()->mChildPerspective, false);
return val;
}

View File

@ -5589,7 +5589,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
SetCoord(*aRuleData->ValueForPerspective(),
display->mChildPerspective, parentDisplay->mChildPerspective,
SETCOORD_LAH | SETCOORD_INITIAL_ZERO | SETCOORD_NONE |
SETCOORD_LAH | SETCOORD_INITIAL_NONE | SETCOORD_NONE |
SETCOORD_UNSET_INITIAL,
aContext, mPresContext, canStoreInRuleTree);

View File

@ -2289,7 +2289,7 @@ nsStyleDisplay::nsStyleDisplay()
mTransformOrigin[2].SetCoordValue(0);
mPerspectiveOrigin[0].SetPercentValue(0.5f);
mPerspectiveOrigin[1].SetPercentValue(0.5f);
mChildPerspective.SetCoordValue(0);
mChildPerspective.SetNoneValue();
mBackfaceVisibility = NS_STYLE_BACKFACE_VISIBILITY_VISIBLE;
mTransformStyle = NS_STYLE_TRANSFORM_STYLE_FLAT;
mOrient = NS_STYLE_ORIENT_AUTO;

View File

@ -1732,7 +1732,7 @@ var gCSSProperties = {
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
other_values: [ "1000px", "500.2px" ],
invalid_values: [ "pants", "200", "0", "-100px", "-27.2em" ]
invalid_values: [ "pants", "200", "0", "-100px", "-27.2em", "0px" ]
},
"backface-visibility": {
domProp: "backfaceVisibility",