Confirmed users
220
edits
Line 18: | Line 18: | ||
== Overview of how they work == | == Overview of how they work == | ||
Both nsTransitionManager and nsAnimationManager are created at the initialization of nsPresContext (nsPresContext::Init). | |||
An animation-element is added to the animation-manager when the frame is created, while a transition-element is added to the transition-manager only at the time it is trigger. The RestyleManager will try starting the transitions at every cycle of restyle. | |||
Both animation-element and transition-element calculate their interpolated value with nsStyleAnimation::Interpolate(...), in the call to EnsureStyleRuleFor(). | |||
EnsureStyleRuleFor() is defined in both transition-element, animation-element, and animation-manager. They behave similarly but with different interface. For transitions, it is called by nsTransitionManager::RulesMatching from RestyleManager, or UpdateAllThrottledStyles() from RestyleManager if async animation is enabled. For animations, it is called by nsAnimationManager::FlushAnimations, which is called by the refresh driver of animation-manager. | |||
=== nsTransitionManager.h === | === nsTransitionManager.h === | ||
=== nsAnimationManager.h === | === nsAnimationManager.h === | ||
== What's Next == | == What's Next == |