@@ -25,19 +25,22 @@ Level: 2
2525Group : csswg
2626ED : https://drafts.csswg.org/css-transitions-2/
2727Editor : L. David Baron, Mozilla https://www.mozilla.org/, https://dbaron.org/, w3cid 15393
28+ Editor : Brian Birtles, Invited Expert, brian@birchill.co.jp, w3cid 43194
2829Issue Tracking : Bugzilla bugs for all levels https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Transitions&resolution=---
2930Abstract : CSS Transitions allows property changes in CSS values to occur smoothly over a specified duration.
3031Ignored Terms : translate, rotate, scale
3132</pre>
3233<pre class="anchors">
33- urlPrefix: https://w3c.github.io /web-animations/; type: interface; spec: web-animations
34+ urlPrefix: https://drafts.csswg.org /web-animations/; type: interface; spec: web-animations
3435 text: Animation
35- urlPrefix: https://w3c.github.io /web-animations/; type: dfn; spec: web-animations
36+ urlPrefix: https://drafts.csswg.org /web-animations/; type: dfn; spec: web-animations
3637 text: active duration
3738 text: active time
3839 text: animation
40+ text: animation effect
3941 text: animation class
4042 text: animation playback rate
43+ text: cancel an animation
4144 text: current iteration
4245 text: current time
4346 text: fill mode
@@ -51,9 +54,12 @@ urlPrefix: https://w3c.github.io/web-animations/; type: dfn; spec: web-animation
5154 text: target effect
5255 text: target effect end
5356 text: unresolved
57+ urlPrefix: https://html.spec.whatwg.org/multipage/browsers.html; type: dfn; spec: html
58+ text: being rendered
5459</pre>
5560<pre class=link-defaults>
5661spec:css-transitions-1; type:value; text:all
62+ spec:css-transitions-1; type:dfn; text:cancel
5763</pre>
5864
5965<h2 id="delta">Delta specification</h2>
@@ -63,58 +69,92 @@ spec:css-transitions-1; type:value; text:all
6369 Once the Level 1 specification is closer to complete, it will be merged
6470 with the additions here into a complete level 2 specification.</p>
6571
66- # Starting of transitions # {#starting}
6772
68- Associated with each top-level browsing context is a <dfn>current transition
69- generation</dfn> that is incremented on each <a>style change event</a> .
70-
71- Each time a new transition is generated, the current value of the (already
72- incremented) <a>current transition generation</a> is stored as the
73- transition's <dfn>transition generation</dfn> .
73+ # Transitions # {#transitions}
7474
75- ## The transition property name ## {#transition-property- name}
75+ ## The ' transition- property' Property ## {#transition-name-property }
7676
7777Although the 'transition-property' may specify shorthand properties and the
7878''all'' keyword, individual transitions are generated for each longhand
7979sub-property that is animatable. The <dfn>expanded transition property
8080name</dfn> of a transition is the name of the longhand sub-property for which
8181the transition was generated (e.g. 'border-left-width' ).
8282
83- ## The transition timing function ## {#transition-timing-function}
83+ ## The 'transition-duration' Property ## {#transition-duration-property}
84+
85+ The 'transition-duration' property specifies the [=iteration duration=]
86+ of the transition's associated [=animation effect=] .
8487
85- When creating a {{KeyframeEffect}} for a transition, the effect's {{EffectTiming/easing}}
86- option is set to the value of the matching 'transition-timing-function' property,
87- which must be used by {{AnimationEffect/getComputedTiming()}} .
88+ ## The 'transition-timing-function' Property ## {#transition-timing-function-property}
89+
90+ The 'transition-timing-function' property specifies the [=timing function=]
91+ of the transition's associated [=animation effect=]
92+ (see [[web-animations-1#time-transformations]] ).
8893
8994Note: Unlike CSS animations, the timing function for CSS transitions applies to
9095the animation effect as opposed to the individual keyframes since this allows
9196it to be reflected in the <a>transformed progress</a> as used when calculating
9297the reversing shortening factor.
9398
94- ## Owning element ## {#owning-element-section}
99+ ## The 'transition-delay' Property ## {#transition-delay-property}
100+
101+ The 'transition-delay' property specifies the [=start delay=]
102+ of the transition's associated [=animation effect=] .
103+
104+
105+ # Starting of transitions # {#starting}
95106
96107The <dfn>owning element</dfn> of a transition refers to the element or
97108pseudo-element to which the 'transition-property' property was applied that
98109generated the animation.
110+ A transition may be disassociated from its [=owning element=]
111+ such that it has no [=owning element=] .
112+
113+ The set of [=running transitions=] includes
114+ only those transitions that have an [=owning element=] .
115+
116+ Whenever an implementation is required to [=cancel=] a transition,
117+ it must disassociate the transition from its [=owning element=]
118+ and run the procedure to [=cancel an animation=] on the transition.
119+
120+ Although not explicitly defined by level 1 of this specification,
121+ in addition to [=cancel|canceling=] transitions on elements that
122+ are no longer [=connected=] ,
123+ implementations must also [=cancel=] any running transitions
124+ on elements that are no longer [=being rendered=] and
125+ remove transitions on them from the set of [=completed transitions=] .
126+
127+ Note that calling the {{Animation/cancel()}} method
128+ on the {{CSSTransition}} object representing a [=running transition=]
129+ does <em> not</em> cause the transition to be disassociated
130+ from its [=owning element=] .
131+
132+ ## Faster reversing of interrupted transitions ## {#reversing}
133+
134+ The [=reversing shortening factor=] and [=reversing-adjusted start value=]
135+ associated with a transition in order to produce correct reverse behavior,
136+ are associated with the transition itself and not, for example,
137+ its [=animation effect=] .
138+ As a result, transitions will use these same values when producing a
139+ reversed transition, even if the transition's associated [=animation effect=]
140+ has been updated or replaced using the Web Animations API [[WEB-ANIMATIONS]] .
99141
100- If a transition was generated directly by script (e.g. using the
101- {{CSSTransition}} constructor) then it has no <a>owning element</a> .
142+ ## The current transition generation ## {#current-transition-generation-section}
102143
103- If a transition generated using the markup defined in this specification is
104- later disassociated from that markup because it is cancelled or replaced by
105- a newer transition, the animation is disassociated from its <a>owning
106- element</a> (that is, it has no <a>owning element</a> from that point
107- forwards).
144+ Associated with each top-level browsing context is a <dfn>current transition
145+ generation</dfn> that is incremented on each <a>style change event</a> .
146+
147+ Each time a new transition is generated, the current value of the (already
148+ incremented) <a>current transition generation</a> is stored as the
149+ transition's <dfn>transition generation</dfn> .
108150
109- Issue: Define the above more precisely once we rewrite firing of transitions
110- in terms of Web Animations concepts (specifically when we spell out when we
111- cancel an animation).
151+ # Application of transitions # {#application}
112152
113153## Animation composite order ## {#animation-composite-order}
114154
115- <a spec='web-animations'>Animations</a> generated from the markup and
116- interfaces (e.g. the {{CSSTransition}} constructor) defined in this
117- specification have an <a>animation class</a> of ‘CSS Transition’.
155+ <a spec='web-animations'>Animations</a> generated from the markup defined in
156+ this specification have an <a>animation class</a> of ‘CSS
157+ Transition’.
118158
119159CSS Transitions have an <em> earlier</em> composite order that CSS Animations
120160and animations without a specific <a>animation class</a> .
@@ -165,8 +205,16 @@ Note, this behavior relies on the fact that disassociating a transition
165205from its <a>owning element</a> always causes it to enter (or remain) in the
166206<a>idle play state</a> .
167207
168- Transitions created using the {{CSSTransition}} constructor are appended
169- to the <a>global animation list</a> at the moment they are constructed.
208+ ## Animation cascade level ## {#cascade-level}
209+
210+ Animations with an [=animation class=] of ‘CSS Transition’
211+ that have an [=owning element=]
212+ are applied to the ‘Transitions declaration’ level
213+ of the CSS cascade.
214+ All other animations generated by the markup defined in this specification,
215+ including animations that no longer have an [=owning element=] ,
216+ are applied to the ‘Animation declarations’ level of the cascade.
217+ (See [[web-animations-1#applying-the-composited-result]] .)
170218
171219# Transition Events # {#transition-events}
172220
@@ -362,53 +410,6 @@ interface CSSTransition : Animation {
362410: <dfn attribute for=CSSTransition>transitionProperty</dfn>
363411:: The <a>expanded transition property name</a> of this transition.
364412
365- <div class="issue">
366-
367- This interface needs a constructor. Perhaps something like the following,
368-
369- <pre class="idl">
370- partial interface CSSTransition {
371- constructor(Animatable? target,
372- CSSOMString transitionProperty,
373- any transitionValue,
374- optional (unrestricted double or KeyframeEffectOptions) options);
375- constructor(Animatable? target,
376- CSSOMString transitionProperty,
377- any transitionValue,
378- (unrestricted double or KeyframeEffectOptions) options,
379- AnimationTimeline? timeline);
380- };
381- </pre>
382-
383- Using <code> any</code> as the type for <code> transitionValue</code> would allow
384- the following usage:
385-
386- <pre class="example lang-javascript">
387- var transition = new CSSTransition(elem, 'opacity' , 1, 2000);
388- transition.play();
389- </pre>
390-
391- The above example, however, is <em> not</em> equivalent to triggering a
392- transition. It has the following differences:
393-
394- * It does not update the specified style.
395- * It would not cancel any existing transition on the given property unless
396- we add special wording to that effect.
397- * It would exhibit different composite order to a regular transition
398- (this should be easily fixed, however).
399- * It has been suggested that <a
400- href="https://github.com/w3c/web-animations/issues/62#issuecomment-117357703"> script-generated
401- animations should not apply to the transition level of the cascade</a> .
402-
403- It is unclear how much we should extend the {{CSSTransition}} constructor to
404- overcome the above limitations so that it can be used to generate transitions
405- programmatically, or whether we should introduce a separate helper method such
406- as has been <a
407- href="https://lists.w3.org/Archives/Public/www-style/2011Mar/0729.html"> suggested
408- elsewhere</a> .
409-
410- </div>
411-
412413## Requirements on pending style changes ## {#requirements-on-pending-style-changes}
413414
414415Various operations may affect the <a lt="computed value">computed values</a> of
@@ -423,7 +424,7 @@ changes to computed values.
423424<div class="note">
424425As an example, in the following code fragment, when the specified value of
425426<code> elem</code> 's ' opacity' property is updated, a user agent may defer
426- recalculating the computed value of the 'animation ' property.
427+ recalculating the computed value of the 'opacity ' property.
427428
428429The first time this occurs, calling {{Window/getComputedStyle(elt)}} and
429430subsequently accessing the <code> opacity</code> property of the result will
0 commit comments