Skip to content

Commit 8bd3b4a

Browse files
committed
Merge branch 'master' of github.com:w3c/csswg-drafts
2 parents 91153fd + 90d55c0 commit 8bd3b4a

File tree

3 files changed

+97
-132
lines changed

3 files changed

+97
-132
lines changed

css-animations-2/Overview.bs

Lines changed: 17 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ The <dfn>owning element</dfn> of an animation refers to the element or
102102
pseudo-element to which the 'animation-name' property was applied that generated
103103
the animation.
104104

105-
If an animation was generated directly by script (e.g. using
106-
the {{CSSAnimation}} constructor) then it has no <a>owning element</a>.
107-
108105
If an animation generated using the markup defined in this specification is
109106
later disassociated from that markup by an update to the computed value of the
110107
'animation-name' property on the <a>owning element</a>, the animation is
@@ -147,9 +144,9 @@ animation.effect = null;
147144
148145
## Animation composite order ## {#animation-composite-order}
149146
150-
<a spec='web-animations'>Animations</a> generated from the markup or interfaces
151-
(e.g. the {{CSSAnimation}} constructor) defined in this specification have an
152-
<a>animation class</a> of &lsquo;CSS Animation&rsquo;.
147+
<a spec='web-animations'>Animations</a> generated from the markup defined in
148+
this specification have an <a>animation class</a> of &lsquo;CSS
149+
Animation&rsquo;.
153150
154151
CSS Animations <em>with</em> an <a>owning element</a> have a <em>later</em>
155152
composite order than CSS Transitions but an <em>earlier</em> composite order
@@ -198,9 +195,6 @@ Note, this behavior relies on the fact that disassociating an animation
198195
from its <a>owning element</a> always causes it to enter (or remain) in the
199196
<a>idle play state</a>.
200197
201-
CSS Animations created using the {{CSSAnimation}} constructor are appended
202-
to the <a>global animation list</a> at the moment they are constructed.
203-
204198
# Keyframes # {#keyframes}
205199
206200
## The 'animation-play-state' property ## {#animation-play-state}
@@ -550,47 +544,7 @@ interface CSSAnimation : Animation {
550544
:: The key used to find matching keyframes rules that define <a>target
551545
effect</a> at the point when the animation was created.
552546
This is the value of the 'animation-name' property that caused this
553-
object to be generated or, if this object was generated using the
554-
programming interface, the <code>animationName</code> argument
555-
that was passed to the {{CSSAnimation}} constructor.
556-
557-
<div class="issue">
558-
559-
We need to define a constructor for {{CSSAnimation}}.
560-
Perhaps something like the following:
561-
562-
<pre class="idl">
563-
partial interface CSSAnimation {
564-
constructor(Animatable? target,
565-
CSSOMString animationName,
566-
optional (unrestricted double or KeyframeEffectOptions) options,
567-
optional CSSOMString defaultEasing = "ease");
568-
constructor(Animatable? target,
569-
CSSOMString animationName,
570-
(unrestricted double or KeyframeEffectOptions) options,
571-
CSSOMString defaultEasing,
572-
AnimationTimeline? timeline);
573-
};
574-
</pre>
575-
576-
The difficulty is with liveness. The most useful and least magical
577-
(but most complicated) approach is to define a subclass of
578-
{{KeyframeEffectReadOnly}} that has the special behavior of tracking changes
579-
to all @keyframes rules that match the supplied name and automatically
580-
updating the set of keyframes returned by
581-
{{KeyframeEffectReadOnly/getFrames()}} after filling-in the default easing.
582-
583-
Something like,
584-
585-
<pre class="idl">
586-
interface CSSKeyframeEffectReadOnly : KeyframeEffectReadOnly {
587-
constructor(CSSOMString keyframesName, CSSOMString defaultEasing);
588-
readonly attribute CSSOMString keyframesName;
589-
readonly attribute CSSOMString defaultEasing;
590-
};
591-
</pre>
592-
593-
</div>
547+
object to be generated.
594548
595549
## Requirements on pending style changes ## {#requirements-on-pending-style-changes}
596550
@@ -599,9 +553,9 @@ properties on elements. User agents may, as an optimization, defer recomputing
599553
these values until it becomes necessary.
600554
However, all operations included in programming interface defined in this
601555
specification, as well as those operations defined in Web Animations
602-
[[!WEB-ANIMATIONS]] that may return objects defined by this specification,
603-
must produce a result consistent with having fully processed any such pending
604-
changes to computed values.
556+
[[!WEB-ANIMATIONS]] that may return objects or animation state defined by this
557+
specification, must produce a result consistent with having fully processed
558+
any such pending changes to computed values.
605559
606560
<div class="note">
607561
As an example, in the following code fragment, when the specified style of
@@ -620,6 +574,16 @@ elem.style.animation = 'fadeOut 1s';
620574
elem.getAnimations()[0].pause();
621575
</pre></div>
622576
577+
Similarly, reading {{Animation/playState}} may depend on pending style
578+
changes.
579+
580+
<div><pre class="example lang-javascript">
581+
elem.style.animation = 'fadeOut 1s paused';
582+
const anim = elem.getAnimations()[0];
583+
elem.style.animationPlayState = 'running';
584+
console.log(anim.playState); // Should be 'running'.
585+
</pre></div>
586+
623587
</div>
624588
625589

css-text-3/Overview.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ Text Processing</h3>
11711171

11721172
<p class="note">
11731173
Note: The set of characters considered <a>document white space</a> (part of the document content)
1174-
and that considered syntactic white space (part of the CSS syntax)
1174+
and those considered syntactic white space (part of the CSS syntax)
11751175
are not necessarily identical.
11761176
However, since both include spaces (U+0020), tabs (U+0009), and line feeds (U+000A)
11771177
most authors won't notice any differences.

css-transitions-2/Overview.bs

Lines changed: 79 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,22 @@ Level: 2
2525
Group: csswg
2626
ED: https://drafts.csswg.org/css-transitions-2/
2727
Editor: 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
2829
Issue Tracking: Bugzilla bugs for all levels https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;product=CSS&amp;component=Transitions&amp;resolution=---
2930
Abstract: CSS Transitions allows property changes in CSS values to occur smoothly over a specified duration.
3031
Ignored 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>
5661
spec: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

7777
Although the 'transition-property' may specify shorthand properties and the
7878
''all'' keyword, individual transitions are generated for each longhand
7979
sub-property that is animatable. The <dfn>expanded transition property
8080
name</dfn> of a transition is the name of the longhand sub-property for which
8181
the 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

8994
Note: Unlike CSS animations, the timing function for CSS transitions applies to
9095
the animation effect as opposed to the individual keyframes since this allows
9196
it to be reflected in the <a>transformed progress</a> as used when calculating
9297
the 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

96107
The <dfn>owning element</dfn> of a transition refers to the element or
97108
pseudo-element to which the 'transition-property' property was applied that
98109
generated 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 &lsquo;CSS Transition&rsquo;.
155+
<a spec='web-animations'>Animations</a> generated from the markup defined in
156+
this specification have an <a>animation class</a> of &lsquo;CSS
157+
Transition&rsquo;.
118158

119159
CSS Transitions have an <em>earlier</em> composite order that CSS Animations
120160
and animations without a specific <a>animation class</a>.
@@ -165,8 +205,16 @@ Note, this behavior relies on the fact that disassociating a transition
165205
from 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 &lsquo;CSS Transition&rsquo;
211+
that have an [=owning element=]
212+
are applied to the &lsquo;Transitions declaration&rsquo; 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 &lsquo;Animation declarations&rsquo; 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

414415
Various operations may affect the <a lt="computed value">computed values</a> of
@@ -423,7 +424,7 @@ changes to computed values.
423424
<div class="note">
424425
As 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

428429
The first time this occurs, calling {{Window/getComputedStyle(elt)}} and
429430
subsequently accessing the <code>opacity</code> property of the result will

0 commit comments

Comments
 (0)