зеркало из https://github.com/mozilla/gecko-dev.git
Bug 691298 - Remove aDoSetAttr arguments where callers always pass the same value. r=dholbert
This commit is contained in:
Родитель
0fde91f155
Коммит
dddc0cfe59
|
@ -226,9 +226,7 @@ ToPreserveAspectRatio(const nsAString &aString,
|
|||
|
||||
nsresult
|
||||
SVGAnimatedPreserveAspectRatio::SetBaseValueString(
|
||||
const nsAString &aValueAsString,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
const nsAString &aValueAsString, nsSVGElement *aSVGElement)
|
||||
{
|
||||
SVGPreserveAspectRatio val;
|
||||
nsresult res = ToPreserveAspectRatio(aValueAsString, &val);
|
||||
|
@ -247,7 +245,9 @@ SVGAnimatedPreserveAspectRatio::SetBaseValueString(
|
|||
}
|
||||
#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;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,8 +110,7 @@ public:
|
|||
}
|
||||
|
||||
nsresult SetBaseValueString(const nsAString& aValue,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr);
|
||||
nsSVGElement *aSVGElement);
|
||||
void GetBaseValueString(nsAString& aValue);
|
||||
|
||||
nsresult SetBaseAlign(PRUint16 aAlign, nsSVGElement *aSVGElement);
|
||||
|
|
|
@ -74,8 +74,7 @@ GetValueFromString(const nsAString &aValueAsString,
|
|||
|
||||
nsresult
|
||||
nsSVGBoolean::SetBaseValueString(const nsAString &aValueAsString,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
bool val;
|
||||
|
||||
|
|
|
@ -52,8 +52,7 @@ public:
|
|||
}
|
||||
|
||||
nsresult SetBaseValueString(const nsAString& aValue,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr);
|
||||
nsSVGElement *aSVGElement);
|
||||
void GetBaseValueString(nsAString& aValue);
|
||||
|
||||
void SetBaseValue(bool aValue, nsSVGElement *aSVGElement);
|
||||
|
|
|
@ -382,7 +382,7 @@ nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
|
|||
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);
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
|
|||
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);
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
|
|||
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);
|
||||
}
|
||||
|
@ -427,7 +427,7 @@ nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
|
|||
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);
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
|
|||
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);
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
|
|||
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);
|
||||
}
|
||||
|
@ -487,7 +487,7 @@ nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
|
|||
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();
|
||||
}
|
||||
|
@ -498,7 +498,7 @@ nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
|
|||
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
|
||||
GetPreserveAspectRatio();
|
||||
if (preserveAspectRatio) {
|
||||
rv = preserveAspectRatio->SetBaseValueString(aValue, this, PR_FALSE);
|
||||
rv = preserveAspectRatio->SetBaseValueString(aValue, this);
|
||||
if (NS_FAILED(rv)) {
|
||||
preserveAspectRatio->Init();
|
||||
}
|
||||
|
|
|
@ -70,8 +70,7 @@ nsSVGEnum::GetMapping(nsSVGElement *aSVGElement)
|
|||
|
||||
nsresult
|
||||
nsSVGEnum::SetBaseValueString(const nsAString& aValue,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
nsCOMPtr<nsIAtom> valAtom = do_GetAtom(aValue);
|
||||
|
||||
|
@ -121,8 +120,7 @@ nsSVGEnum::GetBaseValueString(nsAString& aValue, nsSVGElement *aSVGElement)
|
|||
|
||||
nsresult
|
||||
nsSVGEnum::SetBaseValue(PRUint16 aValue,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
nsSVGEnumMapping *mapping = GetMapping(aSVGElement);
|
||||
|
||||
|
@ -139,7 +137,7 @@ nsSVGEnum::SetBaseValue(PRUint16 aValue,
|
|||
aSVGElement->AnimationNeedsResample();
|
||||
}
|
||||
#endif
|
||||
aSVGElement->DidChangeEnum(mAttrEnum, aDoSetAttr);
|
||||
aSVGElement->DidChangeEnum(mAttrEnum, true);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -59,14 +59,12 @@ public:
|
|||
}
|
||||
|
||||
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; }
|
||||
|
||||
|
@ -107,7 +105,7 @@ public:
|
|||
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.
|
||||
|
|
|
@ -161,7 +161,7 @@ NS_IMETHODIMP nsSVGFilterElement::GetFilterResY(nsIDOMSVGAnimatedInteger * *aFil
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -512,7 +512,7 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -1526,10 +1526,10 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -3647,7 +3647,7 @@ 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,8 +80,7 @@ GetValueFromString(const nsAString &aValueAsString,
|
|||
|
||||
nsresult
|
||||
nsSVGInteger::SetBaseValueString(const nsAString &aValueAsString,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
PRInt32 value;
|
||||
|
||||
|
@ -112,8 +111,7 @@ nsSVGInteger::GetBaseValueString(nsAString & aValueAsString)
|
|||
|
||||
void
|
||||
nsSVGInteger::SetBaseValue(int aValue,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
mBaseVal = aValue;
|
||||
mIsBaseSet = PR_TRUE;
|
||||
|
@ -125,7 +123,7 @@ nsSVGInteger::SetBaseValue(int aValue,
|
|||
aSVGElement->AnimationNeedsResample();
|
||||
}
|
||||
#endif
|
||||
aSVGElement->DidChangeInteger(mAttrEnum, aDoSetAttr);
|
||||
aSVGElement->DidChangeInteger(mAttrEnum, true);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -53,11 +53,10 @@ public:
|
|||
}
|
||||
|
||||
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; }
|
||||
|
||||
|
@ -103,7 +102,7 @@ public:
|
|||
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.
|
||||
|
|
|
@ -102,8 +102,7 @@ ParseIntegerOptionalInteger(const nsAString& aValue,
|
|||
|
||||
nsresult
|
||||
nsSVGIntegerPair::SetBaseValueString(const nsAString &aValueAsString,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
PRInt32 val[2];
|
||||
|
||||
|
@ -145,8 +144,7 @@ nsSVGIntegerPair::GetBaseValueString(nsAString &aValueAsString)
|
|||
|
||||
void
|
||||
nsSVGIntegerPair::SetBaseValue(PRInt32 aValue, PairIndex aPairIndex,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
PRUint32 index = (aPairIndex == eFirst ? 0 : 1);
|
||||
mBaseVal[index] = aValue;
|
||||
|
@ -159,13 +157,12 @@ nsSVGIntegerPair::SetBaseValue(PRInt32 aValue, PairIndex aPairIndex,
|
|||
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;
|
||||
|
@ -179,7 +176,7 @@ nsSVGIntegerPair::SetBaseValues(PRInt32 aValue1, PRInt32 aValue2,
|
|||
aSVGElement->AnimationNeedsResample();
|
||||
}
|
||||
#endif
|
||||
aSVGElement->DidChangeIntegerPair(mAttrEnum, aDoSetAttr);
|
||||
aSVGElement->DidChangeIntegerPair(mAttrEnum, true);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -65,12 +65,11 @@ public:
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -118,7 +117,7 @@ public:
|
|||
{ *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;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,8 +116,7 @@ GetValueFromString(const nsAString &aValueAsString,
|
|||
|
||||
nsresult
|
||||
nsSVGNumber2::SetBaseValueString(const nsAString &aValueAsString,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
float val;
|
||||
|
||||
|
@ -154,8 +153,7 @@ nsSVGNumber2::GetBaseValueString(nsAString & aValueAsString)
|
|||
|
||||
void
|
||||
nsSVGNumber2::SetBaseValue(float aValue,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
mBaseVal = aValue;
|
||||
mIsBaseSet = PR_TRUE;
|
||||
|
@ -167,7 +165,7 @@ nsSVGNumber2::SetBaseValue(float aValue,
|
|||
aSVGElement->AnimationNeedsResample();
|
||||
}
|
||||
#endif
|
||||
aSVGElement->DidChangeNumber(mAttrEnum, aDoSetAttr);
|
||||
aSVGElement->DidChangeNumber(mAttrEnum, true);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -61,11 +61,10 @@ public:
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -114,7 +113,7 @@ public:
|
|||
if (!NS_finite(aValue)) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
mVal->SetBaseValue(aValue, mSVGElement, PR_TRUE);
|
||||
mVal->SetBaseValue(aValue, mSVGElement);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,8 +103,7 @@ ParseNumberOptionalNumber(const nsAString& aValue,
|
|||
|
||||
nsresult
|
||||
nsSVGNumberPair::SetBaseValueString(const nsAString &aValueAsString,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
float val[2];
|
||||
|
||||
|
@ -145,8 +144,7 @@ nsSVGNumberPair::GetBaseValueString(nsAString &aValueAsString)
|
|||
|
||||
void
|
||||
nsSVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr)
|
||||
nsSVGElement *aSVGElement)
|
||||
{
|
||||
PRUint32 index = (aPairIndex == eFirst ? 0 : 1);
|
||||
mBaseVal[index] = aValue;
|
||||
|
@ -159,13 +157,12 @@ nsSVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex,
|
|||
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;
|
||||
|
@ -179,7 +176,7 @@ nsSVGNumberPair::SetBaseValues(float aValue1, float aValue2,
|
|||
aSVGElement->AnimationNeedsResample();
|
||||
}
|
||||
#endif
|
||||
aSVGElement->DidChangeNumberPair(mAttrEnum, aDoSetAttr);
|
||||
aSVGElement->DidChangeNumberPair(mAttrEnum, true);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -67,12 +67,11 @@ public:
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -123,7 +122,7 @@ public:
|
|||
if (!NS_finite(aValue)) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
mVal->SetBaseValue(aValue, mIndex, mSVGElement, PR_TRUE);
|
||||
mVal->SetBaseValue(aValue, mIndex, mSVGElement);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -804,7 +804,7 @@ 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -127,12 +127,12 @@ nsSVGViewBox::SetAnimValue(float aX, float aY, float aWidth, float aHeight,
|
|||
|
||||
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();
|
||||
|
@ -178,13 +178,22 @@ ToSVGViewBoxRect(const nsAString& aStr, nsSVGViewBoxRect *aViewBox)
|
|||
|
||||
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;
|
||||
}
|
||||
|
@ -237,7 +246,7 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -247,7 +256,7 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -257,7 +266,7 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -267,7 +276,7 @@ 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
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; }
|
||||
|
@ -79,8 +79,7 @@ public:
|
|||
nsSVGElement *aSVGElement);
|
||||
|
||||
nsresult SetBaseValueString(const nsAString& aValue,
|
||||
nsSVGElement *aSVGElement,
|
||||
bool aDoSetAttr);
|
||||
nsSVGElement *aSVGElement);
|
||||
void GetBaseValueString(nsAString& aValue) const;
|
||||
|
||||
nsresult ToDOMAnimatedRect(nsIDOMSVGAnimatedRect **aResult,
|
||||
|
|
Загрузка…
Ссылка в новой задаче