# CSS Animations Level 2

## Editor’s Draft, 1 January 1970

Specification Metadata

This version:
  https://drafts.csswg.org/css-animations-2/
Editors:
  L. David Baron (Mozilla)
  Brian Birtles (Mozilla)
Issue Tracking:
  GitHub Issues
Suggest an Edit for this Spec:
  GitHub Editor
Issues List:
  In Bugzilla

Copyright © 1970 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.

## Abstract

This CSS module describes a way for authors to animate the values of CSS properties over time, using keyframes. The behavior of these keyframe animations can be controlled by specifying their duration, number of repeats, and repeating behavior.

CSS is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, etc.

## Status of this document

This is a public copy of the editors’ draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don’t cite this document other than as work in progress.

GitHub Issues are preferred for discussion of this specification. When filing an issue, please put the text “css-animations-2” in the title, preferably like this: “[css-animations-2] …summary of comment…”. All issues and comments are archived, and there is also a historical archive.

This document was produced by the CSS Working Group.

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 1 March 2019 W3C Process Document.

## 1. Delta specification

This is a delta specification, meaning that it currently contains only the differences from CSS Animations Level 1 [CSS3-ANIMATIONS]. Once the Level 1 specification is closer to complete, it will be merged with the additions here into a complete level 2 specification.

## 2. Animations

### 2.1. Owning element

The owning element of an animation refers to the element or pseudo-element to which the animation-name property was applied that generated the animation.

If an animation was generated directly by script (e.g. using the `CSSAnimation` constructor) then it has no owning element.

If an animation generated using the markup defined in this specification is later disassociated from that markup by an update to the computed value of the animation-name property on the owning element, the animation is disassociated from its owning element (that is, it has no owning element from that point forwards).

In the example below, `animation`’s initial owning element is `elem`. `animation` is disassociated from `element` through an update to the computed value of `elem`’s animation-name property.

    elem.style.animation = 'spin 1s';
    let animation = elem.getAnimations()[0]; // animation’s owning element is elem
    elem.style.animation = ''; // animation no longer has an owning element

Note that although the owning element is often equal to the target element of an animation’s target effect, this is not always the case. The following example demonstrates some of the situations where these two elements may differ.

    elem.style.animation = 'move 1s';
    let animation = elem.getAnimations()[0];
    // animation.effect.target == elem == animation’s owning element

    let mutableEffect = animation.effect.clone();
    animation.effect = mutableEffect;
    animation.effect.target = elem2;
    // animation.effect.target == elem2 != animation’s owning element

    animation.effect = null;
    // animation.effect.target is undefined != animation’s owning element

### 2.2. Animation composite order

Animations generated from the markup or interfaces (e.g. the `CSSAnimation` constructor) defined in this specification have an animation class of ‘CSS Animation’.

CSS Animations with an owning element have a later composite order than CSS Transitions but an earlier composite order than animations without a specific animation class.

Within the set of CSS Animations with an owning element, two animations A and B are sorted in composite order (first to last) as follows:

1. If the owning element of A and B differs, sort A and B by tree order of their corresponding owning elements. With regard to pseudo-elements, the sort order is as follows:

   - element

   - ::marker

   - ::before

   - ::after

   - element children

2. Otherwise, sort A and B based on their position in the computed value of the animation-name property of the (common) owning element.

The composite order of CSS Animations without an owning element is based on their position in the global animation list.

This differs from the behavior defined for transitions. We should probably sort transitions first, then animation, then use the global animation list. The reason being that when developer tools etc. hang on to orphaned animations and transitions in order to replay them, they should maintain roughly the same composite order.

CSS Animations generated using the markup defined in this specification are not added to the global animation list when they are created. Instead, these animations are appended to the global animation list at the first moment when they transition out of the idle play state after being disassociated from their owning element. CSS Animations that have been disassociated from their owning element but are still idle do not have a defined composite order.

Note, this behavior relies on the fact that disassociating an animation from its owning element always causes it to enter (or remain) in the idle play state.

CSS Animations created using the `CSSAnimation` constructor are appended to the global animation list at the moment they are constructed.

