Bug 1340958 - Allocate StyleRule only if we need to compose styles. r=birtles

MozReview-Commit-ID: 6ucsxBAaYRp

--HG--
extra : rebase_source : ec0bd4627d40335c353b79720f7dfb2e4f3c304c
This commit is contained in:
Hiroyuki Ikezoe 2017-03-17 12:48:51 +09:00
Родитель a3c9c5051e
Коммит faa7a6f3cb
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -440,7 +440,7 @@ KeyframeEffectReadOnly::GetUnderlyingStyle(
{
StyleAnimationValue result;
if (aAnimationRule->HasValue(aProperty)) {
if (aAnimationRule && aAnimationRule->HasValue(aProperty)) {
// If we have already composed style for the property, we use the style
// as the underlying style.
DebugOnly<bool> success = aAnimationRule->GetValue(aProperty, result);
@ -623,11 +623,6 @@ KeyframeEffectReadOnly::ComposeStyle(
} else {
// Gecko backend
if (!aStyleRule.mGecko) {
// Allocate the style rule now that we know we have animation data.
aStyleRule.mGecko = new AnimValuesStyleRule();
}
StyleAnimationValue fromValue =
CompositeValue(prop.mProperty, aStyleRule.mGecko,
segment->mFromValue.mGecko,
@ -640,6 +635,11 @@ KeyframeEffectReadOnly::ComposeStyle(
continue;
}
if (!aStyleRule.mGecko) {
// Allocate the style rule now that we know we have animation data.
aStyleRule.mGecko = new AnimValuesStyleRule();
}
// Iteration composition for accumulate
if (mEffectOptions.mIterationComposite ==
IterationCompositeOperation::Accumulate &&