Skip to content

Commit 8683737

Browse files
author
Anders Hartvoll Ruud
committed
[css-transitions-1] Define before/after-change style in terms of base
- Introduce "base style". - Define before/after-change style in terms of that base style (at two different points in time). - There should be no need for the "completed transition" set anymore, since the before/after-change styles on a child are blind to any effects from transitions/animations happening on the parent.
1 parent cd7a52b commit 8683737

File tree

1 file changed

+14
-88
lines changed

1 file changed

+14
-88
lines changed

css-transitions-1/Overview.bs

+14-88
Original file line numberDiff line numberDiff line change
@@ -432,54 +432,12 @@ Starting of transitions {#starting}
432432
</span>
433433
</p>
434434

435-
<p>
436-
Implementations must also maintain a set of
437-
<dfn export lt="completed transition">completed transitions</dfn>,
438-
each of which
439-
(like <a>running transitions</a>)
440-
applies to a specific element and non-shorthand property.
441-
<span class="note">
442-
This specification maintains the invariant that
443-
there is never both a <a>running transition</a> and
444-
a <a>completed transition</a> for the same property and element.
445-
</span>
446-
</p>
447-
448435
<p>
449436
If an element is no longer in the document,
450437
implementations must <a>cancel</a> any <a>running transitions</a>
451-
on it and remove transitions on it from the
452-
<a>completed transitions</a>.
438+
on that element.
453439
</p>
454440

455-
<div class="note">
456-
457-
<p>
458-
This set of completed transitions
459-
needs to be maintained
460-
in order to prevent
461-
transitions from repeating themselves in certain cases,
462-
i.e., to maintain the invariant
463-
that this specification tries to maintain
464-
that unrelated style changes do not trigger transitions.
465-
</p>
466-
467-
<p class="example">
468-
An example where maintaining the set of completed transitions
469-
is necessary would be a transition on
470-
an inherited property,
471-
where the parent specifies a transition of that property for
472-
a longer duration (say, ''transition: 4s text-indent'')
473-
and a child element that inherits the parent's value specifies
474-
a transition of the same property for a shorter duration
475-
(say, ''transition: 1s text-indent'').
476-
Without the maintenance of this set of completed transitions,
477-
implementations could start additional transitions on the child
478-
after the initial 1 second transition on the child completes.
479-
</p>
480-
481-
</div>
482-
483441
<p>
484442
Various things can cause the <a>computed values</a> of properties
485443
on an element to change.
@@ -540,26 +498,15 @@ Starting of transitions {#starting}
540498
then transitions are not started for that element
541499
in that style change event.
542500
Otherwise,
501+
define the <dfn export>base style</dfn> as
502+
the <a>computed values</a> of all properties on the element
503+
as they would be without any declarations added to the
504+
"Animation" or "Transition" [[css-cascade-3#cascading-origins|origins]],
505+
inheriting from the base style of the parent;
543506
define the <dfn export>before-change style</dfn> as
544-
the <a>computed values</a> of all properties on the element as of
545-
the previous <a>style change event</a>,
546-
except with any styles derived from declarative
547-
animations such as CSS Transitions, CSS Animations
548-
([[CSS3-ANIMATIONS]]),
549-
and SMIL Animations ([[SMIL-ANIMATION]], [[SVG11]])
550-
updated to the current time.
551-
Likewise, define the <dfn export>after-change style</dfn> as
552-
the <a>computed values</a> of all properties
553-
on the element based on the information
554-
known at the start of that <a>style change event</a>,
555-
but using the computed values of the 'animation-*' properties from the
556-
<a>before-change style</a>,
557-
excluding any styles from CSS Transitions in the computation,
558-
and inheriting from
559-
the <a>after-change style</a> of the parent.
560-
Note that this means the <a>after-change style</a> does not differ from
561-
the <a>before-change style</a> due to newly created or canceled CSS
562-
Animations.
507+
the <a>base style</> as of the previous <a>style change event</a>; and
508+
define the <dfn export>after-change style</dfn> as
509+
the <a>base style</> as of the current <a>style change event</a>.
563510
</p>
564511

565512
<div class="note">
@@ -652,12 +599,6 @@ Starting of transitions {#starting}
652599
the <a>after-change style</a> for that property,
653600
and the values for the property are [=transitionable=],
654601
</li>
655-
<li>
656-
the element does not have a <a>completed transition</a>
657-
for the property
658-
or the <a>end value</a> of the <a>completed transition</a>
659-
is different from the <a>after-change style</a> for the property,
660-
</li>
661602
<li>
662603
there is a <a>matching transition-property value</a>, and
663604
</li>
@@ -666,8 +607,6 @@ Starting of transitions {#starting}
666607
</li>
667608
</ul>
668609
then implementations must
669-
remove the <a>completed transition</a> (if present) from the set
670-
of completed transitions and
671610
start a transition whose:
672611
<ul>
673612
<li>
@@ -699,23 +638,11 @@ Starting of transitions {#starting}
699638
</ul>
700639
</li>
701640
<li>
702-
Otherwise,
703-
if the element has a <a>completed transition</a> for the property
704-
and the <a>end value</a> of the <a>completed transition</a>
705-
is different from the <a>after-change style</a> for the property,
706-
then implementations must
707-
remove the <a>completed transition</a> from the set of
708-
<a>completed transitions</a>.
709-
</li>
710-
<li>
711-
If the element has a <a>running transition</a> or
712-
<a>completed transition</a> for the property,
641+
If the element has a <a>running transition</a> for the property,
713642
and there is <strong>not</strong>
714643
a <a>matching transition-property value</a>,
715644
then implementations must
716-
<a>cancel</a> the <a>running transition</a>
717-
or remove the <a>completed transition</a> from the set of
718-
<a>completed transitions</a>.
645+
<a>cancel</a> the <a>running transition</a>.
719646
</li>
720647
<li>
721648
If the element has a <a>running transition</a> for the property,
@@ -1060,15 +987,14 @@ Completion of transitions {#complete}
1060987
but prior to the first <a>style change event</a>
1061988
whose time is equal to or after their <a>end time</a>.
1062989
When a transition completes,
1063-
implementations must move
990+
implementations must remove
1064991
all transitions that complete at that time
1065992
from the set of <a>running transitions</a>
1066-
to the set of <a>completed transitions</a>
1067993
and then fire the <a href="#transition-events">events</a>
1068994
for those completions.
1069995
<span class="note">(Note that doing otherwise, that is,
1070-
firing some of the events before doing all of the moving
1071-
from <a>running transitions</a> to <a>completed transitions</a>,
996+
firing some of the events before removing all completed transitions
997+
from <a>running transitions</a>
1072998
could allow
1073999
a style change event to happen
10741000
without the necessary transitions completing,

0 commit comments

Comments
 (0)