## 3. Keyframes

### 3.1. The animation-play-state property

#### 3.1.1. Interaction between animation-play-state and the Web Animations API

Both this specification and the Web Animations specification [WEB-ANIMATIONS] define mechanisms for pause control, specifically the animation-play-state property, and the `play()` and `pause()` methods respectively.

The interaction of these methods can be summarized as follows:

- Calling `pause()` is sticky. The animation will remain paused until there is a subsequent call to `play()` after which point the animation will begin tracking changes to the computed value of the animation-play-state property on the owning element from the next moment it becomes newly paused.

- If the computed animation-play-state on the owning element is paused, calling `play()` will temporarily override the animation-play-state until it next becomes running.

With regards to the pausing, an animation can be considered to be in one of five mutually-exclusive states:

- Running
- Running and temporarily overriding animation-play-state: paused
- Paused and sticky overriding animation-play-state: running
- Paused and sticky overriding animation-play-state: paused
- Paused by animation-play-state

A state transition chart follows:

|  | Initial state
Event | A | B | C | D | E
--- | --- | --- | --- | --- | ---
Resulting state | `play()` | A | B | A | B | B
`pause()` | C | D | C | D | D
animation-play-state → running | A | A | C | C | A
animation-play-state → paused | E | B | D | D | E

If any change causes an animation to change from one of the running states (A, B) to one of the paused states (C, D, E), the user agent must run the pause an animation procedure on the animation.

Likewise, for any change from one of the the paused states to one of the running states, the user agent must run the play an animation procedure on the animation. If the change is due to a change in the computed value of animation-play-state (i.e. the transition E → A) the auto-rewind flag for that procedure must be set to false; otherwise it must be set to true.

### 3.2. The animation-composition property

The animation-composition property defines the composite operation used when multiple animations affect the same property simultaneously.

Name: | animation-composition
Value: | <single-animation-composition>#
Initial: | replace
Applies to: | all elements
Inherited: | no
Percentages: | N/A
Computed value: | list, each item a keyword as specified
Canonical order: | per grammar
Animation type: | not animatable

<single-animation-composition> = replace | add | accumulate

The values of animation-composition have the meaning defined for the corresponding values of the composite operation defined in Web Animations [WEB-ANIMATIONS].

When specified in a keyframe, animation-composition defines the composite operation to use for each property specified in that keyframe until the next keyframe specifying each property.

For example, the following stylesheet defines two different animations targetting the scale property.

    @keyframes heartbeat {
      from {
        scale: 1;
        animation-timing-function: ease-out;
      }
      30% {
        scale: 1.3;
      }
    }
    .heartbeat {
      animation: heartbeat 0.3s 2s infinite;
    }

    @keyframes throb {
      50% {
        scale: 1.8;
      }
    }
    .icon:mouseover {
      animation: throb 0.4s add;
    }

If these two animations are applied to the same element, normally only one animation would apply, but by specifying add as the animation-composition on the second animation, the result of the two animations will be combined.

Since CSS Transitions [CSS3-TRANSITIONS] have a lower composite order, it is possible to use animation-composition to combine CSS Animations with underlying transitions as in the following example.

    .icon {
      filter: blur(20px);
      transition: filter 0.5s;
    }
    .icon:hover {
      filter: blur(0px);
      animation: brightness-pulse 3s infinite add;
    }

    @keyframes pulse {
      0% {
        scale: 1.1;
        filter: brightness(130%);
      }
      10% {
        scale: 1;
        filter: brightness(100%);
      }
    }

Create pictures of these examples and verify they make sense.

## 4. Animation Events

### 4.1. Event dispatch

Note, this is a more general description of event dispatch than that of CSS Animations Level 1 [CSS3-ANIMATIONS] since it must account for the possibility of animations being seeked or reversed using the Web Animations API [WEB-ANIMATIONS].

For the purpose of determining which events to dispatch, the phases defined in the Web Animations model are used. These definitions apply to an animation effect, however, for the purpose of dispatching events, we consider a CSS Animation to have the same phase as its target effect. For example, a CSS Animation is in the before phase if its target effect is in the before phase.

