зеркало из https://github.com/mozilla/gecko-dev.git
Bug 616362 - do not set aPreventCachingOfSandwich to false in methods that override SMILAttr::ValueFromString r=emilio
Currently SMILAnimationFunction::ParseAttr only sets its aPreventCachingOfSandwich outparam when it needs to be set to true. (This lets us pass the same initially-false outparam into ParseAttr multiple times, and then check it for trueness at the end to see if any of the parsed values need us to prevent caching the sandwich.) Our impls for ISMILAttr::ValueFromString should behave like that, too. Then, we can pass ParseAttr's outparam directly to ValueFromString. Differential Revision: https://phabricator.services.mozilla.com/D174353
This commit is contained in:
Родитель
13e51277df
Коммит
f543d3efcd
|
@ -675,14 +675,9 @@ bool SMILAnimationFunction::ParseAttr(nsAtom* aAttName,
|
|||
bool& aPreventCachingOfSandwich) const {
|
||||
nsAutoString attValue;
|
||||
if (GetAttr(aAttName, attValue)) {
|
||||
bool preventCachingOfSandwich = false;
|
||||
nsresult rv = aSMILAttr.ValueFromString(attValue, mAnimationElement,
|
||||
aResult, preventCachingOfSandwich);
|
||||
aResult, aPreventCachingOfSandwich);
|
||||
if (NS_FAILED(rv)) return false;
|
||||
|
||||
if (preventCachingOfSandwich) {
|
||||
aPreventCachingOfSandwich = true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -502,17 +502,13 @@ class MOZ_STACK_CLASS SMILValueParser
|
|||
|
||||
bool Parse(const nsAString& aValueStr) override {
|
||||
SMILValue newValue;
|
||||
bool tmpPreventCachingOfSandwich = false;
|
||||
if (NS_FAILED(mSMILAttr->ValueFromString(aValueStr, mSrcElement, newValue,
|
||||
tmpPreventCachingOfSandwich)))
|
||||
*mPreventCachingOfSandwich)))
|
||||
return false;
|
||||
|
||||
if (!mValuesArray->AppendElement(newValue, fallible)) {
|
||||
return false;
|
||||
}
|
||||
if (tmpPreventCachingOfSandwich) {
|
||||
*mPreventCachingOfSandwich = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -155,7 +155,6 @@ nsresult SVGAnimatedBoolean::SMILBool::ValueFromString(
|
|||
SMILValue val(SMILBoolType::Singleton());
|
||||
val.mU.mBool = value;
|
||||
aValue = val;
|
||||
aPreventCachingOfSandwich = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -67,7 +67,6 @@ nsresult SVGAnimatedClass::SMILString::ValueFromString(
|
|||
|
||||
*static_cast<nsAString*>(val.mU.mPtr) = aStr;
|
||||
aValue = std::move(val);
|
||||
aPreventCachingOfSandwich = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,6 @@ nsresult SVGAnimatedEnumeration::SMILEnum::ValueFromString(
|
|||
SMILValue val(SMILEnumType::Singleton());
|
||||
val.mU.mUint = mapping->mVal;
|
||||
aValue = val;
|
||||
aPreventCachingOfSandwich = false;
|
||||
return NS_OK;
|
||||
}
|
||||
mapping++;
|
||||
|
|
|
@ -138,7 +138,6 @@ nsresult SVGAnimatedInteger::SMILInteger::ValueFromString(
|
|||
SMILValue smilVal(SMILIntegerType::Singleton());
|
||||
smilVal.mU.mInt = val;
|
||||
aValue = smilVal;
|
||||
aPreventCachingOfSandwich = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -216,7 +216,6 @@ nsresult SVGAnimatedIntegerPair::SMILIntegerPair::ValueFromString(
|
|||
val.mU.mIntPair[0] = values[0];
|
||||
val.mU.mIntPair[1] = values[1];
|
||||
aValue = val;
|
||||
aPreventCachingOfSandwich = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -146,7 +146,6 @@ nsresult SVGAnimatedLengthList::SMILAnimatedLengthList::ValueFromString(
|
|||
// sandwich layer, causing the animation sandwich to be recalculated every
|
||||
// single sample.
|
||||
|
||||
aPreventCachingOfSandwich = false;
|
||||
for (uint32_t i = 0; i < llai->Length(); ++i) {
|
||||
uint8_t unit = (*llai)[i].GetUnit();
|
||||
if (unit == SVGLength_Binding::SVG_LENGTHTYPE_PERCENTAGE ||
|
||||
|
|
|
@ -160,7 +160,6 @@ nsresult SVGAnimatedNumber::SMILNumber::ValueFromString(
|
|||
SMILValue val(SMILFloatType::Singleton());
|
||||
val.mU.mDouble = value;
|
||||
aValue = val;
|
||||
aPreventCachingOfSandwich = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -130,7 +130,6 @@ nsresult SVGAnimatedNumberList::SMILAnimatedNumberList::ValueFromString(
|
|||
nlai->SetInfo(mElement);
|
||||
aValue = std::move(val);
|
||||
}
|
||||
aPreventCachingOfSandwich = false;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,6 @@ nsresult SVGAnimatedNumberPair::SMILNumberPair::ValueFromString(
|
|||
val.mU.mNumberPair[0] = values[0];
|
||||
val.mU.mNumberPair[1] = values[1];
|
||||
aValue = val;
|
||||
aPreventCachingOfSandwich = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -456,7 +456,6 @@ nsresult SVGAnimatedOrient::SMILOrient::ValueFromString(
|
|||
val.mU.mOrient.mOrientType = SVG_MARKER_ORIENT_ANGLE;
|
||||
}
|
||||
aValue = std::move(val);
|
||||
aPreventCachingOfSandwich = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -166,7 +166,6 @@ nsresult SVGAnimatedPathSegList::SMILAnimatedPathSegList::ValueFromString(
|
|||
list->SetElement(mElement);
|
||||
aValue = std::move(val);
|
||||
}
|
||||
aPreventCachingOfSandwich = false;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -155,7 +155,6 @@ nsresult SVGAnimatedPointList::SMILAnimatedPointList::ValueFromString(
|
|||
list->SetInfo(mElement);
|
||||
aValue = std::move(val);
|
||||
}
|
||||
aPreventCachingOfSandwich = false;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,6 @@ nsresult SMILPreserveAspectRatio::ValueFromString(
|
|||
SMILValue val(SMILEnumType::Singleton());
|
||||
val.mU.mUint = PackPreserveAspectRatio(par);
|
||||
aValue = val;
|
||||
aPreventCachingOfSandwich = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,6 @@ nsresult SVGAnimatedString::SMILString::ValueFromString(
|
|||
|
||||
*static_cast<nsAString*>(val.mU.mPtr) = aStr;
|
||||
aValue = std::move(val);
|
||||
aPreventCachingOfSandwich = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -190,7 +190,6 @@ nsresult SVGAnimatedTransformList::SMILAnimatedTransformList::ValueFromString(
|
|||
}
|
||||
|
||||
ParseValue(aStr, transformType, aValue);
|
||||
aPreventCachingOfSandwich = false;
|
||||
return aValue.IsNull() ? NS_ERROR_FAILURE : NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -268,7 +268,6 @@ nsresult SVGAnimatedViewBox::SMILViewBox ::ValueFromString(
|
|||
SMILValue val(&SVGViewBoxSMILType::sSingleton);
|
||||
*static_cast<SVGViewBox*>(val.mU.mPtr) = viewBox;
|
||||
aValue = std::move(val);
|
||||
aPreventCachingOfSandwich = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче