-
Notifications
You must be signed in to change notification settings - Fork 708
/
Copy pathOverview.html
753 lines (749 loc) · 64.9 KB
/
Overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
<!doctype html><html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Transitions Level 2</title>
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<meta content="exploring" name="csswg-work-status">
<meta content="ED" name="w3c-status">
<link href="../default.css" rel="stylesheet" type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
body {
background-image: url("https://www.w3.org/StyleSheets/TR/logo-ED");
};
</style>
<meta content="Bikeshed 1.0.0" name="generator">
<style>
.dfn-panel {
display: inline-block;
position: absolute;
z-index: 35;
height: auto;
width: -webkit-fit-content;
max-width: 300px;
max-height: 500px;
overflow: auto;
padding: 0.5em 0.75em;
font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
background: #DDDDDD;
color: black;
border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel > span { display: list-item; list-style: inside; }
.dfn-panel.activated {
display: inline-block;
position: fixed;
left: .5em;
bottom: .5em;
margin: 0 auto;
max-width: calc(100vw - 1.5em - .4em - .5em);
max-height: 30vh;
}
.dfn-paneled { cursor: pointer; }
</style>
<style>.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight .c { color: #708090 } /* Comment */
.highlight .k { color: #990055 } /* Keyword */
.highlight .l { color: #000000 } /* Literal */
.highlight .n { color: #0077aa } /* Name */
.highlight .o { color: #999999 } /* Operator */
.highlight .p { color: #999999 } /* Punctuation */
.highlight .cm { color: #708090 } /* Comment.Multiline */
.highlight .cp { color: #708090 } /* Comment.Preproc */
.highlight .c1 { color: #708090 } /* Comment.Single */
.highlight .cs { color: #708090 } /* Comment.Special */
.highlight .kc { color: #990055 } /* Keyword.Constant */
.highlight .kd { color: #990055 } /* Keyword.Declaration */
.highlight .kn { color: #990055 } /* Keyword.Namespace */
.highlight .kp { color: #990055 } /* Keyword.Pseudo */
.highlight .kr { color: #990055 } /* Keyword.Reserved */
.highlight .kt { color: #990055 } /* Keyword.Type */
.highlight .ld { color: #000000 } /* Literal.Date */
.highlight .m { color: #000000 } /* Literal.Number */
.highlight .s { color: #a67f59 } /* Literal.String */
.highlight .na { color: #0077aa } /* Name.Attribute */
.highlight .nc { color: #0077aa } /* Name.Class */
.highlight .no { color: #0077aa } /* Name.Constant */
.highlight .nd { color: #0077aa } /* Name.Decorator */
.highlight .ni { color: #0077aa } /* Name.Entity */
.highlight .ne { color: #0077aa } /* Name.Exception */
.highlight .nf { color: #0077aa } /* Name.Function */
.highlight .nl { color: #0077aa } /* Name.Label */
.highlight .nn { color: #0077aa } /* Name.Namespace */
.highlight .py { color: #0077aa } /* Name.Property */
.highlight .nt { color: #669900 } /* Name.Tag */
.highlight .nv { color: #0077aa } /* Name.Variable */
.highlight .ow { color: #999999 } /* Operator.Word */
.highlight .mb { color: #000000 } /* Literal.Number.Bin */
.highlight .mf { color: #000000 } /* Literal.Number.Float */
.highlight .mh { color: #000000 } /* Literal.Number.Hex */
.highlight .mi { color: #000000 } /* Literal.Number.Integer */
.highlight .mo { color: #000000 } /* Literal.Number.Oct */
.highlight .sb { color: #a67f59 } /* Literal.String.Backtick */
.highlight .sc { color: #a67f59 } /* Literal.String.Char */
.highlight .sd { color: #a67f59 } /* Literal.String.Doc */
.highlight .s2 { color: #a67f59 } /* Literal.String.Double */
.highlight .se { color: #a67f59 } /* Literal.String.Escape */
.highlight .sh { color: #a67f59 } /* Literal.String.Heredoc */
.highlight .si { color: #a67f59 } /* Literal.String.Interpol */
.highlight .sx { color: #a67f59 } /* Literal.String.Other */
.highlight .sr { color: #a67f59 } /* Literal.String.Regex */
.highlight .s1 { color: #a67f59 } /* Literal.String.Single */
.highlight .ss { color: #a67f59 } /* Literal.String.Symbol */
.highlight .vc { color: #0077aa } /* Name.Variable.Class */
.highlight .vg { color: #0077aa } /* Name.Variable.Global */
.highlight .vi { color: #0077aa } /* Name.Variable.Instance */
.highlight .il { color: #000000 } /* Literal.Number.Integer.Long */
.highlight { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
</style>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"><a class="logo" href="http://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
<h1 class="p-name no-ref" id="title">CSS Transitions Level 2</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2016-04-28">28 April 2016</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="https://drafts.csswg.org/css-transitions-2/">https://drafts.csswg.org/css-transitions-2/</a>
<dt>Feedback:
<dd><span><a href="mailto:www-style@w3.org?subject=%5Bcss-transitions-2%5D%20YOUR%20TOPIC%20HERE">www-style@w3.org</a> with subject line “<kbd>[css-transitions-2] <i data-lt="">… message topic …</i></kbd>” (<a href="http://lists.w3.org/Archives/Public/www-style/" rel="discussion">archives</a>)</span>
<dt>Issue Tracking:
<dd><a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;product=CSS&amp;component=Transitions&amp;resolution=---">Bugzilla bugs for all levels</a>
<dd><a href="#issues-index">Inline In Spec</a>
<dt class="editor">Editor:
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:dbaron@dbaron.org">L. David Baron</a> (<span class="p-org org">Mozilla</span>)
</dl>
</div>
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2016 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply. </p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
<div class="p-summary" data-fill-with="abstract">
<p>CSS Transitions allows property changes in CSS values to occur smoothly over a specified duration.</p>
<a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.
</div>
<h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
<div data-fill-with="status">
<p> 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. </p>
<p> The (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public mailing list <a href="mailto:www-style@w3.org?Subject=%5Bcss-transitions-2%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a> (see <a href="http://www.w3.org/Mail/Request">instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-transitions-2” in the subject,
preferably like this:
“[css-transitions-2] <em>…summary of comment…</em>” </p>
<p> This document was produced by the <a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of the <a href="http://www.w3.org/Style/">Style Activity</a>). </p>
<p> This document was produced by a group operating under
the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> 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 <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
<p> This document is governed by the <a href="http://www.w3.org/2015/Process-20150901/" id="w3c_process_revision">1 September 2015 W3C Process Document</a>. </p>
<p></p>
</div>
<div data-fill-with="at-risk"></div>
<nav data-fill-with="table-of-contents" id="toc">
<h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
<ol class="toc" role="directory">
<li><a href="#delta"><span class="secno">1</span> <span class="content">Delta specification</span></a>
<li>
<a href="#starting"><span class="secno">2</span> <span class="content">Starting of transitions</span></a>
<ol class="toc">
<li><a href="#transition-property-name"><span class="secno">2.1</span> <span class="content">The transition property name</span></a>
<li><a href="#owning-element-section"><span class="secno">2.2</span> <span class="content">Owning element</span></a>
<li><a href="#animation-composite-order"><span class="secno">2.3</span> <span class="content">Animation composite order</span></a>
</ol>
<li>
<a href="#transition-events"><span class="secno">3</span> <span class="content">Transition Events</span></a>
<ol class="toc">
<li><a href="#transition-event-types"><span class="secno">3.1</span> <span class="content">Types of <code>TransitionEvent</code></span></a>
</ol>
<li>
<a href="#interface-dom"><span class="secno">4</span> <span class="content">DOM Interfaces</span></a>
<ol class="toc">
<li><a href="#the-CSSTransition-interface"><span class="secno">4.1</span> <span class="content">The CSSTransition interface</span></a>
<li><a href="#requirements-on-pending-style-changes"><span class="secno">4.2</span> <span class="content">Requirements on pending style changes</span></a>
</ol>
<li><a href="#issues-common"><span class="secno">5</span> <span class="content">Issues commonly raised as issues with previous levels</span></a>
<li><a href="#issues-spec"><span class="secno">6</span> <span class="content">Issues deferred from previous levels of the spec</span></a>
<li>
<a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
<ol class="toc">
<li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
<li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
<li>
<a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
<ol class="toc">
<li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
<li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
<li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
</ol>
</ol>
<li>
<a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ol class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ol>
<li>
<a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ol class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
<li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
</ol>
<li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
<li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
</ol>
</nav>
<main>
<h2 class="heading settled" data-level="1" id="delta"><span class="secno">1. </span><span class="content">Delta specification</span><a class="self-link" href="#delta"></a></h2>
<p>This is a delta specification, meaning that it currently contains
only the differences from CSS Transitions Level 1 <a data-link-type="biblio" href="#biblio-css3-transitions">[CSS3-TRANSITIONS]</a>.
Once the Level 1 specification is closer to complete, it will be merged
with the additions here into a complete level 2 specification.</p>
<h2 class="heading settled" data-level="2" id="starting"><span class="secno">2. </span><span class="content">Starting of transitions</span><a class="self-link" href="#starting"></a></h2>
<p>Associated with each top-level browsing context is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="current transition
generation" data-noexport="" id="current-transition-generation">current transition
generation<span class="dfn-panel" data-deco=""><b><a href="#current-transition-generation">#current-transition-generation</a></b><b>Referenced in:</b><span><a href="#ref-for-current-transition-generation-1">2. Starting of transitions</a></span></span></dfn> that is incremented on each <a data-link-type="dfn" href="https://drafts.csswg.org/css-transitions-1/#style-change-event">style change event</a>.</p>
<p>Each time a new transition is generated, the current value of the (already
incremented) <a data-link-type="dfn" href="#current-transition-generation" id="ref-for-current-transition-generation-1">current transition generation</a> is stored as the
transition’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="transition generation" data-noexport="" id="transition-generation">transition generation<span class="dfn-panel" data-deco=""><b><a href="#transition-generation">#transition-generation</a></b><b>Referenced in:</b><span><a href="#ref-for-transition-generation-1">2.3. Animation composite order</a> <a href="#ref-for-transition-generation-2">(2)</a></span></span></dfn>.</p>
<h3 class="heading settled" data-level="2.1" id="transition-property-name"><span class="secno">2.1. </span><span class="content">The transition property name</span><a class="self-link" href="#transition-property-name"></a></h3>
<p>Although the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transitions-1/#propdef-transition-property">transition-property</a> may specify shorthand properties and the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-transitions-1/#valdef-transition-property-all">all</a> keyword, individual transitions are generated for each longhand
sub-property that is animatable. The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="expanded transition property
name" data-noexport="" id="expanded-transition-property-name">expanded transition property
name<span class="dfn-panel" data-deco=""><b><a href="#expanded-transition-property-name">#expanded-transition-property-name</a></b><b>Referenced in:</b><span><a href="#ref-for-expanded-transition-property-name-1">2.3. Animation composite order</a></span><span><a href="#ref-for-expanded-transition-property-name-2">4.1. The CSSTransition interface</a></span></span></dfn> of a transition is the name of the longhand sub-property for which
the transition was generated (e.g. <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-left-width">border-left-width</a>).</p>
<h3 class="heading settled" data-level="2.2" id="owning-element-section"><span class="secno">2.2. </span><span class="content">Owning element</span><a class="self-link" href="#owning-element-section"></a></h3>
<p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="owning element" data-noexport="" id="owning-element">owning element<span class="dfn-panel" data-deco=""><b><a href="#owning-element">#owning-element</a></b><b>Referenced in:</b><span><a href="#ref-for-owning-element-1">2.2. Owning element</a> <a href="#ref-for-owning-element-2">(2)</a> <a href="#ref-for-owning-element-3">(3)</a></span><span><a href="#ref-for-owning-element-4">2.3. Animation composite order</a> <a href="#ref-for-owning-element-5">(2)</a> <a href="#ref-for-owning-element-6">(3)</a> <a href="#ref-for-owning-element-7">(4)</a> <a href="#ref-for-owning-element-8">(5)</a> <a href="#ref-for-owning-element-9">(6)</a> <a href="#ref-for-owning-element-10">(7)</a> <a href="#ref-for-owning-element-11">(8)</a></span></span></dfn> of a transition refers to the element or
pseudo-element to which the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transitions-1/#propdef-transition-property">transition-property</a> property was applied that
generated the animation.</p>
<p>If a transition was generated directly by script (e.g. using the <code class="idl"><a data-link-type="idl" href="#csstransition" id="ref-for-csstransition-1">CSSTransition</a></code> constructor) then it has no <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-1">owning element</a>.</p>
<p>If a transition generated using the markup defined in this specification is
later disassociated from that markup because it is cancelled or replaced by
a newer transition, the animation is disassociated from its <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-2">owning
element</a> (that is, it has no <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-3">owning element</a> from that point
forwards).</p>
<p class="issue" id="issue-bdbc8bc0"><a class="self-link" href="#issue-bdbc8bc0"></a> Define the above more precisely once we rewrite firing of transitions
in terms of Web Animations concepts (specifically when we spell out when we
cancel an animation).</p>
<h3 class="heading settled" data-level="2.3" id="animation-composite-order"><span class="secno">2.3. </span><span class="content">Animation composite order</span><a class="self-link" href="#animation-composite-order"></a></h3>
<p><a data-link-type="dfn" href="https://www.w3.org/TR/web-animations/#concept-animation">Animations</a> generated from the markup and
interfaces (e.g. the <code class="idl"><a data-link-type="idl" href="#csstransition" id="ref-for-csstransition-2">CSSTransition</a></code> constructor) defined in this
specification have an <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#animation-class">animation class</a> of ‘CSS Transition’.</p>
<p>CSS Transitions have an <em>earlier</em> composite order that CSS Animations
and animations without a specific <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#animation-class">animation class</a>.</p>
<p>Within the set of CSS Transitions, two animations <var>A</var> and <var>B</var> are sorted in composite order (first to last) as follows:</p>
<ol>
<li data-md="">
<p>If neither <var>A</var> nor <var>B</var> has an <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-4">owning element</a>,
sort based on their relative position in the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#global-animation-list">global animation list</a>.</p>
<li data-md="">
<p>Otherwise, if only one of <var>A</var> or <var>B</var> has an <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-5">owning
element</a>, let the animation <em>with</em> an <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-6">owning element</a> sort
first.</p>
<li data-md="">
<p>Otherwise, if the <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-7">owning element</a> of <var>A</var> and <var>B</var> differs, sort <var>A</var> and <var>B</var> by <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-order">tree order</a> of their corresponding <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-8">owning elements</a>.
With regard to pseudo-elements, the sort order is as follows:</p>
<ul>
<li data-md="">
<p>element</p>
<li data-md="">
<p>::before</p>
<li data-md="">
<p>::after</p>
<li data-md="">
<p>element children</p>
</ul>
<li data-md="">
<p>Otherwise, if <var>A</var> and <var>B</var> have different <a data-link-type="dfn" href="#transition-generation" id="ref-for-transition-generation-1">transition
generation</a> values, sort by their corresponding <a data-link-type="dfn" href="#transition-generation" id="ref-for-transition-generation-2">transition generation</a> in ascending order.</p>
<li data-md="">
<p>Otherwise, sort <var>A</var> and <var>B</var> in ascending order by the
Unicode codepoints that make up the <a data-link-type="dfn" href="#expanded-transition-property-name" id="ref-for-expanded-transition-property-name-1">expanded transition property
name</a> of each transition (i.e. without attempting case conversion and
such that ‘-moz-column-width’ sorts before
‘column-width’).</p>
</ol>
<p>Transitions generated using the markup defined in this specification are <em>not</em> added to the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#global-animation-list">global animation list</a> when they are created.
Instead, these animations are appended to the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#global-animation-list">global animation list</a> at
the first moment when they transition out of the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#idle-play-state">idle play state</a> after
being disassociated from their <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-9">owning element</a>.
Transitions that have been disassociated from their <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-10">owning element</a> but are still <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#idle-play-state">idle</a> do not have a defined
composite order.</p>
<p class="note" role="note">Note, this behavior relies on the fact that disassociating a transition
from its <a data-link-type="dfn" href="#owning-element" id="ref-for-owning-element-11">owning element</a> always causes it to enter (or remain) in the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#idle-play-state">idle play state</a>.</p>
<p>Transitions created using the <code class="idl"><a data-link-type="idl" href="#csstransition" id="ref-for-csstransition-3">CSSTransition</a></code> constructor are appended
to the <a data-link-type="dfn" href="https://w3c.github.io/web-animations/#global-animation-list">global animation list</a> at the moment they are constructed.</p>
<h2 class="heading settled" data-level="3" id="transition-events"><span class="secno">3. </span><span class="content">Transition Events</span><a class="self-link" href="#transition-events"></a></h2>
<h3 class="heading settled" data-level="3.1" id="transition-event-types"><span class="secno">3.1. </span><span class="content">Types of <code>TransitionEvent</code></span><a class="self-link" href="#transition-event-types"></a></h3>
<p>The <em>additional</em> types of transition events that can occur are:</p>
<dl>
<dt><dfn class="dfn-paneled idl-code" data-dfn-for="transitionevent" data-dfn-type="event" data-export="" data-lt="transitionstart" id="eventdef-transitionevent-transitionstart">transitionstart<span class="dfn-panel" data-deco=""><b><a href="#eventdef-transitionevent-transitionstart">#eventdef-transitionevent-transitionstart</a></b><b>Referenced in:</b><span><a href="#ref-for-eventdef-transitionevent-transitionstart-1">3.1. Types of TransitionEvent</a></span></span></dfn>
<dd>
The <a data-link-type="idl" href="#eventdef-transitionevent-transitionstart" id="ref-for-eventdef-transitionevent-transitionstart-1">transitionstart</a> event occurs when a transition is started (i.e., when it is added to the set of <a data-link-type="dfn" href="https://drafts.csswg.org/css-transitions-1/#running-transition">running transitions</a>).
<ul>
<li>Bubbles: Yes
<li>Cancelable: No
<li>Context Info: propertyName, elapsedTime, pseudoElement
</ul>
<dt><dfn class="dfn-paneled idl-code" data-dfn-for="transitionevent" data-dfn-type="event" data-export="" data-lt="transitioncancel" id="eventdef-transitionevent-transitioncancel">transitioncancel<span class="dfn-panel" data-deco=""><b><a href="#eventdef-transitionevent-transitioncancel">#eventdef-transitionevent-transitioncancel</a></b><b>Referenced in:</b><span><a href="#ref-for-eventdef-transitionevent-transitioncancel-1">3.1. Types of TransitionEvent</a></span></span></dfn>
<dd>
The <a data-link-type="idl" href="#eventdef-transitionevent-transitioncancel" id="ref-for-eventdef-transitionevent-transitioncancel-1">transitioncancel</a> event occurs when a transition is <a data-link-type="dfn" href="https://drafts.csswg.org/css-transitions-1/#transition-cancel">cancelled</a>.
<ul>
<li>Bubbles: Yes
<li>Cancelable: No
<li>Context Info: propertyName, elapsedTime, pseudoElement
</ul>
</dl>
<h2 class="heading settled" data-level="4" id="interface-dom"><span class="secno">4. </span><span class="content">DOM Interfaces</span><a class="self-link" href="#interface-dom"></a></h2>
<h3 class="heading settled" data-level="4.1" id="the-CSSTransition-interface"><span class="secno">4.1. </span><span class="content">The CSSTransition interface</span><a class="self-link" href="#the-CSSTransition-interface"></a></h3>
<pre class="idl def">interface <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export="" data-lt="CSSTransition" id="csstransition">CSSTransition<span class="dfn-panel" data-deco=""><b><a href="#csstransition">#csstransition</a></b><b>Referenced in:</b><span><a href="#ref-for-csstransition-1">2.2. Owning element</a></span><span><a href="#ref-for-csstransition-2">2.3. Animation composite order</a> <a href="#ref-for-csstransition-3">(2)</a></span><span><a href="#ref-for-csstransition-4">4.1. The CSSTransition interface</a> <a href="#ref-for-csstransition-5">(2)</a></span><span><a href="#ref-for-csstransition-6">4.2. Requirements on pending style changes</a> <a href="#ref-for-csstransition-7">(2)</a></span></span></dfn> : <a data-link-type="idl-name" href="https://w3c.github.io/web-animations/#animation">Animation</a> {
readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-csstransition-transitionproperty" id="ref-for-dom-csstransition-transitionproperty-1">transitionProperty</a>;
};
</pre>
<dl>
<dt data-md="">
<p><dfn class="dfn-paneled idl-code" data-dfn-for="CSSTransition" data-dfn-type="attribute" data-export="" data-lt="transitionProperty" id="dom-csstransition-transitionproperty">transitionProperty<span class="dfn-panel" data-deco=""><b><a href="#dom-csstransition-transitionproperty">#dom-csstransition-transitionproperty</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-csstransition-transitionproperty-1">4.1. The CSSTransition interface</a></span></span></dfn>, <span> of type <a data-link-type="idl-name" href="https://heycam.github.io/webidl/#idl-DOMString">DOMString</a>, readonly</span></p>
<dd data-md="">
<p>The <a data-link-type="dfn" href="#expanded-transition-property-name" id="ref-for-expanded-transition-property-name-2">expanded transition property name</a> of this transition.</p>
</dl>
<div class="issue" id="issue-861d9310">
<a class="self-link" href="#issue-861d9310"></a>
<p>This interface needs a constructor. Perhaps something like the following,</p>
<pre class="idl def">[<dfn class="idl-code" data-dfn-for="CSSTransition" data-dfn-type="constructor" data-export="" data-lt="CSSTransition(target, transitionProperty, transitionValue, options)|CSSTransition(target, transitionProperty, transitionValue)" id="dom-csstransition-csstransition">Constructor<a class="self-link" href="#dom-csstransition-csstransition"></a></dfn> (<a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#animatable">Animatable</a>? <dfn class="idl-code" data-dfn-for="CSSTransition/CSSTransition(target, transitionProperty, transitionValue, options)" data-dfn-type="argument" data-export="" id="dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-target">target<a class="self-link" href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-target"></a></dfn>,
DOMString <dfn class="idl-code" data-dfn-for="CSSTransition/CSSTransition(target, transitionProperty, transitionValue, options)" data-dfn-type="argument" data-export="" id="dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-transitionproperty">transitionProperty<a class="self-link" href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-transitionproperty"></a></dfn>,
any <dfn class="idl-code" data-dfn-for="CSSTransition/CSSTransition(target, transitionProperty, transitionValue, options)" data-dfn-type="argument" data-export="" id="dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-transitionvalue">transitionValue<a class="self-link" href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-transitionvalue"></a></dfn>,
optional (unrestricted double or <a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#dictdef-keyframeeffectoptions">KeyframeEffectOptions</a>) <dfn class="idl-code" data-dfn-for="CSSTransition/CSSTransition(target, transitionProperty, transitionValue, options)" data-dfn-type="argument" data-export="" id="dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-options">options<a class="self-link" href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-options"></a></dfn>),
<dfn class="idl-code" data-dfn-for="CSSTransition" data-dfn-type="constructor" data-export="" data-lt="CSSTransition(target, transitionProperty, transitionValue, options, timeline)" id="dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline">Constructor<a class="self-link" href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline"></a></dfn> (<a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#animatable">Animatable</a>? <dfn class="idl-code" data-dfn-for="CSSTransition/CSSTransition(target, transitionProperty, transitionValue, options, timeline)" data-dfn-type="argument" data-export="" id="dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-target">target<a class="self-link" href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-target"></a></dfn>,
DOMString <dfn class="idl-code" data-dfn-for="CSSTransition/CSSTransition(target, transitionProperty, transitionValue, options, timeline)" data-dfn-type="argument" data-export="" id="dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-transitionproperty">transitionProperty<a class="self-link" href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-transitionproperty"></a></dfn>,
any <dfn class="idl-code" data-dfn-for="CSSTransition/CSSTransition(target, transitionProperty, transitionValue, options, timeline)" data-dfn-type="argument" data-export="" id="dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-transitionvalue">transitionValue<a class="self-link" href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-transitionvalue"></a></dfn>,
(unrestricted double or <a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#dictdef-keyframeeffectoptions">KeyframeEffectOptions</a>) <dfn class="idl-code" data-dfn-for="CSSTransition/CSSTransition(target, transitionProperty, transitionValue, options, timeline)" data-dfn-type="argument" data-export="" id="dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-options">options<a class="self-link" href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-options"></a></dfn>,
<a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#animationtimeline">AnimationTimeline</a>? <dfn class="idl-code" data-dfn-for="CSSTransition/CSSTransition(target, transitionProperty, transitionValue, options, timeline)" data-dfn-type="argument" data-export="" id="dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-timeline">timeline<a class="self-link" href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-timeline"></a></dfn>)]
partial interface <a class="idl-code" data-link-type="interface" href="#csstransition" id="ref-for-csstransition-4">CSSTransition</a> { };
</pre>
<p>Using <code>any</code> as the type for <code>transitionValue</code> would allow
the following usage:</p>
<pre class="example lang-javascript" id="example-36ca8d2f"><a class="self-link" href="#example-36ca8d2f"></a>var transition = new CSSTransition(elem, 'opacity', 1, 2000);
transition.play();
</pre>
<p>The above example, however, is <em>not</em> equivalent to triggering a
transition. It has the following differences:</p>
<ul>
<li data-md="">
<p>It does not update the specified style.</p>
<li data-md="">
<p>It would not cancel any existing transition on the given property unless
we add special wording to that effect.</p>
<li data-md="">
<p>It would exhibit different composite order to a regular transition
(this should be easily fixed, however).</p>
<li data-md="">
<p>It has been suggested that <a href="https://github.com/w3c/web-animations/issues/62#issuecomment-117357703">script-generated
animations should not apply to the transition level of the cascade</a>.</p>
</ul>
<p>It is unclear how much we should extend the <code class="idl"><a data-link-type="idl" href="#csstransition" id="ref-for-csstransition-5">CSSTransition</a></code> constructor to
overcome the above limitations so that it can be used to generate transitions
programmatically, or whether we should introduce a separate helper method such
as has been <a href="https://lists.w3.org/Archives/Public/www-style/2011Mar/0729.html">suggested
elsewhere</a>.</p>
</div>
<h3 class="heading settled" data-level="4.2" id="requirements-on-pending-style-changes"><span class="secno">4.2. </span><span class="content">Requirements on pending style changes</span><a class="self-link" href="#requirements-on-pending-style-changes"></a></h3>
<p>Various operations may affect the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#computed-value">computed values</a> 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 <a data-link-type="biblio" href="#biblio-web-animations">[WEB-ANIMATIONS]</a> that may return objects defined by this specification,
must produce a result consistent with having fully processed any such pending
changes to computed values.</p>
<div class="note" role="note">
As an example, in the following code fragment, when the specified value of <code>elem</code>’s <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-color-4/#propdef-opacity">opacity</a> property is updated, a user agent may defer
recalculating the computed value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation">animation</a> property.
<p>The first time this occurs, calling <code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/cssom-1/#dom-window-getcomputedstyle">getComputedStyle(elt)</a></code> and
subsequently accessing the <code>opacity</code> property of the result will
cause the user agent to recompute the value of opacity.</p>
<p>After the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-color-4/#propdef-opacity">opacity</a> property is updated a second time, the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/web-animations/#dom-animatable-getanimations">getAnimations()</a></code> method is called on <code>elem</code>.
This method is specified by Web Animations and can return <code class="idl"><a data-link-type="idl" href="#csstransition" id="ref-for-csstransition-6">CSSTransition</a></code> objects as defined in this specification.
Hence, as result of the requirements in this section, the user agent must apply
any pending style changes thus generating a new <code class="idl"><a data-link-type="idl" href="#csstransition" id="ref-for-csstransition-7">CSSTransition</a></code> for the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-color-4/#propdef-opacity">opacity</a> property before returning its result.</p>
<div>
<pre class="example lang-javascript" id="example-e4db8bb0"><a class="self-link" href="#example-e4db8bb0"></a>elem.style.transition = 'opacity 100s';
elem.style.opacity = '0';
window.getComputedStyle(elem).opacity; // 0
elem.style.opacity = '1';
elem.getAnimations()[0].transitionProperty // 'opacity'
</pre>
</div>
</div>
<h2 class="heading settled" data-level="5" id="issues-common"><span class="secno">5. </span><span class="content">Issues commonly raised as issues with previous levels</span><a class="self-link" href="#issues-common"></a></h2>
<p> These issues were commonly reported issues
with the previous level of the specification. </p>
<div class="issue" id="issue-3a621af8">
<a class="self-link" href="#issue-3a621af8"></a>
<p> More powerful timing function syntax
is a common request from developers.
See, for example: <a href="https://lists.w3.org/Archives/Public/www-style/2013Jun/0376.html">2013 message</a> or <a href="https://lists.w3.org/Archives/Public/public-fx/2015JulSep/thread.html#msg34">2015 thread</a>. </p>
</div>
<div class="issue" id="issue-c2a86011">
<a class="self-link" href="#issue-c2a86011"></a>
<p> Developers frequently have to trigger style flushes
in order to force transitions to start.
It would be good to have an API
that would avoid this requirement.
See, for example, <a href="https://lists.w3.org/Archives/Public/www-style/2011Mar/0729.html">2011 proposal</a>. </p>
</div>
<h2 class="heading settled" data-level="6" id="issues-spec"><span class="secno">6. </span><span class="content">Issues deferred from previous levels of the spec</span><a class="self-link" href="#issues-spec"></a></h2>
<p> These issues were in previous levels of the specification,
but may not turn out to be important in this level either. </p>
<div class="issue" id="issue-21a432a0"><a class="self-link" href="#issue-21a432a0"></a> We may ultimately want to support a keypath syntax
for the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transitions-1/#propdef-transition-property">transition-property</a> property.
A keypath syntax
would enable different transitions
to be specified
for components of a property.
For example
the blur of a shadow
could have
a different transition
than the color of a shadow. </div>
</main>
<h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
<h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
<p>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. </p>
<p>All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
<p>Examples in this specification are introduced with the words “for example”
or are set apart from the normative text with <code>class="example"</code>,
like this: </p>
<div class="example" id="example-52448c84">
<a class="self-link" href="#example-52448c84"></a>
<p>This is an example of an informative example. </p>
</div>
<p>Informative notes begin with the word “Note” and are set apart from the
normative text with <code>class="note"</code>, like this: </p>
<p class="note" role="note">Note, this is an informative note. </p>
<p>Advisements are normative sections styled to evoke special attention and are
set apart from other normative text with <code><strong class="advisement"></code>, like
this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
<h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
<p>Conformance to this specification
is defined for three conformance classes: </p>
<dl>
<dt>style sheet
<dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
style sheet</a>.
<dt>renderer
<dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
documents that use them.
<dt>authoring tool
<dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet.
</dl>
<p>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. </p>
<p>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.) </p>
<p>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. </p>
<h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
<p>The following sections define several conformance requirements
for implementing CSS responsibly,
in a way that promotes interoperability in the present and future. </p>
<h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
<p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
any at-rules, properties, property values, keywords, and other syntactic constructs
for which they have no usable level of support</strong>.
In particular, user agents <em>must not</em> 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. </p>
<h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
<p>To avoid clashes with future stable CSS features,
the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
<h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
<p>Once a specification reaches the Candidate Recommendation stage,
implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> 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. </p>
<p>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. </p>
<p>
Further information on submitting testcases and implementation reports
can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list.
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
</p>
<h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
<h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
<ul class="index">
<li><a href="#csstransition">CSSTransition</a><span>, in §4.1</span>
<li><a href="#dom-csstransition-csstransition">CSSTransition(target, transitionProperty, transitionValue)</a><span>, in §4.1</span>
<li><a href="#dom-csstransition-csstransition">CSSTransition(target, transitionProperty, transitionValue, options)</a><span>, in §4.1</span>
<li><a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline">CSSTransition(target, transitionProperty, transitionValue, options, timeline)</a><span>, in §4.1</span>
<li><a href="#current-transition-generation">current transition
generation</a><span>, in §2</span>
<li><a href="#expanded-transition-property-name">expanded transition property
name</a><span>, in §2.1</span>
<li><a href="#owning-element">owning element</a><span>, in §2.2</span>
<li><a href="#eventdef-transitionevent-transitioncancel">transitioncancel</a><span>, in §3.1</span>
<li><a href="#transition-generation">transition generation</a><span>, in §2</span>
<li><a href="#dom-csstransition-transitionproperty">transitionProperty</a><span>, in §4.1</span>
<li><a href="#eventdef-transitionevent-transitionstart">transitionstart</a><span>, in §3.1</span>
</ul>
<h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
<ul class="index">
<li>
<a data-link-type="biblio" href="#biblio-css-animations-1">[css-animations-1]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-animations-1/#propdef-animation">animation</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-backgrounds-3">[css-backgrounds-3]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-backgrounds-3/#border-left-width">border-left-width</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-cascade-4">[css-cascade-4]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-cascade-4/#computed-value">computed value</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-color-4">[css-color-4]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-color-4/#propdef-opacity">opacity</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-css-transitions-1">[css-transitions-1]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/css-transitions-1/#valdef-transition-property-all">all</a>
<li><a href="https://drafts.csswg.org/css-transitions-1/#transition-cancel">cancel</a>
<li><a href="https://drafts.csswg.org/css-transitions-1/#running-transition">running transition</a>
<li><a href="https://drafts.csswg.org/css-transitions-1/#style-change-event">style change event</a>
<li><a href="https://drafts.csswg.org/css-transitions-1/#propdef-transition-property">transition-property</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-cssom-1">[cssom-1]</a> defines the following terms:
<ul>
<li><a href="https://drafts.csswg.org/cssom-1/#dom-window-getcomputedstyle">getComputedStyle(elt)</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-whatwg-dom">[WHATWG-DOM]</a> defines the following terms:
<ul>
<li><a href="https://dom.spec.whatwg.org/#concept-tree-order">tree order</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-web-animations">[web-animations]</a> defines the following terms:
<ul>
<li><a href="https://w3c.github.io/web-animations/#animation">Animation</a>
<li><a href="https://w3c.github.io/web-animations/#animation-class">animation class</a>
<li><a href="https://w3c.github.io/web-animations/#global-animation-list">global animation list</a>
<li><a href="https://w3c.github.io/web-animations/#idle-play-state">idle play state</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-web-animations-1">[web-animations-1]</a> defines the following terms:
<ul>
<li><a href="https://www.w3.org/TR/web-animations/#animatable">Animatable</a>
<li><a href="https://www.w3.org/TR/web-animations/#animationtimeline">AnimationTimeline</a>
<li><a href="https://www.w3.org/TR/web-animations/#dictdef-keyframeeffectoptions">KeyframeEffectOptions</a>
<li><a href="https://www.w3.org/TR/web-animations/#concept-animation">animation</a>
<li><a href="https://www.w3.org/TR/web-animations/#dom-animatable-getanimations">getAnimations()</a>
</ul>
<li>
<a data-link-type="biblio" href="#biblio-webidl">[WebIDL]</a> defines the following terms:
<ul>
<li><a href="https://heycam.github.io/webidl/#idl-DOMString">DOMString</a>
</ul>
</ul>
<h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
<h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
<dl>
<dt id="biblio-css-backgrounds-3">[CSS-BACKGROUNDS-3]
<dd>CSS Backgrounds and Borders Module Level 3 URL: <a href="https://drafts.csswg.org/css-backgrounds-3/">https://drafts.csswg.org/css-backgrounds-3/</a>
<dt id="biblio-css-cascade-4">[CSS-CASCADE-4]
<dd>Elika Etemad; Tab Atkins Jr.. <a href="http://dev.w3.org/csswg/css-cascade/">CSS Cascading and Inheritance Level 4</a>. 14 January 2016. CR. URL: <a href="http://dev.w3.org/csswg/css-cascade/">http://dev.w3.org/csswg/css-cascade/</a>
<dt id="biblio-css-transitions-1">[CSS-TRANSITIONS-1]
<dd>CSS Transitions Module Level 1 URL: <a href="https://drafts.csswg.org/css-transitions-1/">https://drafts.csswg.org/css-transitions-1/</a>
<dt id="biblio-css3-transitions">[CSS3-TRANSITIONS]
<dd>Dean Jackson; et al. <a href="http://www.w3.org/TR/css3-transitions/">CSS Transitions</a>. 19 November 2013. WD. URL: <a href="http://www.w3.org/TR/css3-transitions/">http://www.w3.org/TR/css3-transitions/</a>
<dt id="biblio-rfc2119">[RFC2119]
<dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
<dt id="biblio-web-animations">[WEB-ANIMATIONS]
<dd>Brian Birtles; et al. <a href="http://www.w3.org/TR/web-animations-1/">Web Animations</a>. 7 July 2015. WD. URL: <a href="http://www.w3.org/TR/web-animations-1/">http://www.w3.org/TR/web-animations-1/</a>
<dt id="biblio-web-animations-1">[WEB-ANIMATIONS-1]
<dd>Brian Birtles; et al. <a href="https://w3c.github.io/web-animations/">Web Animations</a>. 7 July 2015. WD. URL: <a href="https://w3c.github.io/web-animations/">https://w3c.github.io/web-animations/</a>
<dt id="biblio-webidl">[WebIDL]
<dd>Cameron McCormack; Boris Zbarsky. <a href="https://heycam.github.io/webidl/">WebIDL Level 1</a>. 8 March 2016. CR. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
<dt id="biblio-whatwg-dom">[WHATWG-DOM]
<dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
</dl>
<h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
<dl>
<dt id="biblio-css-animations-1">[CSS-ANIMATIONS-1]
<dd>CSS Animations Module Level 1 URL: <a href="https://www.w3.org/TR/css3-animations/">https://www.w3.org/TR/css3-animations/</a>
<dt id="biblio-css-color-4">[CSS-COLOR-4]
<dd>CSS Color Module Level 4 URL: <a href="https://drafts.csswg.org/css-color-4/">https://drafts.csswg.org/css-color-4/</a>
<dt id="biblio-cssom-1">[CSSOM-1]
<dd>Simon Pieters; Glenn Adams. <a href="http://www.w3.org/TR/cssom-1/">CSS Object Model (CSSOM)</a>. 17 March 2016. WD. URL: <a href="http://www.w3.org/TR/cssom-1/">http://www.w3.org/TR/cssom-1/</a>
</dl>
<h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
<pre class="idl def">interface <a href="#csstransition">CSSTransition</a> : <a data-link-type="idl-name" href="https://w3c.github.io/web-animations/#animation">Animation</a> {
readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-csstransition-transitionproperty">transitionProperty</a>;
};
[<a href="#dom-csstransition-csstransition">Constructor</a> (<a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#animatable">Animatable</a>? <a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-target">target</a>,
DOMString <a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-transitionproperty">transitionProperty</a>,
any <a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-transitionvalue">transitionValue</a>,
optional (unrestricted double or <a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#dictdef-keyframeeffectoptions">KeyframeEffectOptions</a>) <a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-options">options</a>),
<a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline">Constructor</a> (<a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#animatable">Animatable</a>? <a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-target">target</a>,
DOMString <a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-transitionproperty">transitionProperty</a>,
any <a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-transitionvalue">transitionValue</a>,
(unrestricted double or <a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#dictdef-keyframeeffectoptions">KeyframeEffectOptions</a>) <a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-options">options</a>,
<a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#animationtimeline">AnimationTimeline</a>? <a href="#dom-csstransition-csstransition-target-transitionproperty-transitionvalue-options-timeline-timeline">timeline</a>)]
partial interface <a class="idl-code" data-link-type="interface" href="#csstransition">CSSTransition</a> { };
</pre>
<h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
<div style="counter-reset:issue">
<div class="issue"> Define the above more precisely once we rewrite firing of transitions
in terms of Web Animations concepts (specifically when we spell out when we
cancel an animation).<a href="#issue-bdbc8bc0"> ↵ </a></div>
<div class="issue">
<p>This interface needs a constructor. Perhaps something like the following,</p>
<pre class="idl def">[<span>Constructor</span> (<a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#animatable">Animatable</a>? <span>target</span>,
DOMString <span>transitionProperty</span>,
any <span>transitionValue</span>,
optional (unrestricted double or <a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#dictdef-keyframeeffectoptions">KeyframeEffectOptions</a>) <span>options</span>),
<span>Constructor</span> (<a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#animatable">Animatable</a>? <span>target</span>,
DOMString <span>transitionProperty</span>,
any <span>transitionValue</span>,
(unrestricted double or <a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#dictdef-keyframeeffectoptions">KeyframeEffectOptions</a>) <span>options</span>,
<a data-link-type="idl-name" href="https://www.w3.org/TR/web-animations/#animationtimeline">AnimationTimeline</a>? <span>timeline</span>)]
partial interface <a class="idl-code" data-link-type="interface" href="#csstransition">CSSTransition</a> { };
</pre>
<p>Using <code>any</code> as the type for <code>transitionValue</code> would allow
the following usage:</p>
<pre class="example lang-javascript highlight"><span class="kd">var</span> <span class="nx">transition</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CSSTransition</span><span class="p">(</span><span class="nx">elem</span><span class="p">,</span> <span class="s1">'opacity'</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2000</span><span class="p">);</span>
<span class="nx">transition</span><span class="p">.</span><span class="nx">play</span><span class="p">();</span></pre>
<p>The above example, however, is <em>not</em> equivalent to triggering a
transition. It has the following differences:</p>
<ul>
<li data-md="">
<p>It does not update the specified style.</p>
<li data-md="">
<p>It would not cancel any existing transition on the given property unless
we add special wording to that effect.</p>
<li data-md="">
<p>It would exhibit different composite order to a regular transition
(this should be easily fixed, however).</p>
<li data-md="">
<p>It has been suggested that <a href="https://github.com/w3c/web-animations/issues/62#issuecomment-117357703">script-generated
animations should not apply to the transition level of the cascade</a>.</p>
</ul>
<p>It is unclear how much we should extend the <code class="idl"><a data-link-type="idl" href="#csstransition">CSSTransition</a></code> constructor to
overcome the above limitations so that it can be used to generate transitions
programmatically, or whether we should introduce a separate helper method such
as has been <a href="https://lists.w3.org/Archives/Public/www-style/2011Mar/0729.html">suggested
elsewhere</a>.</p>
<a href="#issue-861d9310"> ↵ </a>
</div>
<div class="issue">
<p> More powerful timing function syntax
is a common request from developers.
See, for example: <a href="https://lists.w3.org/Archives/Public/www-style/2013Jun/0376.html">2013 message</a> or <a href="https://lists.w3.org/Archives/Public/public-fx/2015JulSep/thread.html#msg34">2015 thread</a>. </p>
<a href="#issue-3a621af8"> ↵ </a>
</div>
<div class="issue">
<p> Developers frequently have to trigger style flushes
in order to force transitions to start.
It would be good to have an API
that would avoid this requirement.
See, for example, <a href="https://lists.w3.org/Archives/Public/www-style/2011Mar/0729.html">2011 proposal</a>. </p>
<a href="#issue-c2a86011"> ↵ </a>
</div>
<div class="issue"> We may ultimately want to support a keypath syntax
for the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transitions-1/#propdef-transition-property">transition-property</a> property.
A keypath syntax
would enable different transitions
to be specified
for components of a property.
For example
the blur of a shadow
could have
a different transition
than the color of a shadow. <a href="#issue-21a432a0"> ↵ </a></div>
</div>
<script>
document.body.addEventListener("click", function(e) {
var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
// Find the dfn element or panel, if any, that was clicked on.
var el = e.target;
var target;
while(el.parentElement) {
if(el.tagName == "DFN") {
target = "dfn";
break;
}
if(/H\d/.test(el.tagName) && el.getAttribute('data-dfn-type') != null) {
target = "dfn";
break;
}
if(el.classList.contains("dfn-panel")) {
target = "dfn-panel";
break;
}
el = el.parentElement;
}
if(target != "dfn-panel") {
// Turn off any currently "on" or "activated" panels.
queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
el.classList.remove("on");
el.classList.remove("activated");
});
}
if(target == "dfn") {
// open the panel
var dfnPanel = el.querySelector(".dfn-panel");
if(dfnPanel) {
dfnPanel.classList.add("on");
}
} else if(target == "dfn-panel") {
// Switch it to "activated" state, which pins it.
el.classList.add("activated");
}
});
</script>