A CSS Animation that does not have a target effect is considered to be in the idle phase if its current time is unresolved, in the before phase if its current time is less than zero, and in the after phase otherwise.

Similarly, subsequent references to the start delay, active duration, current iteration, iteration start, and iteration duration of a CSS animation should be understood to refer to the corresponding properties of the animation’s target effect.

For calculating the `elapsedTime` of each event, the following definitions are used:

- interval start = `max(min(-start delay, active duration), 0)`

- interval end = `max(min(target effect end - start delay, active duration), 0)`

Each time an animation is sampled and is not pending, the events to dispatch are determined by comparing the animation’s phase before and after the sample as follows:

Change | Events dispatched | Elapsed time (ms)
--- | --- | ---
idle or before → active | `animationstart` | interval start
idle or before → after ٭ | `animationstart` | interval start
`animationend` | interval end
active → before | `animationend` | interval start
active → active and the current iteration of the animation’s target effect has changed since the previous sample | `animationiteration` | (See below) †
active → after | `animationend` | interval end
after → active | `animationstart` | interval end
after → before ٭ | `animationstart` | interval end
`animationend` | interval start
not idle and not after→ idle | `animationcancel` | The active time of the animation at the moment it was cancelled calculated using a fill mode of both.

٭ Where multiple events are listed for a state change, all events are dispatched in the order listed and in immediate succession.

† The elapsed time for an `animationiteration` event is defined as follows:

1. Let previous current iteration be the current iteration from the previous sample.

2. If previous current iteration is greater than current iteration, let iteration boundary be `current iteration + 1`, otherwise let it be current iteration.

3. The elapsed time is the result of evaluating `(iteration boundary - iteration start) × iteration duration)`.

Since the elapsed time defined in the table and procedure above is expressed in milliseconds, it must be divided by 1,000 to produce a value in seconds before being assigned to the `elapsedTime` member of the `AnimationEvent`.

## 5. DOM Interfaces

### 5.1. The CSSAnimation interface

    [Exposed=Window]
    interface CSSAnimation : Animation {
      readonly attribute CSSOMString animationName;
    };

`animationName`, of type CSSOMString, readonly

  The key used to find matching keyframes rules that define target effect at the point when the animation was created. This is the value of the animation-name property that caused this object to be generated or, if this object was generated using the programming interface, the `animationName` argument that was passed to the `CSSAnimation` constructor.

We need to define a constructor for `CSSAnimation`. Perhaps something like the following:

    [Constructor (Animatable? target,
                  CSSOMString animationName,
                  optional (unrestricted double or KeyframeEffectOptions) options,
                  optional CSSOMString defaultEasing = "ease"),
     Constructor (Animatable? target,
                  CSSOMString animationName,
                  (unrestricted double or KeyframeEffectOptions) options,
                  CSSOMString defaultEasing,
                  AnimationTimeline? timeline)]
    partial interface CSSAnimation { };

The difficulty is with liveness. The most useful and least magical (but most complicated) approach is to define a subclass of `KeyframeEffectReadOnly` that has the special behavior of tracking changes to all @keyframes rules that match the supplied name and automatically updating the set of keyframes returned by `getFrames()` after filling-in the default easing.

Something like,

    [Exposed=Window,
     Constructor (CSSOMString keyframesName, CSSOMString defaultEasing)]
    interface CSSKeyframeEffectReadOnly : KeyframeEffectReadOnly {
      readonly attribute CSSOMString keyframesName;
      readonly attribute CSSOMString defaultEasing;
    };

### 5.2. Requirements on pending style changes

Various operations may affect the computed values of properties on elements. User agents may, as an optimization, defer recomputing these values until it becomes necessary. However, all operations included in programming interface defined in this specification, as well as those operations defined in Web Animations [WEB-ANIMATIONS] that may return objects defined by this specification, must produce a result consistent with having fully processed any such pending changes to computed values.

As an example, in the following code fragment, when the specified style of `elem` is initially updated, a user agent may defer recalculating the computed value of the animation property.

