mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1260983 - Update animation properties when the style context changes; r=heycam
MozReview-Commit-ID: L4ugcD7BxNX
This commit is contained in:
parent
1a98da1bd9
commit
344398e8f8
@ -221,6 +221,21 @@ EffectCompositor::PostRestyleForThrottledAnimations()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
EffectCompositor::UpdateEffectProperties(nsStyleContext* aStyleContext,
|
||||
dom::Element* aElement,
|
||||
CSSPseudoElementType aPseudoType)
|
||||
{
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(aElement, aPseudoType);
|
||||
if (!effectSet) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (KeyframeEffectReadOnly* effect : *effectSet) {
|
||||
effect->UpdateProperties(aStyleContext);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
EffectCompositor::MaybeUpdateAnimationRule(dom::Element* aElement,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
|
@ -111,6 +111,14 @@ public:
|
||||
// posted because updates on the main thread are throttled.
|
||||
void PostRestyleForThrottledAnimations();
|
||||
|
||||
// Called when the style context on the specified (pseudo-) element might
|
||||
// have changed so that any context-sensitive values stored within
|
||||
// animation effects (e.g. em-based endpoints used in keyframe effects)
|
||||
// can be re-resolved to computed values.
|
||||
void UpdateEffectProperties(nsStyleContext* aStyleContext,
|
||||
dom::Element* aElement,
|
||||
CSSPseudoElementType aPseudoType);
|
||||
|
||||
// Updates the animation rule stored on the EffectSet for the
|
||||
// specified (pseudo-)element for cascade level |aLevel|.
|
||||
// If the animation rule is not marked as needing an update,
|
||||
|
@ -979,6 +979,8 @@ nsStyleSet::GetContext(nsStyleContext* aParentContext,
|
||||
// Update CSS animations in case the animation-name has just changed.
|
||||
PresContext()->AnimationManager()->UpdateAnimations(result,
|
||||
aElementForAnimation);
|
||||
PresContext()->EffectCompositor()->UpdateEffectProperties(
|
||||
result, aElementForAnimation, result->GetPseudoType());
|
||||
|
||||
animRule = PresContext()->EffectCompositor()->
|
||||
GetAnimationRule(aElementForAnimation,
|
||||
|
Loading…
Reference in New Issue
Block a user