You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-transitions/Overview.src.html
+77-13Lines changed: 77 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -912,8 +912,79 @@ <h2 id="starting">
912
912
</div>
913
913
914
914
<p>
915
-
When the computed value of a property changes, implementations
916
-
must start transitions based on the relevant item (see <a
915
+
Various things can cause the computed style of an element to change,
916
+
or for an element to start or stop having computed style.
917
+
(For the purposes of this specification,
918
+
an element has computed style when it is in the document tree,
919
+
and does not have computed style when it is not in the document tree.)
920
+
These include
921
+
insertion and removal of elements from the document tree
922
+
(which both changes whether those elements have computed styles and
923
+
can change the styles of other elements through selector matching),
924
+
changes to the document tree that cause
925
+
changes to which selectors match elements,
926
+
changes to style sheets or style attributes,
927
+
and other things.
928
+
This specification does not define when computed styles are updated.
929
+
However,
930
+
when an implementation updates the computed style for an element
931
+
to reflect one of these changes,
932
+
it must update the computed style for all elements to reflect all
933
+
of these changes at the same time
934
+
(or at least it must be undetectable that it was done at a
935
+
different time).
936
+
This processing of a set of simultaneous style changes is called a
937
+
<dfn>style change event</dfn>.
938
+
(Implementations typically have a <span>style change event</span> to
939
+
correspond with their desired screen refresh rate,
940
+
and when up-to-date computed style is needed
941
+
for a script API that depends on it.)
942
+
</p>
943
+
944
+
<p>
945
+
Since this specification does not define
946
+
when a <span>style change event</span> occurs,
947
+
and thus what changes to computed values are considered simultaneous,
948
+
authors should be aware that changing any of the transition
949
+
properties a small amount of time after making a change that
950
+
might transition can result in behavior that varies between
951
+
implementations, since the changes might be considered
952
+
simultaneous in some implementations but not others.
953
+
</p>
954
+
955
+
<p>
956
+
When a <span>style change event</span> occurs,
957
+
implementations must start transitions based on
958
+
the computed styles that changed in that event.
959
+
If an element does not have a computed style
960
+
either before or after the style change event,
961
+
then transitions are not started for that element
962
+
in that style change event.
963
+
Otherwise,
964
+
define the <span>before-change style</span> as
965
+
the computed style for the element as of
966
+
the previous <span>style change event</span>,
967
+
except with any styles derived from declarative
968
+
animations such as CSS Transitions, CSS Animations
969
+
([[CSS3-ANIMATIONS]]),
970
+
and SMIL Animations ([[SMIL-ANIMATION]], [[SVG11]])
971
+
updated to the current time.
972
+
Likewise, define the <span>after-change style</span> as
973
+
the computed style for the element based on the information
974
+
known at the start of that <span>style change event</span>,
975
+
in other words,
976
+
excluding any changes resulting from CSS Transitions
977
+
that start during that <span>style change event</span>.
978
+
</p>
979
+
980
+
<p>
981
+
For each element with a <span>before-change style</span> and
982
+
an <span>after-change style</span>,
983
+
and each property (other than shorthands) for which
984
+
the <span>before-change style</span> is different from
985
+
the <span>after-change style</span>,
986
+
implementations must
987
+
start transitions based on the relevant item (see <a
917
988
href="#transition-property">the definition of
918
989
'transition-property'</a>) in the computed value of
919
990
'transition-property'.
@@ -929,17 +1000,6 @@ <h2 id="starting">
929
1000
in other cases transitions do not occur.
930
1001
</p>
931
1002
932
-
<p>
933
-
Since this specification does not define
934
-
when computed values change, and thus what changes to
935
-
computed values are considered simultaneous,
936
-
authors should be aware that changing any of the transition
937
-
properties a small amount of time after making a change that
938
-
might transition can result in behavior that varies between
939
-
implementations, since the changes might be considered
940
-
simultaneous in some implementations but not others.
941
-
</p>
942
-
943
1003
<p>
944
1004
Once the transition of a property has started, it must continue
945
1005
running based on the original timing function, duration, and
@@ -1558,6 +1618,10 @@ <h2 id="changes">Changes since Working Draft of 12 February 2013</h2>
1558
1618
<li>Make the behavior of simultaneous changes of 'transition-*' properties and transitionable properties even clearer.
1559
1619
<li>Computed Value line for shorthands should say "see individual properties".
1560
1620
<li>Define initial values of event properties, using initializers in <span>TransitionEventInit</span>.
1621
+
<li>Define the model for starting of transitions and their interaction with other animations more precisely:
1622
+
<ul>
1623
+
<li>Define the <span>before-change style</span> and <span>after-change style</span> used for the style comparison, using the new concept of a <span>style change event</span>.
1624
+
</ul>
1561
1625
</ul>
1562
1626
1563
1627
<p>For more details on these changes, see the version control change logs, which are split in two parts because of a file renaming: <ahref="https://dvcs.w3.org/hg/csswg/log/tip/css-transitions/Overview.src.html">change log since 2013 March 28</a>, <ahref="https://dvcs.w3.org/hg/csswg/log/tip/css3-transitions/Overview.src.html">change log before 2013 March 28</a>.
0 commit comments