However, the `getAnimations()` method called on `elem` is specified by Web Animations and can return `CSSAnimation` objects as defined in this specification. Hence, as result of the requirements in this section, the user agent must calculate the updated value of `elem`’s animation property and create the requested `CSSAnimation` object before returning its result.

    elem.style.animation = 'fadeOut 1s';
    elem.getAnimations()[0].pause();

## 6. Privacy and Security Considerations

This specification introduces no new privacy or security considerations.

## Conformance

### Document conventions

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with `class="example"`, like this:

This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with `class="note"`, like this:

Note, this is an informative note.

Advisements are normative sections styled to evoke special attention and are set apart from other normative text with `<strong class="advisement">`, like this: UAs MUST provide an accessible alternative.

### Conformance classes

Conformance to this specification is defined for three conformance classes:

style sheet
  A CSS style sheet.
renderer
  A UA that interprets the semantics of a style sheet and renders documents that use them.
authoring tool
  A UA that writes a style sheet.

A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module.

A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.)

An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module.

### Requirements for Responsible Implementation of CSS

The following sections define several conformance requirements for implementing CSS responsibly, in a way that promotes interoperability in the present and future.

#### Partial Implementations

So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents must not selectively ignore unsupported property values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.

#### Implementations of Unstable and Proprietary Features

To avoid clashes with future stable CSS features, the CSSWG recommends following best practices for the implementation of unstable features and proprietary extensions to CSS.

#### Implementations of CR-level Features

Once a specification reaches the Candidate Recommendation stage, implementers should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec, and should avoid exposing a prefixed variant of that feature.

To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group.

Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at http://www.w3.org/Style/CSS/Test/. Questions should be directed to the public-css-testsuite@w3.org mailing list.

## Index

### Terms defined by this specification

- animation-composition, in §3.2
- animationName, in §5.1
- CSSAnimation, in §5.1
- CSSKeyframeEffectReadOnly, in §5.1
- defaultEasing, in §5.1
- Elapsed time, in §4.1
- interval end, in §4.1
- interval start, in §4.1
- keyframesName, in §5.1
- owning element, in §2.1
- <single-animation-composition>, in §3.2

https://drafts.csswg.org/css-cascade-4/#computed-value Referenced in:

- 5.2. Requirements on pending style changes

https://drafts.fxtf.org/css-masking-1/#valdef-mask-composite-add Referenced in:

- 3.2. The animation-composition property

https://drafts.csswg.org/css-transforms-2/#propdef-scale Referenced in:

- 3.2. The animation-composition property

https://drafts.csswg.org/css-values-4/#mult-comma Referenced in:

- 3.2. The animation-composition property

https://drafts.csswg.org/css-animations-1/#animationevent Referenced in:

- 4.1. Event dispatch

https://drafts.csswg.org/css-animations-1/#propdef-animation Referenced in:

- 5.2. Requirements on pending style changes (2)

https://drafts.csswg.org/css-animations-1/#propdef-animation-name Referenced in:

- 2.1. Owning element (2) (3)
- 2.2. Animation composite order
- 5.1. The CSSAnimation interface

https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state Referenced in:

- 3.1. The animation-play-state property
- 3.1.1. Interaction between animation-play-state and the Web Animations API (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12)

https://drafts.csswg.org/css-animations-1/#eventdef-animationevent-animationcancel Referenced in:

- 4.1. Event dispatch

https://drafts.csswg.org/css-animations-1/#eventdef-animationevent-animationend Referenced in:

- 4.1. Event dispatch (2) (3) (4)

https://drafts.csswg.org/css-animations-1/#eventdef-animationevent-animationiteration Referenced in:

- 4.1. Event dispatch (2)

https://drafts.csswg.org/css-animations-1/#eventdef-animationevent-animationstart Referenced in:

- 4.1. Event dispatch (2) (3) (4)

https://drafts.csswg.org/css-animations-1/#dom-animationevent-elapsedtime Referenced in:

- 4.1. Event dispatch (2)

