author | Robert Longson <longsonr@gmail.com> |
Sun, 09 Oct 2011 16:25:07 +0100 | |
changeset 78404 | 5eed5a82852c68eef20db520f08cdc4526829e1b |
parent 78403 | 51ef48b744536610777936bded3c26a8023ba133 |
child 78405 | 2a151eaf035b1d082316c8c5252b3c6f00f43278 |
push id | 2529 |
push user | longsonr@gmail.com |
push date | Sun, 09 Oct 2011 15:24:51 +0000 |
treeherder | mozilla-inbound@5eed5a82852c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | dholbert |
bugs | 691298 |
milestone | 10.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp +++ b/content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp @@ -221,19 +221,17 @@ ToPreserveAspectRatio(const nsAString &a } *aValue = val; return NS_OK; } nsresult SVGAnimatedPreserveAspectRatio::SetBaseValueString( - const nsAString &aValueAsString, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + const nsAString &aValueAsString, nsSVGElement *aSVGElement) { SVGPreserveAspectRatio val; nsresult res = ToPreserveAspectRatio(aValueAsString, &val); if (NS_FAILED(res)) { return res; } mBaseVal = val; @@ -242,17 +240,19 @@ SVGAnimatedPreserveAspectRatio::SetBaseV mAnimVal = mBaseVal; } #ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } #endif - aSVGElement->DidChangePreserveAspectRatio(aDoSetAttr); + // We don't need to call DidChange* here - we're only called by + // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr, + // which takes care of notifying. return NS_OK; } void SVGAnimatedPreserveAspectRatio::GetBaseValueString(nsAString & aValueAsString) { nsAutoString tmpString;
--- a/content/svg/content/src/SVGAnimatedPreserveAspectRatio.h +++ b/content/svg/content/src/SVGAnimatedPreserveAspectRatio.h @@ -105,18 +105,17 @@ public: mBaseVal.mMeetOrSlice = nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET; mBaseVal.mDefer = PR_FALSE; mAnimVal = mBaseVal; mIsAnimated = PR_FALSE; mIsBaseSet = PR_FALSE; } nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr); + nsSVGElement *aSVGElement); void GetBaseValueString(nsAString& aValue); nsresult SetBaseAlign(PRUint16 aAlign, nsSVGElement *aSVGElement); nsresult SetBaseMeetOrSlice(PRUint16 aMeetOrSlice, nsSVGElement *aSVGElement); void SetAnimValue(PRUint64 aPackedValue, nsSVGElement *aSVGElement); const SVGPreserveAspectRatio &GetBaseValue() const { return mBaseVal; }
--- a/content/svg/content/src/nsSVGBoolean.cpp +++ b/content/svg/content/src/nsSVGBoolean.cpp @@ -69,18 +69,17 @@ GetValueFromString(const nsAString &aVal *aValue = PR_FALSE; return NS_OK; } return NS_ERROR_DOM_SYNTAX_ERR; } nsresult nsSVGBoolean::SetBaseValueString(const nsAString &aValueAsString, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { bool val; nsresult rv = GetValueFromString(aValueAsString, &val); if (NS_FAILED(rv)) { return rv; }
--- a/content/svg/content/src/nsSVGBoolean.h +++ b/content/svg/content/src/nsSVGBoolean.h @@ -47,18 +47,17 @@ class nsSVGBoolean public: void Init(PRUint8 aAttrEnum = 0xff, bool aValue = false) { mAnimVal = mBaseVal = aValue; mAttrEnum = aAttrEnum; mIsAnimated = PR_FALSE; } nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr); + nsSVGElement *aSVGElement); void GetBaseValueString(nsAString& aValue); void SetBaseValue(bool aValue, nsSVGElement *aSVGElement); bool GetBaseValue() const { return mBaseVal; } void SetAnimValue(bool aValue, nsSVGElement *aSVGElement); bool GetAnimValue() const
--- a/content/svg/content/src/nsSVGElement.cpp +++ b/content/svg/content/src/nsSVGElement.cpp @@ -377,62 +377,62 @@ nsSVGElement::ParseAttribute(PRInt32 aNa } } if (!foundMatch) { // Check for nsSVGNumber2 attribute NumberAttributesInfo numberInfo = GetNumberInfo(); for (i = 0; i < numberInfo.mNumberCount; i++) { if (aAttribute == *numberInfo.mNumberInfo[i].mName) { - rv = numberInfo.mNumbers[i].SetBaseValueString(aValue, this, PR_FALSE); + rv = numberInfo.mNumbers[i].SetBaseValueString(aValue, this); if (NS_FAILED(rv)) { numberInfo.Reset(i); } foundMatch = PR_TRUE; break; } } } if (!foundMatch) { // Check for nsSVGNumberPair attribute NumberPairAttributesInfo numberPairInfo = GetNumberPairInfo(); for (i = 0; i < numberPairInfo.mNumberPairCount; i++) { if (aAttribute == *numberPairInfo.mNumberPairInfo[i].mName) { - rv = numberPairInfo.mNumberPairs[i].SetBaseValueString(aValue, this, PR_FALSE); + rv = numberPairInfo.mNumberPairs[i].SetBaseValueString(aValue, this); if (NS_FAILED(rv)) { numberPairInfo.Reset(i); } foundMatch = PR_TRUE; break; } } } if (!foundMatch) { // Check for nsSVGInteger attribute IntegerAttributesInfo integerInfo = GetIntegerInfo(); for (i = 0; i < integerInfo.mIntegerCount; i++) { if (aAttribute == *integerInfo.mIntegerInfo[i].mName) { - rv = integerInfo.mIntegers[i].SetBaseValueString(aValue, this, PR_FALSE); + rv = integerInfo.mIntegers[i].SetBaseValueString(aValue, this); if (NS_FAILED(rv)) { integerInfo.Reset(i); } foundMatch = PR_TRUE; break; } } } if (!foundMatch) { // Check for nsSVGIntegerPair attribute IntegerPairAttributesInfo integerPairInfo = GetIntegerPairInfo(); for (i = 0; i < integerPairInfo.mIntegerPairCount; i++) { if (aAttribute == *integerPairInfo.mIntegerPairInfo[i].mName) { - rv = integerPairInfo.mIntegerPairs[i].SetBaseValueString(aValue, this, PR_FALSE); + rv = integerPairInfo.mIntegerPairs[i].SetBaseValueString(aValue, this); if (NS_FAILED(rv)) { integerPairInfo.Reset(i); } foundMatch = PR_TRUE; break; } } } @@ -452,58 +452,58 @@ nsSVGElement::ParseAttribute(PRInt32 aNa } } if (!foundMatch) { // Check for nsSVGBoolean attribute BooleanAttributesInfo booleanInfo = GetBooleanInfo(); for (i = 0; i < booleanInfo.mBooleanCount; i++) { if (aAttribute == *booleanInfo.mBooleanInfo[i].mName) { - rv = booleanInfo.mBooleans[i].SetBaseValueString(aValue, this, PR_FALSE); + rv = booleanInfo.mBooleans[i].SetBaseValueString(aValue, this); if (NS_FAILED(rv)) { booleanInfo.Reset(i); } foundMatch = PR_TRUE; break; } } } if (!foundMatch) { // Check for nsSVGEnum attribute EnumAttributesInfo enumInfo = GetEnumInfo(); for (i = 0; i < enumInfo.mEnumCount; i++) { if (aAttribute == *enumInfo.mEnumInfo[i].mName) { - rv = enumInfo.mEnums[i].SetBaseValueString(aValue, this, PR_FALSE); + rv = enumInfo.mEnums[i].SetBaseValueString(aValue, this); if (NS_FAILED(rv)) { enumInfo.Reset(i); } foundMatch = PR_TRUE; break; } } } if (!foundMatch) { // Check for nsSVGViewBox attribute if (aAttribute == nsGkAtoms::viewBox) { nsSVGViewBox* viewBox = GetViewBox(); if (viewBox) { - rv = viewBox->SetBaseValueString(aValue, this, PR_FALSE); + rv = viewBox->SetBaseValueString(aValue, this); if (NS_FAILED(rv)) { viewBox->Init(); } foundMatch = PR_TRUE; } // Check for SVGAnimatedPreserveAspectRatio attribute } else if (aAttribute == nsGkAtoms::preserveAspectRatio) { SVGAnimatedPreserveAspectRatio *preserveAspectRatio = GetPreserveAspectRatio(); if (preserveAspectRatio) { - rv = preserveAspectRatio->SetBaseValueString(aValue, this, PR_FALSE); + rv = preserveAspectRatio->SetBaseValueString(aValue, this); if (NS_FAILED(rv)) { preserveAspectRatio->Init(); } foundMatch = PR_TRUE; } // Check for SVGAnimatedTransformList attribute } else if (GetTransformListAttrName() == aAttribute) { SVGAnimatedTransformList *transformList = GetAnimatedTransformList();
--- a/content/svg/content/src/nsSVGEnum.cpp +++ b/content/svg/content/src/nsSVGEnum.cpp @@ -65,18 +65,17 @@ nsSVGEnum::GetMapping(nsSVGElement *aSVG NS_ASSERTION(info.mEnumCount > 0 && mAttrEnum < info.mEnumCount, "mapping request for a non-attrib enum"); return info.mEnumInfo[mAttrEnum].mMapping; } nsresult nsSVGEnum::SetBaseValueString(const nsAString& aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { nsCOMPtr<nsIAtom> valAtom = do_GetAtom(aValue); nsSVGEnumMapping *mapping = GetMapping(aSVGElement); while (mapping && mapping->mKey) { if (valAtom == *(mapping->mKey)) { mIsBaseSet = PR_TRUE; @@ -116,35 +115,34 @@ nsSVGEnum::GetBaseValueString(nsAString& } mapping++; } NS_ERROR("unknown enumeration value"); } nsresult nsSVGEnum::SetBaseValue(PRUint16 aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { nsSVGEnumMapping *mapping = GetMapping(aSVGElement); while (mapping && mapping->mKey) { if (mapping->mVal == aValue) { mIsBaseSet = PR_TRUE; if (mBaseVal != PRUint8(aValue)) { mBaseVal = PRUint8(aValue); if (!mIsAnimated) { mAnimVal = mBaseVal; } #ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } #endif - aSVGElement->DidChangeEnum(mAttrEnum, aDoSetAttr); + aSVGElement->DidChangeEnum(mAttrEnum, true); } return NS_OK; } mapping++; } return NS_ERROR_DOM_SYNTAX_ERR; }
--- a/content/svg/content/src/nsSVGEnum.h +++ b/content/svg/content/src/nsSVGEnum.h @@ -54,24 +54,22 @@ public: void Init(PRUint8 aAttrEnum, PRUint16 aValue) { mAnimVal = mBaseVal = PRUint8(aValue); mAttrEnum = aAttrEnum; mIsAnimated = PR_FALSE; mIsBaseSet = PR_FALSE; } nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr); + nsSVGElement *aSVGElement); void GetBaseValueString(nsAString& aValue, nsSVGElement *aSVGElement); nsresult SetBaseValue(PRUint16 aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr); + nsSVGElement *aSVGElement); PRUint16 GetBaseValue() const { return mBaseVal; } void SetAnimValue(PRUint16 aValue, nsSVGElement *aSVGElement); PRUint16 GetAnimValue() const { return mAnimVal; } bool IsExplicitlySet() const { return mIsAnimated || mIsBaseSet; } @@ -102,17 +100,17 @@ public: : mVal(aVal), mSVGElement(aSVGElement) {} nsSVGEnum *mVal; // kept alive because it belongs to content nsRefPtr<nsSVGElement> mSVGElement; NS_IMETHOD GetBaseVal(PRUint16* aResult) { *aResult = mVal->GetBaseValue(); return NS_OK; } NS_IMETHOD SetBaseVal(PRUint16 aValue) - { return mVal->SetBaseValue(aValue, mSVGElement, PR_TRUE); } + { return mVal->SetBaseValue(aValue, mSVGElement); } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(PRUint16* aResult) { #ifdef MOZ_SMIL mSVGElement->FlushAnimations(); #endif
--- a/content/svg/content/src/nsSVGFilterElement.cpp +++ b/content/svg/content/src/nsSVGFilterElement.cpp @@ -156,17 +156,17 @@ NS_IMETHODIMP nsSVGFilterElement::GetFil this); } /* void setFilterRes (in unsigned long filterResX, in unsigned long filterResY); */ NS_IMETHODIMP nsSVGFilterElement::SetFilterRes(PRUint32 filterResX, PRUint32 filterResY) { - mIntegerPairAttributes[FILTERRES].SetBaseValues(filterResX, filterResY, this, PR_FALSE); + mIntegerPairAttributes[FILTERRES].SetBaseValues(filterResX, filterResY, this); return NS_OK; } //---------------------------------------------------------------------- // nsIDOMSVGURIReference methods /* readonly attribute nsIDOMSVGAnimatedString href; */ NS_IMETHODIMP
--- a/content/svg/content/src/nsSVGFilters.cpp +++ b/content/svg/content/src/nsSVGFilters.cpp @@ -507,17 +507,17 @@ NS_IMETHODIMP nsSVGFEGaussianBlurElement { return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(aY, nsSVGNumberPair::eSecond, this); } NS_IMETHODIMP nsSVGFEGaussianBlurElement::SetStdDeviation(float stdDeviationX, float stdDeviationY) { NS_ENSURE_FINITE2(stdDeviationX, stdDeviationY, NS_ERROR_ILLEGAL_VALUE); - mNumberPairAttributes[STD_DEV].SetBaseValues(stdDeviationX, stdDeviationY, this, PR_TRUE); + mNumberPairAttributes[STD_DEV].SetBaseValues(stdDeviationX, stdDeviationY, this); return NS_OK; } /** * We want to speed up 1/N integer divisions --- integer division is * often rather slow. * We know that our input numerators V are constrained to be <= 255*N, * so the result of dividing by N always fits in 8 bits. @@ -1521,20 +1521,20 @@ NS_IMETHODIMP nsSVGFECompositeElement::G { return mNumberAttributes[K4].ToDOMAnimatedNumber(aK4, this); } NS_IMETHODIMP nsSVGFECompositeElement::SetK(float k1, float k2, float k3, float k4) { NS_ENSURE_FINITE4(k1, k2, k3, k4, NS_ERROR_ILLEGAL_VALUE); - mNumberAttributes[K1].SetBaseValue(k1, this, PR_TRUE); - mNumberAttributes[K2].SetBaseValue(k2, this, PR_TRUE); - mNumberAttributes[K3].SetBaseValue(k3, this, PR_TRUE); - mNumberAttributes[K4].SetBaseValue(k4, this, PR_TRUE); + mNumberAttributes[K1].SetBaseValue(k1, this); + mNumberAttributes[K2].SetBaseValue(k2, this); + mNumberAttributes[K3].SetBaseValue(k3, this); + mNumberAttributes[K4].SetBaseValue(k4, this); return NS_OK; } nsresult nsSVGFECompositeElement::Filter(nsSVGFilterInstance *instance, const nsTArray<const Image*>& aSources, const Image* aTarget, const nsIntRect& rect) @@ -3642,17 +3642,17 @@ NS_IMETHODIMP nsSVGFEMorphologyElement:: { return mNumberPairAttributes[RADIUS].ToDOMAnimatedNumber(aY, nsSVGNumberPair::eSecond, this); } NS_IMETHODIMP nsSVGFEMorphologyElement::SetRadius(float rx, float ry) { NS_ENSURE_FINITE2(rx, ry, NS_ERROR_ILLEGAL_VALUE); - mNumberPairAttributes[RADIUS].SetBaseValues(rx, ry, this, PR_TRUE); + mNumberPairAttributes[RADIUS].SetBaseValues(rx, ry, this); return NS_OK; } void nsSVGFEMorphologyElement::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) { aSources.AppendElement(nsSVGStringInfo(&mStringAttributes[IN1], this)); }
--- a/content/svg/content/src/nsSVGInteger.cpp +++ b/content/svg/content/src/nsSVGInteger.cpp @@ -75,18 +75,17 @@ GetValueFromString(const nsAString &aVal if (*rest == '\0') { return NS_OK; } return NS_ERROR_DOM_SYNTAX_ERR; } nsresult nsSVGInteger::SetBaseValueString(const nsAString &aValueAsString, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { PRInt32 value; nsresult rv = GetValueFromString(aValueAsString, &value); if (NS_FAILED(rv)) { return rv; } @@ -107,30 +106,29 @@ void nsSVGInteger::GetBaseValueString(nsAString & aValueAsString) { aValueAsString.Truncate(); aValueAsString.AppendInt(mBaseVal); } void nsSVGInteger::SetBaseValue(int aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { mBaseVal = aValue; mIsBaseSet = PR_TRUE; if (!mIsAnimated) { mAnimVal = mBaseVal; } #ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } #endif - aSVGElement->DidChangeInteger(mAttrEnum, aDoSetAttr); + aSVGElement->DidChangeInteger(mAttrEnum, true); } void nsSVGInteger::SetAnimValue(int aValue, nsSVGElement *aSVGElement) { mAnimVal = aValue; mIsAnimated = PR_TRUE; aSVGElement->DidAnimateInteger(mAttrEnum);
--- a/content/svg/content/src/nsSVGInteger.h +++ b/content/svg/content/src/nsSVGInteger.h @@ -48,21 +48,20 @@ public: void Init(PRUint8 aAttrEnum = 0xff, PRInt32 aValue = 0) { mAnimVal = mBaseVal = aValue; mAttrEnum = aAttrEnum; mIsAnimated = PR_FALSE; mIsBaseSet = PR_FALSE; } nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr); + nsSVGElement *aSVGElement); void GetBaseValueString(nsAString& aValue); - void SetBaseValue(PRInt32 aValue, nsSVGElement *aSVGElement, bool aDoSetAttr); + void SetBaseValue(PRInt32 aValue, nsSVGElement *aSVGElement); PRInt32 GetBaseValue() const { return mBaseVal; } void SetAnimValue(int aValue, nsSVGElement *aSVGElement); int GetAnimValue() const { return mAnimVal; } // Returns PR_TRUE if the animated value of this integer has been explicitly @@ -98,17 +97,17 @@ public: : mVal(aVal), mSVGElement(aSVGElement) {} nsSVGInteger* mVal; // kept alive because it belongs to content nsRefPtr<nsSVGElement> mSVGElement; NS_IMETHOD GetBaseVal(PRInt32* aResult) { *aResult = mVal->GetBaseValue(); return NS_OK; } NS_IMETHOD SetBaseVal(PRInt32 aValue) - { mVal->SetBaseValue(aValue, mSVGElement, PR_TRUE); return NS_OK; } + { mVal->SetBaseValue(aValue, mSVGElement); return NS_OK; } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(PRInt32* aResult) { #ifdef MOZ_SMIL mSVGElement->FlushAnimations(); #endif
--- a/content/svg/content/src/nsSVGIntegerPair.cpp +++ b/content/svg/content/src/nsSVGIntegerPair.cpp @@ -97,18 +97,17 @@ ParseIntegerOptionalInteger(const nsAStr return NS_ERROR_DOM_SYNTAX_ERR; } return NS_OK; } nsresult nsSVGIntegerPair::SetBaseValueString(const nsAString &aValueAsString, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { PRInt32 val[2]; nsresult rv = ParseIntegerOptionalInteger(aValueAsString, val); if (NS_FAILED(rv)) { return rv; } @@ -140,51 +139,49 @@ nsSVGIntegerPair::GetBaseValueString(nsA if (mBaseVal[0] != mBaseVal[1]) { aValueAsString.AppendLiteral(", "); aValueAsString.AppendInt(mBaseVal[1]); } } void nsSVGIntegerPair::SetBaseValue(PRInt32 aValue, PairIndex aPairIndex, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { PRUint32 index = (aPairIndex == eFirst ? 0 : 1); mBaseVal[index] = aValue; mIsBaseSet = PR_TRUE; if (!mIsAnimated) { mAnimVal[index] = aValue; } #ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } #endif - aSVGElement->DidChangeIntegerPair(mAttrEnum, aDoSetAttr); + aSVGElement->DidChangeIntegerPair(mAttrEnum, true); } void nsSVGIntegerPair::SetBaseValues(PRInt32 aValue1, PRInt32 aValue2, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { mBaseVal[0] = aValue1; mBaseVal[1] = aValue2; mIsBaseSet = PR_TRUE; if (!mIsAnimated) { mAnimVal[0] = aValue1; mAnimVal[1] = aValue2; } #ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } #endif - aSVGElement->DidChangeIntegerPair(mAttrEnum, aDoSetAttr); + aSVGElement->DidChangeIntegerPair(mAttrEnum, true); } void nsSVGIntegerPair::SetAnimValue(const PRInt32 aValue[2], nsSVGElement *aSVGElement) { mAnimVal[0] = aValue[0]; mAnimVal[1] = aValue[1]; mIsAnimated = PR_TRUE;
--- a/content/svg/content/src/nsSVGIntegerPair.h +++ b/content/svg/content/src/nsSVGIntegerPair.h @@ -60,22 +60,21 @@ public: mAnimVal[0] = mBaseVal[0] = aValue1; mAnimVal[1] = mBaseVal[1] = aValue2; mAttrEnum = aAttrEnum; mIsAnimated = PR_FALSE; mIsBaseSet = PR_FALSE; } nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr); + nsSVGElement *aSVGElement); void GetBaseValueString(nsAString& aValue); - void SetBaseValue(PRInt32 aValue, PairIndex aIndex, nsSVGElement *aSVGElement, bool aDoSetAttr); - void SetBaseValues(PRInt32 aValue1, PRInt32 aValue2, nsSVGElement *aSVGElement, bool aDoSetAttr); + void SetBaseValue(PRInt32 aValue, PairIndex aIndex, nsSVGElement *aSVGElement); + void SetBaseValues(PRInt32 aValue1, PRInt32 aValue2, nsSVGElement *aSVGElement); PRInt32 GetBaseValue(PairIndex aIndex) const { return mBaseVal[aIndex == eFirst ? 0 : 1]; } void SetAnimValue(const PRInt32 aValue[2], nsSVGElement *aSVGElement); PRInt32 GetAnimValue(PairIndex aIndex) const { return mAnimVal[aIndex == eFirst ? 0 : 1]; } // Returns PR_TRUE if the animated value of this integer has been explicitly // set (either by animation, or by taking on the base value which has been @@ -113,17 +112,17 @@ public: nsSVGIntegerPair* mVal; // kept alive because it belongs to content nsRefPtr<nsSVGElement> mSVGElement; PairIndex mIndex; // are we the first or second integer NS_IMETHOD GetBaseVal(PRInt32* aResult) { *aResult = mVal->GetBaseValue(mIndex); return NS_OK; } NS_IMETHOD SetBaseVal(PRInt32 aValue) { - mVal->SetBaseValue(aValue, mIndex, mSVGElement, PR_TRUE); + mVal->SetBaseValue(aValue, mIndex, mSVGElement); return NS_OK; } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(PRInt32* aResult) { #ifdef MOZ_SMIL
--- a/content/svg/content/src/nsSVGNumber2.cpp +++ b/content/svg/content/src/nsSVGNumber2.cpp @@ -111,18 +111,17 @@ GetValueFromString(const nsAString &aVal if (*rest == '\0') { return NS_OK; } return NS_ERROR_DOM_SYNTAX_ERR; } nsresult nsSVGNumber2::SetBaseValueString(const nsAString &aValueAsString, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { float val; nsresult rv = GetValueFromString( aValueAsString, aSVGElement->NumberAttrAllowsPercentage(mAttrEnum), &val); if (NS_FAILED(rv)) { return rv; @@ -149,30 +148,29 @@ void nsSVGNumber2::GetBaseValueString(nsAString & aValueAsString) { aValueAsString.Truncate(); aValueAsString.AppendFloat(mBaseVal); } void nsSVGNumber2::SetBaseValue(float aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { mBaseVal = aValue; mIsBaseSet = PR_TRUE; if (!mIsAnimated) { mAnimVal = mBaseVal; } #ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } #endif - aSVGElement->DidChangeNumber(mAttrEnum, aDoSetAttr); + aSVGElement->DidChangeNumber(mAttrEnum, true); } void nsSVGNumber2::SetAnimValue(float aValue, nsSVGElement *aSVGElement) { mAnimVal = aValue; mIsAnimated = PR_TRUE; aSVGElement->DidAnimateNumber(mAttrEnum);
--- a/content/svg/content/src/nsSVGNumber2.h +++ b/content/svg/content/src/nsSVGNumber2.h @@ -56,21 +56,20 @@ public: void Init(PRUint8 aAttrEnum = 0xff, float aValue = 0) { mAnimVal = mBaseVal = aValue; mAttrEnum = aAttrEnum; mIsAnimated = PR_FALSE; mIsBaseSet = PR_FALSE; } nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr); + nsSVGElement *aSVGElement); void GetBaseValueString(nsAString& aValue); - void SetBaseValue(float aValue, nsSVGElement *aSVGElement, bool aDoSetAttr); + void SetBaseValue(float aValue, nsSVGElement *aSVGElement); float GetBaseValue() const { return mBaseVal; } void SetAnimValue(float aValue, nsSVGElement *aSVGElement); float GetAnimValue() const { return mAnimVal; } // Returns PR_TRUE if the animated value of this number has been explicitly // set (either by animation, or by taking on the base value which has been @@ -109,17 +108,17 @@ public: NS_IMETHOD GetBaseVal(float* aResult) { *aResult = mVal->GetBaseValue(); return NS_OK; } NS_IMETHOD SetBaseVal(float aValue) { if (!NS_finite(aValue)) { return NS_ERROR_ILLEGAL_VALUE; } - mVal->SetBaseValue(aValue, mSVGElement, PR_TRUE); + mVal->SetBaseValue(aValue, mSVGElement); return NS_OK; } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(float* aResult) { #ifdef MOZ_SMIL
--- a/content/svg/content/src/nsSVGNumberPair.cpp +++ b/content/svg/content/src/nsSVGNumberPair.cpp @@ -98,18 +98,17 @@ ParseNumberOptionalNumber(const nsAStrin return NS_ERROR_DOM_SYNTAX_ERR; } return NS_OK; } nsresult nsSVGNumberPair::SetBaseValueString(const nsAString &aValueAsString, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { float val[2]; nsresult rv = ParseNumberOptionalNumber(aValueAsString, val); if (NS_FAILED(rv)) { return rv; } @@ -140,51 +139,49 @@ nsSVGNumberPair::GetBaseValueString(nsAS if (mBaseVal[0] != mBaseVal[1]) { aValueAsString.AppendLiteral(", "); aValueAsString.AppendFloat(mBaseVal[1]); } } void nsSVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { PRUint32 index = (aPairIndex == eFirst ? 0 : 1); mBaseVal[index] = aValue; mIsBaseSet = PR_TRUE; if (!mIsAnimated) { mAnimVal[index] = aValue; } #ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } #endif - aSVGElement->DidChangeNumberPair(mAttrEnum, aDoSetAttr); + aSVGElement->DidChangeNumberPair(mAttrEnum, true); } void nsSVGNumberPair::SetBaseValues(float aValue1, float aValue2, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { mBaseVal[0] = aValue1; mBaseVal[1] = aValue2; mIsBaseSet = PR_TRUE; if (!mIsAnimated) { mAnimVal[0] = aValue1; mAnimVal[1] = aValue2; } #ifdef MOZ_SMIL else { aSVGElement->AnimationNeedsResample(); } #endif - aSVGElement->DidChangeNumberPair(mAttrEnum, aDoSetAttr); + aSVGElement->DidChangeNumberPair(mAttrEnum, true); } void nsSVGNumberPair::SetAnimValue(const float aValue[2], nsSVGElement *aSVGElement) { mAnimVal[0] = aValue[0]; mAnimVal[1] = aValue[1]; mIsAnimated = PR_TRUE;
--- a/content/svg/content/src/nsSVGNumberPair.h +++ b/content/svg/content/src/nsSVGNumberPair.h @@ -62,22 +62,21 @@ public: mAnimVal[0] = mBaseVal[0] = aValue1; mAnimVal[1] = mBaseVal[1] = aValue2; mAttrEnum = aAttrEnum; mIsAnimated = PR_FALSE; mIsBaseSet = PR_FALSE; } nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr); + nsSVGElement *aSVGElement); void GetBaseValueString(nsAString& aValue); - void SetBaseValue(float aValue, PairIndex aIndex, nsSVGElement *aSVGElement, bool aDoSetAttr); - void SetBaseValues(float aValue1, float aValue2, nsSVGElement *aSVGElement, bool aDoSetAttr); + void SetBaseValue(float aValue, PairIndex aIndex, nsSVGElement *aSVGElement); + void SetBaseValues(float aValue1, float aValue2, nsSVGElement *aSVGElement); float GetBaseValue(PairIndex aIndex) const { return mBaseVal[aIndex == eFirst ? 0 : 1]; } void SetAnimValue(const float aValue[2], nsSVGElement *aSVGElement); float GetAnimValue(PairIndex aIndex) const { return mAnimVal[aIndex == eFirst ? 0 : 1]; } // Returns PR_TRUE if the animated value of this number has been explicitly // set (either by animation, or by taking on the base value which has been @@ -118,17 +117,17 @@ public: NS_IMETHOD GetBaseVal(float* aResult) { *aResult = mVal->GetBaseValue(mIndex); return NS_OK; } NS_IMETHOD SetBaseVal(float aValue) { if (!NS_finite(aValue)) { return NS_ERROR_ILLEGAL_VALUE; } - mVal->SetBaseValue(aValue, mIndex, mSVGElement, PR_TRUE); + mVal->SetBaseValue(aValue, mIndex, mSVGElement); return NS_OK; } // Script may have modified animation parameters or timeline -- DOM getters // need to flush any resample requests to reflect these modifications. NS_IMETHOD GetAnimVal(float* aResult) { #ifdef MOZ_SMIL
--- a/content/svg/content/src/nsSVGSVGElement.cpp +++ b/content/svg/content/src/nsSVGSVGElement.cpp @@ -799,17 +799,17 @@ nsSVGSVGElement::GetZoomAndPan(PRUint16 return NS_OK; } NS_IMETHODIMP nsSVGSVGElement::SetZoomAndPan(PRUint16 aZoomAndPan) { if (aZoomAndPan == nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_DISABLE || aZoomAndPan == nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY) { - mEnumAttributes[ZOOMANDPAN].SetBaseValue(aZoomAndPan, this, PR_TRUE); + mEnumAttributes[ZOOMANDPAN].SetBaseValue(aZoomAndPan, this); return NS_OK; } return NS_ERROR_DOM_SVG_INVALID_VALUE_ERR; } //---------------------------------------------------------------------- // helper methods for implementing SVGZoomEvent:
--- a/content/svg/content/src/nsSVGViewBox.cpp +++ b/content/svg/content/src/nsSVGViewBox.cpp @@ -122,22 +122,22 @@ nsSVGViewBox::SetAnimValue(float aX, flo mAnimVal->width = aWidth; mAnimVal->height = aHeight; } aSVGElement->DidAnimateViewBox(); } void nsSVGViewBox::SetBaseValue(float aX, float aY, float aWidth, float aHeight, - nsSVGElement *aSVGElement, bool aDoSetAttr) + nsSVGElement *aSVGElement) { mBaseVal = nsSVGViewBoxRect(aX, aY, aWidth, aHeight); mHasBaseVal = PR_TRUE; - aSVGElement->DidChangeViewBox(aDoSetAttr); + aSVGElement->DidChangeViewBox(true); #ifdef MOZ_SMIL if (mAnimVal) { aSVGElement->AnimationNeedsResample(); } #endif } static nsresult @@ -173,23 +173,32 @@ ToSVGViewBoxRect(const nsAString& aStr, aViewBox->width = vals[2]; aViewBox->height = vals[3]; return NS_OK; } nsresult nsSVGViewBox::SetBaseValueString(const nsAString& aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr) + nsSVGElement *aSVGElement) { nsSVGViewBoxRect viewBox; nsresult res = ToSVGViewBoxRect(aValue, &viewBox); if (NS_SUCCEEDED(res)) { - SetBaseValue(viewBox.x, viewBox.y, viewBox.width, viewBox.height, aSVGElement, aDoSetAttr); + mBaseVal = nsSVGViewBoxRect(viewBox.x, viewBox.y, viewBox.width, viewBox.height); + mHasBaseVal = PR_TRUE; + +#ifdef MOZ_SMIL + if (mAnimVal) { + aSVGElement->AnimationNeedsResample(); + } +#endif + // We don't need to call DidChange* here - we're only called by + // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr, + // which takes care of notifying. } return res; } void nsSVGViewBox::GetBaseValueString(nsAString& aValue) const { PRUnichar buf[200]; @@ -232,47 +241,47 @@ nsSVGViewBox::DOMAnimatedRect::GetAnimVa } NS_IMETHODIMP nsSVGViewBox::DOMBaseVal::SetX(float aX) { nsSVGViewBoxRect rect = mVal->GetBaseValue(); rect.x = aX; mVal->SetBaseValue(rect.x, rect.y, rect.width, rect.height, - mSVGElement, PR_TRUE); + mSVGElement); return NS_OK; } NS_IMETHODIMP nsSVGViewBox::DOMBaseVal::SetY(float aY) { nsSVGViewBoxRect rect = mVal->GetBaseValue(); rect.y = aY; mVal->SetBaseValue(rect.x, rect.y, rect.width, rect.height, - mSVGElement, PR_TRUE); + mSVGElement); return NS_OK; } NS_IMETHODIMP nsSVGViewBox::DOMBaseVal::SetWidth(float aWidth) { nsSVGViewBoxRect rect = mVal->GetBaseValue(); rect.width = aWidth; mVal->SetBaseValue(rect.x, rect.y, rect.width, rect.height, - mSVGElement, PR_TRUE); + mSVGElement); return NS_OK; } NS_IMETHODIMP nsSVGViewBox::DOMBaseVal::SetHeight(float aHeight) { nsSVGViewBoxRect rect = mVal->GetBaseValue(); rect.height = aHeight; mVal->SetBaseValue(rect.x, rect.y, rect.width, rect.height, - mSVGElement, PR_TRUE); + mSVGElement); return NS_OK; } #ifdef MOZ_SMIL nsISMILAttr* nsSVGViewBox::ToSMILAttr(nsSVGElement *aSVGElement) { return new SMILViewBox(this, aSVGElement);
--- a/content/svg/content/src/nsSVGViewBox.h +++ b/content/svg/content/src/nsSVGViewBox.h @@ -66,26 +66,25 @@ public: // Used by element to tell if viewBox is defined bool IsValid() const { return (mHasBaseVal || mAnimVal); } const nsSVGViewBoxRect& GetBaseValue() const { return mBaseVal; } void SetBaseValue(float aX, float aY, float aWidth, float aHeight, - nsSVGElement *aSVGElement, bool aDoSetAttr); + nsSVGElement *aSVGElement); const nsSVGViewBoxRect& GetAnimValue() const { return mAnimVal ? *mAnimVal : mBaseVal; } void SetAnimValue(float aX, float aY, float aWidth, float aHeight, nsSVGElement *aSVGElement); nsresult SetBaseValueString(const nsAString& aValue, - nsSVGElement *aSVGElement, - bool aDoSetAttr); + nsSVGElement *aSVGElement); void GetBaseValueString(nsAString& aValue) const; nsresult ToDOMAnimatedRect(nsIDOMSVGAnimatedRect **aResult, nsSVGElement *aSVGElement); #ifdef MOZ_SMIL // Returns a new nsISMILAttr object that the caller must delete nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement); #endif // MOZ_SMIL