Bug 752187 - Part 6: Rename mIsToCorner to mIsLegacySyntax. r=dbaron

This commit is contained in:
Masatoshi Kimura 2012-07-07 10:27:08 -04:00
parent 36da902f60
commit 68b09c47fc
4 changed files with 7 additions and 6 deletions

View File

@ -5005,7 +5005,7 @@ CSSParserImpl::ParseLinearGradient(nsCSSValue& aValue, bool aIsRepeating)
nsCSSTokenType ty = mToken.mType;
nsString id = mToken.mIdent;
cssGradient->mIsToCorner = toCorner;
cssGradient->mIsLegacySyntax = !toCorner;
UngetToken();
// <legacy-gradient-line>
@ -5075,6 +5075,7 @@ CSSParserImpl::ParseRadialGradient(nsCSSValue& aValue, bool aIsRepeating)
{
nsRefPtr<nsCSSValueGradient> cssGradient
= new nsCSSValueGradient(true, aIsRepeating);
cssGradient->mIsLegacySyntax = true;
// <gradient-line>
if (!GetToken(true)) {

View File

@ -920,7 +920,7 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult) const
aResult.AppendLiteral("-moz-linear-gradient(");
}
if (gradient->mIsToCorner) {
if (!gradient->mIsLegacySyntax) {
aResult.AppendLiteral("to");
NS_ABORT_IF_FALSE(gradient->mBgPos.mXValue.GetUnit() == eCSSUnit_Enumerated &&
gradient->mBgPos.mYValue.GetUnit() == eCSSUnit_Enumerated,
@ -1699,7 +1699,7 @@ nsCSSValueGradient::nsCSSValueGradient(bool aIsRadial,
bool aIsRepeating)
: mIsRadial(aIsRadial),
mIsRepeating(aIsRepeating),
mIsToCorner(false),
mIsLegacySyntax(false),
mBgPos(eCSSUnit_None),
mAngle(eCSSUnit_None),
mRadialShape(eCSSUnit_None),

View File

@ -1043,7 +1043,7 @@ struct nsCSSValueGradient {
// true if gradient is radial, false if it is linear
bool mIsRadial;
bool mIsRepeating;
bool mIsToCorner;
bool mIsLegacySyntax;
// line position and angle
nsCSSValuePair mBgPos;
nsCSSValue mAngle;
@ -1058,7 +1058,7 @@ struct nsCSSValueGradient {
{
if (mIsRadial != aOther.mIsRadial ||
mIsRepeating != aOther.mIsRepeating ||
mIsToCorner != aOther.mIsToCorner ||
mIsLegacySyntax != aOther.mIsLegacySyntax ||
mBgPos != aOther.mBgPos ||
mAngle != aOther.mAngle ||
mRadialShape != aOther.mRadialShape ||

View File

@ -857,7 +857,7 @@ static void SetGradient(const nsCSSValue& aValue, nsPresContext* aPresContext,
aResult.mShape = NS_STYLE_GRADIENT_SHAPE_LINEAR;
aResult.mSize = NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER;
aResult.mToCorner = gradient->mIsToCorner;
aResult.mToCorner = !gradient->mIsLegacySyntax;
}
// bg-position