https://drafts.csswg.org/css-animations-1/#valdef-animation-play-state-paused Referenced in:

- 3.1.1. Interaction between animation-play-state and the Web Animations API (2) (3) (4) (5)

https://drafts.csswg.org/css-animations-1/#valdef-animation-play-state-running Referenced in:

- 3.1.1. Interaction between animation-play-state and the Web Animations API (2) (3)

https://drafts.csswg.org/cssom-1/#cssomstring Referenced in:

- 5.1. The CSSAnimation interface (2) (3) (4) (5) (6) (7) (8) (9) (10)

https://dom.spec.whatwg.org/#concept-tree-order Referenced in:

- 2.2. Animation composite order

https://drafts.csswg.org/web-animations-1/#animatable Referenced in:

- 5.1. The CSSAnimation interface (2)

https://w3c.github.io/web-animations/#animation Referenced in:

- 2.2. Animation composite order
- 5.1. The CSSAnimation interface

https://drafts.csswg.org/web-animations-1/#animationtimeline Referenced in:

- 5.1. The CSSAnimation interface

https://drafts.csswg.org/web-animations-1/#dictdef-keyframeeffectoptions Referenced in:

- 5.1. The CSSAnimation interface (2)

https://w3c.github.io/web-animations/#keyframeeffectreadonly Referenced in:

- 5.1. The CSSAnimation interface (2)

https://w3c.github.io/web-animations/#active-duration Referenced in:

- 4.1. Event dispatch (2) (3)

https://w3c.github.io/web-animations/#active-phase Referenced in:

- 4.1. Event dispatch (2) (3) (4) (5) (6)

https://w3c.github.io/web-animations/#active-time Referenced in:

- 4.1. Event dispatch

https://w3c.github.io/web-animations/#after-phase Referenced in:

- 4.1. Event dispatch (2) (3) (4) (5) (6)

https://w3c.github.io/web-animations/#animation Referenced in:

- 2.2. Animation composite order
- 5.1. The CSSAnimation interface

https://w3c.github.io/web-animations/#animation-class Referenced in:

- 2.2. Animation composite order (2)

https://w3c.github.io/web-animations/#animation-effect Referenced in:

- 4.1. Event dispatch

https://w3c.github.io/web-animations/#before-phase Referenced in:

- 4.1. Event dispatch (2) (3) (4) (5) (6) (7)

https://w3c.github.io/web-animations/#composite-operation Referenced in:

- 3.2. The animation-composition property (2)

https://w3c.github.io/web-animations/#current-iteration Referenced in:

- 4.1. Event dispatch (2) (3) (4) (5) (6)

https://w3c.github.io/web-animations/#current-time Referenced in:

- 4.1. Event dispatch (2)

https://w3c.github.io/web-animations/#fill-mode Referenced in:

- 4.1. Event dispatch

https://www.w3.org/TR/web-animations-1/#dom-animatable-getanimations Referenced in:

- 5.2. Requirements on pending style changes

https://w3c.github.io/web-animations/#getframes Referenced in:

- 5.1. The CSSAnimation interface

https://w3c.github.io/web-animations/#global-animation-list Referenced in:

- 2.2. Animation composite order (2) (3) (4)

https://w3c.github.io/web-animations/#idle-phase Referenced in:

- 4.1. Event dispatch (2) (3) (4) (5)

https://w3c.github.io/web-animations/#idle-play-state Referenced in:

- 2.2. Animation composite order (2) (3)

https://w3c.github.io/web-animations/#iteration-duration Referenced in:

- 4.1. Event dispatch (2)

https://w3c.github.io/web-animations/#iteration-start Referenced in:

- 4.1. Event dispatch (2)

https://w3c.github.io/web-animations/#pause-an-animation Referenced in:

- 3.1.1. Interaction between animation-play-state and the Web Animations API

https://w3c.github.io/web-animations/#pause Referenced in:

- 3.1.1. Interaction between animation-play-state and the Web Animations API (2) (3)

https://w3c.github.io/web-animations/#pending-play-state Referenced in:

- 4.1. Event dispatch

