User:Shellylin/CSS Animations and Transitions

Goal and Purpose

One of the goal of Web Animations is to provide an unified animation interface, so that users can develop/control playbacks of css-animation, css-transition, svg-animation and video in a more consolidated way.

In our gecko code base, CSS-Animations/Transitions already share some code, and are duplicating some computing works here and there. As the first step towards implementing Web Animations, we want to unify some code use for animations and transitions.

Before that, here’s a brief overview in terms of the structure of animation manager.

Class Structure and Relationship

AnimationCommon.h

class CommonAnimationManager

  • The base class of nsAnimationManager and nsTransitionManager.
  • Hooks up with refresh driver and style rule processor.
  • ExtractComputedValueForTransition()
    • Calls nsStyleAnimation::ExtractComputedValue(aProperty, aStyleContext, aComputedValue); to get the computed value for the given property(width, color...etc.) from the given style context.
    • This method is called whem building an animation segment, starting a transition, or a style context change for transition.
  • Adds a CommonElementAnimationData with AddElementData().

Overview of how they work

nsTransitionManager.h

nsAnimationManager.h

What's Next