Skip to content

Commit fc7abaf

Browse files
committed
[scroll-animations-2] Don't generate initial/final keyframes unless necessary.
1 parent da302c5 commit fc7abaf

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

css-animations-2/Overview.bs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -337,24 +337,24 @@ its associated [=keyframes=] are generated as follows:
337337
338338
1. <strong>Generate Initial and Final Frames:</strong>
339339
340-
1. Create two new [=keyframes=], |initial keyframe| and |final keyframe|,
341-
assigning each |default timing function| as its |keyframe timing function|
340+
1. Find or create the |initial keyframe|,
341+
a [=keyframe=] with a |keyframe offset| of ''0%'',
342+
|default timing function| as its |keyframe timing function|,
342343
and |default composite| as its |keyframe composite|.
343344
344-
1. Give |initial keyframe| a |keyframe offset| of zero (''0%'')
345-
and prepend it to |keyframes|;
346-
give |final keyframe| a |keyframe offset| of one (''100%'')
347-
and append it to |keyframes|.
348-
349-
1. Add to the |keyframe properties| of |initial keyframe| and |final keyframe|
350-
the [=computed value=] on |element|
351-
of each property in |animated properties|.
352-
Skip any property already declared by a [=keyframe=] in |keyframes|
353-
that has a matching |keyframe offset|
354-
or that is positioned
355-
earlier (for |initial keyframe|)
356-
or later (for |final keyframe|)
357-
in the [=used keyframe order=].
345+
1. For any property in |animated properties|
346+
that is not otherwise present in a keyframe with an offset of ''0%''
347+
or one that would be positioned earlier in the [=used keyframe order=],
348+
add the [=computed value=] of that property on |element|
349+
to |initial keyframe|’s |keyframe values|.
350+
351+
1. If |initial keyframe|’s |keyframe values| is not empty,
352+
prepend |initial keyframe| to |keyframes|.
353+
354+
1. Repeat for |final keyframe|,
355+
using an offset of ''100%'',
356+
considering keyframes positioned <em>later</em> in the [=used keyframe order=],
357+
and <em>appending</em> to |keyframes|.
358358
359359
1. <strong>Sort Frames:</strong>
360360

0 commit comments

Comments
 (0)