https://w3c.github.io/web-animations/#play-an-animation Referenced in:

- 3.1.1. Interaction between animation-play-state and the Web Animations API

https://w3c.github.io/web-animations/#play Referenced in:

- 3.1.1. Interaction between animation-play-state and the Web Animations API (2) (3) (4)

https://w3c.github.io/web-animations/#sampling Referenced in:

- 4.1. Event dispatch

https://w3c.github.io/web-animations/#start-delay Referenced in:

- 4.1. Event dispatch (2) (3)

https://w3c.github.io/web-animations/#target-effect Referenced in:

- 2.1. Owning element
- 4.1. Event dispatch (2) (3) (4) (5)
- 5.1. The CSSAnimation interface

https://w3c.github.io/web-animations/#target-effect-end Referenced in:

- 4.1. Event dispatch

https://w3c.github.io/web-animations/#target-element Referenced in:

- 2.1. Owning element

https://w3c.github.io/web-animations/#unresolved Referenced in:

- 4.1. Event dispatch

https://heycam.github.io/webidl/#Exposed Referenced in:

- 5.1. The CSSAnimation interface (2)

https://heycam.github.io/webidl/#idl-unrestricted-double Referenced in:

- 5.1. The CSSAnimation interface (2)

### Terms defined by reference

- [css-cascade-4] defines the following terms:
  - computed value
- [css-masking-1] defines the following terms:
  - add
- [css-transforms-2] defines the following terms:
  - scale
- [css-values-4] defines the following terms:
  - #
- [CSS3-ANIMATIONS] defines the following terms:
  - AnimationEvent
  - animation
  - animation-name
  - animation-play-state
  - animationcancel
  - animationend
  - animationiteration
  - animationstart
  - elapsedTime
  - paused
  - running
- [cssom-1] defines the following terms:
  - CSSOMString
- [DOM] defines the following terms:
  - tree order
- [WEB-ANIMATIONS] defines the following terms:
  - Animatable
  - Animation
  - AnimationTimeline
  - KeyframeEffectOptions
  - KeyframeEffectReadOnly
  - active duration
  - active phase
  - active time
  - after phase
  - animation
  - animation class
  - animation effect
  - before phase
  - composite operation
  - current iteration
  - current time
  - fill mode
  - getAnimations()
  - getFrames()
  - global animation list
  - idle phase
  - idle play state
  - iteration duration
  - iteration start
  - pause an animation
  - pause()
  - pending play state
  - play an animation
  - play()
  - sampling
  - start delay
  - target effect
  - target effect end
  - target element
  - unresolved
- [WebIDL] defines the following terms:
  - Exposed
  - unrestricted double

## References

### Normative References

[CSS-CASCADE-4]
  Elika Etemad; Tab Atkins Jr.. CSS Cascading and Inheritance Level 4. 28 August 2018. CR. URL: https://www.w3.org/TR/css-cascade-4/
[CSS-VALUES-4]
  Tab Atkins Jr.; Elika Etemad. CSS Values and Units Module Level 4. 31 January 2019. WD. URL: https://www.w3.org/TR/css-values-4/
[CSS3-ANIMATIONS]
  Dean Jackson; et al. CSS Animations Level 1. 11 October 2018. WD. URL: https://www.w3.org/TR/css-animations-1/
[CSSOM-1]
  Simon Pieters; Glenn Adams. CSS Object Model (CSSOM). 17 March 2016. WD. URL: https://www.w3.org/TR/cssom-1/
[DOM]
  Anne van Kesteren. DOM Standard. Living Standard. URL: https://dom.spec.whatwg.org/
[RFC2119]
  S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119
[WEB-ANIMATIONS]
  Brian Birtles; et al. Web Animations. 11 October 2018. WD. URL: https://www.w3.org/TR/web-animations-1/
[WebIDL]
  Boris Zbarsky. Web IDL. 15 December 2016. ED. URL: https://heycam.github.io/webidl/

### Informative References

[CSS-MASKING-1]
  Dirk Schulze; Brian Birtles; Tab Atkins Jr.. CSS Masking Module Level 1. 26 August 2014. CR. URL: https://www.w3.org/TR/css-masking-1/
