Skip to content

Commit 05a40ac

Browse files
committed
[css-timing] Drop before flag from frames() timing function
The before flag was added primarily for step-start because at input progress = 0 the output should be the top of the step but during the delay phase it should be the bottom of the step. As an extension of that, we said that if you used the iterationStart property to offset the beginning of the animation such that it lines up exactly with one of those steps, then we should behave in the same way: i.e. bottom of the step during the delay, top of the step otherwise. Original discussion: https://lists.w3.org/Archives/Public/public-fx/2013OctDec/0233.html Subsequent discussion: https://old.etherpad-mozilla.org/yhmUQAEfpo Issue: w3c/web-animations#16 Originally I applied the same behavior to frame timing functions. However, they don't have the same issue steps occurring at progress=0. Furthermore, for the iterationStart case, suppose you have frames(4) and set iterationStart to 0.25, then I think during the delay phase you actually do expect that animation to show the second frame. That is, you don't want the step down behavior. Instead you're effectively saying, "I've asked for 4 frames but I want to start from the second frame (presumably even when I'm filing." So I've dropped the before flag behavior for the frames() timing function.
1 parent d67c7d5 commit 05a40ac

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

css-timing/Overview.bs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -357,30 +357,17 @@ A [=frames timing function=] is defined by an integral number of
357357
<dfn>frames</dfn> greater than one.
358358

359359
As with [=step timing functions=], at the exact point where a step occurs the
360-
result of the function is conceptually the top of the step unless an additional
361-
[=before flag=] is passed and set to true.
360+
result of the function is conceptually the top of the step.
362361

363362
The [=output progress value=] is calculated from the [=input progress value=]
364363
and [=before flag=] as follows:
365364

366365
1. Calculate the <var>current frame</var> as <code>floor([=input progress
367366
value=] &times; [=frames=])</code>.
368367

369-
1. If <em>both</em> of the following conditions are true:
370-
371-
* the [=before flag=] is set, <em>and</em>
372-
* [=input progress value=] &times; [=frames=] mod 1 equals zero
373-
(that is, if [=input progress value=] &times; [=frames=] is
374-
integral), then
375-
376-
decrement <var>current frame</var> by one.
377-
378368
1. Let the initial [=output progress value=] be <code><var>current frame</var>
379369
/ ([=frames=] - 1)</code>.
380370

381-
1. If [=input progress value=] &ge; 0 and [=output progress value=] &lt; 0,
382-
let [=output progress value=] be 0.
383-
384371
1. If [=input progress value=] &le; 1 and [=output progress value=] &gt; 1,
385372
let [=output progress value=] be 1.
386373

0 commit comments

Comments
 (0)