mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
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:
parent
a3c9c5051e
commit
faa7a6f3cb
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user