@@ -502,7 +502,8 @@ url: http://dev.w3.org/csswg/css-color-3/#html4; type: value; text: green;
502
502
</h2>
503
503
504
504
<p>
505
- Implementations must maintain a set of running transitions,
505
+ Implementations must maintain a set of
506
+ <dfn title="running transition">running transitions</dfn> ,
506
507
each of which applies to a specific element and non-shorthand
507
508
property. Each of these transitions also has a
508
509
<dfn>start time</dfn> , <dfn>end time</dfn> , <dfn>start value</dfn> ,
@@ -512,6 +513,46 @@ url: http://dev.w3.org/csswg/css-color-3/#html4; type: value; text: green;
512
513
and are removed from this set
513
514
when they <a>complete</a>
514
515
or when implementations are required to <dfn>cancel</dfn> them.
516
+ <span class="note">
517
+ For the rationale behind the <a>reversing-adjusted start value</a>
518
+ and <a>reversing shortening factor</a> , see [[#reversing]] .
519
+ </span>
520
+ </p>
521
+
522
+ <p>
523
+ Implementations must also maintain a set of
524
+ <dfn title="completed transition">completed transitions</dfn> ,
525
+ each of which
526
+ (like <a title="running transition">running transitions</a> )
527
+ applies to a specific element and non-shorthand property.
528
+ <span class="note">
529
+ This specification maintains the invariant that
530
+ there is never both a <a>running transition</a> and
531
+ a <a>completed transition</a> for the same property and element.
532
+ </span>
533
+ <span class="note">
534
+ This set of completed transitions
535
+ needs to be maintained
536
+ in order to prevent
537
+ transitions from repeating themselves in certain cases,
538
+ i.e., to maintain the invariant
539
+ that this specification tries to maintain
540
+ that unrelated style changes do not trigger transitions.
541
+ </span>
542
+ </p>
543
+
544
+ <p class="example">
545
+ An example where maintaining the set of completed transitions
546
+ is necessary would be a transition on
547
+ an inherited property,
548
+ where the parent specifies a transition of that property for
549
+ a longer duration (say, ''transition: 4s text-indent'' )
550
+ and a child element that inherits the parent's value specifies
551
+ a transition of the same property for a shorter duration
552
+ (say, ''transition: 1s text-indent'' ).
553
+ Without the maintenance of this set of completed transitions,
554
+ implementations could start additional transitions on the child
555
+ after the initial 1 second transition on the child completes.
515
556
</p>
516
557
517
558
<p>
@@ -637,13 +678,33 @@ url: http://dev.w3.org/csswg/css-color-3/#html4; type: value; text: green;
637
678
638
679
<ol>
639
680
<li>
640
- If the element does not have a running transition for the property,
641
- the <a>before-change style</a> is different from
642
- and can be interpolated with
643
- the <a>after-change style</a> for that property,
644
- there is a <a>matching transition-property value</a> ,
645
- and the <a>combined duration</a> is greater than ''0s'' ,
646
- implementations must
681
+ If all of the following are true:
682
+ <ul>
683
+ <li>
684
+ the element does not have
685
+ a <a>running transition</a> for the property,
686
+ </li>
687
+ <li>
688
+ the <a>before-change style</a> is different from
689
+ and can be interpolated with
690
+ the <a>after-change style</a> for that property,
691
+ </li>
692
+ <li>
693
+ the element does not have a <a>completed transition</a>
694
+ for the property
695
+ or the <a>end value</a> of the <a>completed transition</a>
696
+ is different from the <a>after-change style</a> for the property,
697
+ </li>
698
+ <li>
699
+ there is a <a>matching transition-property value</a> , and
700
+ </li>
701
+ <li>
702
+ the <a>combined duration</a> is greater than ''0s'' ,
703
+ </li>
704
+ </ul>
705
+ then implementations must
706
+ remove the <a>completed transition</a> (if present) from the set
707
+ of completed transitions and
647
708
start a transition whose:
648
709
<ul>
649
710
<li>
@@ -675,49 +736,52 @@ url: http://dev.w3.org/csswg/css-color-3/#html4; type: value; text: green;
675
736
</ul>
676
737
</li>
677
738
<li>
678
- If the element has a running transition for the property,
739
+ If the element has a <a>running transition</a> or
740
+ <a>completed transition</a> for the property,
679
741
and there is <strong> not</strong>
680
742
a <a>matching transition-property value</a> ,
681
743
then implementations must
682
- <a>cancel</a> the running transition.
744
+ <a>cancel</a> the <a>running transition</a>
745
+ or remove the <a>completed transition</a> from the set of
746
+ <a title="completed transition">completed transitions</a> .
683
747
</li>
684
748
<li>
685
- If the element has a running transition for the property,
749
+ If the element has a <a> running transition</a> for the property,
686
750
there is a <a>matching transition-property value</a> ,
687
- and the <a>end value</a> of the running transition is
751
+ and the <a>end value</a> of the <a> running transition</a> is
688
752
<strong> not</strong> equal to the value of the property in the
689
753
<a>after-change style</a> , then:
690
754
<ol>
691
755
<li>
692
756
If the <a>current value</a> of the property
693
- in the running transition
757
+ in the <a> running transition</a>
694
758
is equal to
695
759
the value of the property in the <a>after-change style</a> ,
696
760
or if these two values cannot be interpolated,
697
761
then implementations must
698
- <a>cancel</a> the running transition.
762
+ <a>cancel</a> the <a> running transition</a> .
699
763
</li>
700
764
<li>
701
765
Otherwise, if the <a>combined duration</a> is
702
766
less than or equal to ''0s'' ,
703
767
then implementations must
704
- <a>cancel</a> the running transition.
768
+ <a>cancel</a> the <a> running transition</a> .
705
769
</li>
706
770
<li>
707
771
Otherwise, if the <a>reversing-adjusted start value</a>
708
- of the running transition is the same as the value of
772
+ of the <a> running transition</a> is the same as the value of
709
773
the property in the <a>after-change style</a>
710
774
<span class="note"> (see the
711
775
<a href="#reversing">section on reversing of
712
776
transitions</a> for why these case exists)</span> ,
713
777
implementations must
714
- <a>cancel</a> the running transition and
778
+ <a>cancel</a> the <a> running transition</a> and
715
779
start a new transition whose:
716
780
<ul>
717
781
<li>
718
782
<a>reversing-adjusted start value</a> is
719
783
the <a>end value</a> of the
720
- running transition
784
+ <a> running transition</a>
721
785
<span class="note"> (Note: This represents the logical start state of
722
786
the transition, and allows some calculations to ignore that
723
787
the transition started before that state was reached, which
@@ -766,7 +830,7 @@ url: http://dev.w3.org/csswg/css-color-3/#html4; type: value; text: green;
766
830
<li>
767
831
<a>start value</a> is
768
832
the <a>current value</a> of the property
769
- in the running transition,
833
+ in the <a> running transition</a> ,
770
834
</li>
771
835
<li>
772
836
<a>end value</a> is
@@ -777,7 +841,7 @@ url: http://dev.w3.org/csswg/css-color-3/#html4; type: value; text: green;
777
841
</li>
778
842
<li>
779
843
Otherwise, implementations must
780
- <a>cancel</a> the running transition
844
+ <a>cancel</a> the <a> running transition</a>
781
845
and start a new transition whose:
782
846
<ul>
783
847
<li>
@@ -793,7 +857,7 @@ url: http://dev.w3.org/csswg/css-color-3/#html4; type: value; text: green;
793
857
<li>
794
858
<a>start value</a> is
795
859
the <a>current value</a> of the property
796
- in the running transition,
860
+ in the <a> running transition</a> ,
797
861
</li>
798
862
<li>
799
863
<a>end value</a> is
@@ -1003,14 +1067,16 @@ url: http://dev.w3.org/csswg/css-color-3/#html4; type: value; text: green;
1003
1067
<h2 id="complete">Completion of transitions</h2>
1004
1068
1005
1069
<p>
1006
- Running transitions <dfn id="dfn-complete">complete</dfn>
1070
+ <a title="running transition">Running transitions</a>
1071
+ <dfn id="dfn-complete">complete</dfn>
1007
1072
at a time that equal to or after their end time,
1008
1073
but prior to to the first <a>style change event</a>
1009
1074
whose time is equal to or after their <a>end time</a> .
1010
1075
When a transition completes,
1011
- implementations must remove
1076
+ implementations must move
1012
1077
all transitions that complete at that time
1013
- from the set of running transitions
1078
+ from the set of <a>running transitions</a>
1079
+ to the set of <a>completed transitions</a>
1014
1080
and then fire the <a href="#transition-events">events</a>
1015
1081
for those completions.
1016
1082
<span class="note"> (Note that doing otherwise could allow
0 commit comments