Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C liability, trademark and document use rules apply.
This specification defines mappings between [CSS3-ANIMATIONS], [CSS3-TRANSITIONS] and the [WEB-ANIMATIONS] model. CSS is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, in speech, etc.
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.
The (archived) public mailing list public-fx@w3.org (see instructions) is preferred for discussion of this specification. When sending e-mail, please put the text “web-animations-css” in the subject, preferably like this: “[web-animations-css] …summary of comment…”
This document was produced by the CSS Working Group (part of the Style Activity) and the SVG Working Group (part of the Graphics Activity).
This document was produced by groups operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures (CSS) and a public list of any patent disclosures (SVG) made in connection with the deliverables of each group; these pages 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.
[CSS3-ANIMATIONS] and [CSS3-TRANSITIONS] provide models for defining declarative animations via CSS. [SVG12] provides a model for defining declarative animations via SVG. However, the three specifications do not define or present a unified animation model.
To solve this problem, the [WEB-ANIMATIONS] specification defines a comprehensive animation model that is capable of supporting [CSS3-ANIMATIONS], [CSS3-TRANSITIONS] and [SVG12].
This document describes how [CSS3-ANIMATIONS] and [CSS3-TRANSITIONS] are supported by the [WEB-ANIMATIONS] model.
For CSS Transitions, mappings into the Web Animations model are established pairwise for a specific CSS property, the transitioning property, on a specific element, the transitioning element.
When a CSS Transition is started for the transitioning property of a transitioning element, an Animation is constructed and associated with a Player on the document timeline, configured with a custom player priority which ensures that the Player sorts before Players created through the Web Animations API and those generated for CSS Animations. The Animation is configured as follows:
Note, changes to the values of the transition-delay, transition-duration, and transition-timing-function have no effect on a transition once it has started.
When a transition affecting the transitioning property of a transitioning element is removed or interrupted the cancel method of the corresponding Player is called.
When a transition affecting the transitioning property of a transitioning element is reversed the cancel method of the corresponding Player is called and a new Player is generated as if the transition had just begun.
[MapClass(String, AnimationEffect)] interface CSSKeyframesMap { }; partial interface Document { readonly attribute CSSKeyframesMap keyframes; };
The CSSKeyframesMap interface defines a map type that can be used to store sequences of Keyframes indexed by Strings.
The keyframes attribute on the Document interface references a map of type CSSKeyframesMap.
Note: The CSSKeyframesMap enables animations created using the Web Animations API to re-use the keyframe rules declared by CSS, and for animations declared by CSS to act on AnimationEffects created through the API.
Note: The processing defined in this section does not alter the way in which keyframes rules are selected when CSS animations are started, unless a name is explicitly overridden by setting its value in the map.
When a new @keyframes rule name is encountered in a style sheet, the action taken depends upon the current value stored against the name in the keyframes map.
The keyframes defined by the @keyframes rule are converted into a KeyframeEffect (see §3.1.3 Converting a CSS Keyframes rule into a KeyframeEffect), then stored against the name in the keyframes map.
The rule is ignored.
Should the KeyframeEffects generated by @keyframes rules be read-only?
When the used @keyframes rule associated with a given name changes due to a change in a style sheet, the action taken depends upon the current value stored against the name in the keyframes map.
The keyframes defined by the new rule are converted into a KeyframeEffect (see §3.1.3 Converting a CSS Keyframes rule into a KeyframeEffect), then stored against the name in the keyframes map.
When the last @keyframes rule for a given name is removed from a style sheet, the action taken depends upon the current value stored against the name in the keyframes map.
The value referenced by the @keyframes name is cleared from the keyframes map.
A CSS @keyframes rule keyframes is converted into a KeyframeEffect using the following process:
For CSS Animations, mappings into the Web Animations model are established pairwise between a specific AnimationEffect, the animating effect, and a specific element, the animating element.
When a CSS Animation is to be started, the value of animation-name is used as an index into the keyframes map, and the matching AnimationEffect (if any) is used to instantiate the animating effect by following the procedure defined below (see §3.4 Instantiating the animating effect ).
When a CSS Animation is started an Animation is constructed and associated with a Player on the Document Timeline. The animation is configured as follows:
Deal with animation-play-state
Explain where we need to cancel the Player for a css animation.
The animationstart event is triggered to fire each time the corresponding Animation enters the active phase or after phase during a sample.
The animationiteration event is triggered to fire, on each sample where all of the following conditions are met:
The animationend event is triggered to fire each time the corresponding Animation enters the after phase during a sample.
The animating effect is instantiated from an AnimationEffect (the reference effect) stored in the keyframes attribute using the following process:
turn this into boring old specificese
Players generated by CSS Animations and CSS Transitions are accessible via getAnimationPlayers with the restriction that source will point to a read-only TimedItem which disallows changes to its specified timing and effect.
Note: The Player remains fully functional. The source, playbackRate, currentTime, startTime and play control methods will be live and function as normal.
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.
Conformance to this specification is defined for three conformance classes:
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.
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 component 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.
To avoid clashes with future CSS features, the CSS2.1 specification reserves a prefixed syntax for proprietary and experimental extensions to CSS.
Prior to a specification reaching the Candidate Recommendation stage in the W3C process, all implementations of a CSS feature are considered experimental. The CSS Working Group recommends that implementations use a vendor-prefixed syntax for such features, including those in W3C Working Drafts. This avoids incompatibilities with future changes in the draft.
Once a specification reaches the Candidate Recommendation stage, non-experimental implementations are possible, and implementors should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec.
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.
No properties defined.