[CSS-TRANSFORMS-2]
  CSS Transforms Module Level 2 URL: https://drafts.csswg.org/css-transforms-2/
[CSS3-TRANSITIONS]
  David Baron; et al. CSS Transitions. 11 October 2018. WD. URL: https://www.w3.org/TR/css-transitions-1/

## Property Index

Name | Value | Initial | Applies to | Inh. | %ages | Animation type | Canonical order | Computed value
--- | --- | --- | --- | --- | --- | --- | --- | ---
animation-composition | <single-animation-composition># | replace | all elements | no | N/A | not animatable | per grammar | list, each item a keyword as specified

## IDL Index

    [Exposed=Window]
    interface CSSAnimation : Animation {
      readonly attribute CSSOMString animationName;
    };

    [Constructor (Animatable? target,
                  CSSOMString animationName,
                  optional (unrestricted double or KeyframeEffectOptions) options,
                  optional CSSOMString defaultEasing = "ease"),
     Constructor (Animatable? target,
                  CSSOMString animationName,
                  (unrestricted double or KeyframeEffectOptions) options,
                  CSSOMString defaultEasing,
                  AnimationTimeline? timeline)]
    partial interface CSSAnimation { };

    [Exposed=Window,
     Constructor (CSSOMString keyframesName, CSSOMString defaultEasing)]
    interface CSSKeyframeEffectReadOnly : KeyframeEffectReadOnly {
      readonly attribute CSSOMString keyframesName;
      readonly attribute CSSOMString defaultEasing;
    };

## Issues Index

This differs from the behavior defined for transitions. We should probably sort transitions first, then animation, then use the global animation list. The reason being that when developer tools etc. hang on to orphaned animations and transitions in order to replay them, they should maintain roughly the same composite order. ↵
Create pictures of these examples and verify they make sense. ↵

We need to define a constructor for `CSSAnimation`. Perhaps something like the following:

    [Constructor (Animatable? target,
                  CSSOMString animationName,
                  optional (unrestricted double or KeyframeEffectOptions) options,
                  optional CSSOMString defaultEasing = "ease"),
     Constructor (Animatable? target,
                  CSSOMString animationName,
                  (unrestricted double or KeyframeEffectOptions) options,
                  CSSOMString defaultEasing,
                  AnimationTimeline? timeline)]
    partial interface CSSAnimation { };

The difficulty is with liveness. The most useful and least magical (but most complicated) approach is to define a subclass of `KeyframeEffectReadOnly` that has the special behavior of tracking changes to all @keyframes rules that match the supplied name and automatically updating the set of keyframes returned by `getFrames()` after filling-in the default easing.

Something like,

    [Exposed=Window,
     Constructor (CSSOMString keyframesName, CSSOMString defaultEasing)]
    interface CSSKeyframeEffectReadOnly : KeyframeEffectReadOnly {
      readonly attribute CSSOMString keyframesName;
      readonly attribute CSSOMString defaultEasing;
    };

↵
#owning-element Referenced in:

- 2.1. Owning element (2) (3) (4) (5) (6)
- 2.2. Animation composite order (2) (3) (4) (5) (6) (7) (8) (9)
- 3.1.1. Interaction between animation-play-state and the Web Animations API (2)

#propdef-animation-composition Referenced in:

- 3.2. The animation-composition property (2) (3) (4) (5) (6)

#typedef-single-animation-composition Referenced in:

- 3.2. The animation-composition property

#interval-start Referenced in:

- 4.1. Event dispatch (2) (3) (4)

#interval-end Referenced in:

- 4.1. Event dispatch (2) (3) (4)

#elapsed-time Referenced in:

- 4.1. Event dispatch (2) (3)

#cssanimation Referenced in:

- 2.1. Owning element
- 2.2. Animation composite order (2)
- 5.1. The CSSAnimation interface (2) (3)
- 5.2. Requirements on pending style changes (2)

#dom-cssanimation-animationname Referenced in:

- 5.1. The CSSAnimation interface