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
[scroll-animations-1] Removed fill from ScrollTimeline (w3c#4750)
* Fixed edit link by correcting shortname. Removed fill from ScrollTimeline in favor of returning Infinity values for before start and after end states of the timeline.
* Removing unecessary editor
* Swapped infinity values for 0 and time range.
* Updated examples to include forward fill modes so that effects remain after scrolling past the end of the timeline
* Added TODO to revisit the spec when animation timeline state has been more discussed
readonly attribute (double or ScrollTimelineAutoKeyword) timeRange;
385
-
readonly attribute FillMode fill;
386
386
};
387
387
</pre>
388
388
@@ -410,7 +410,7 @@ not by wall-clock time, but by the progress of scrolling in a [=scroll container
410
410
411
411
1. Set the {{ScrollTimeline/scrollSource}} of |timeline| to |source|.
412
412
413
-
1. Assign the {{ScrollTimeline/orientation}}, {{ScrollTimeline/startScrollOffset}}, {{ScrollTimeline/endScrollOffset}}, {{ScrollTimeline/timeRange}}, and {{ScrollTimeline/fill}} properties of |timeline| to the corresponding value from |options|.
413
+
1. Assign the {{ScrollTimeline/orientation}}, {{ScrollTimeline/startScrollOffset}}, {{ScrollTimeline/endScrollOffset}}, and {{ScrollTimeline/timeRange}} properties of |timeline| to the corresponding value from |options|.
414
414
415
415
</div>
416
416
@@ -475,39 +475,6 @@ not by wall-clock time, but by the progress of scrolling in a [=scroll container
475
475
the mapping is then defined by mapping the scroll distance from
476
476
{{startScrollOffset}} to {{endScrollOffset}}, to the [=effective time range=].
477
477
478
-
: <dfn attribute for=ScrollTimeline>fill</dfn>
479
-
:: Determines whether the timeline is active even when the scroll offset is outside
480
-
the range defined by [{{startScrollOffset}}, {{endScrollOffset}}].
481
-
482
-
Possible values are:
483
-
484
-
: none
485
-
:: The timeline is inactive when the scroll offset is less than {{startScrollOffset}}
486
-
or greater than or equal to {{endScrollOffset}}.
487
-
488
-
: forwards
489
-
:: When the scroll offset is less than {{startScrollOffset}}, the
490
-
timeline is inactive.
491
-
When the scroll offset is greater than or equal to the
492
-
{{endScrollOffset}}, the timeline's [=current time=] is its
493
-
[=effective time range=].
494
-
495
-
: backwards
496
-
:: When the scroll offset is less than {{startScrollOffset}}, the
497
-
timeline's [=current time=] is 0.
498
-
When the scroll offset is greater than or equal to the
499
-
{{endScrollOffset}}, the timeline is inactive.
500
-
501
-
: both
502
-
:: When the scroll offset is less than {{startScrollOffset}}, the
503
-
timeline's [=current time=] is 0.
504
-
When the scroll offset is greater than or equal to the
505
-
{{endScrollOffset}}, the timeline's [=current time=] is its
506
-
[=effective time range=].
507
-
508
-
: auto
509
-
:: Behaves the same as <code>both</code>.
510
-
511
478
</div>
512
479
513
480
### The effective time range of a {{ScrollTimeline}} ### {#efffective-time-range-algorithm}
@@ -542,25 +509,11 @@ as follows:
542
509
1. Otherwise, let <var>current scroll offset</var> be the current scroll offset of {{scrollSource}}
543
510
in the direction specified by {{orientation}}.
544
511
545
-
1. If <var>current scroll offset</var> is less than {{startScrollOffset}}, return an unresolved
546
-
time value if {{fill}} is <code>none</code> or <code>forwards</code>, or 0 otherwise.
547
-
548
-
1. If <var>current scroll offset</var> is greater than or equal to {{endScrollOffset}} then:
549
-
<div class="switch">
550
-
551
-
: If {{endScrollOffset}} is less than the maximum scroll offset of {{scrollSource}} in
552
-
{{orientation}} and {{fill}} is <code>none</code> or <code>backwards</code>,
553
-
554
-
:: return an unresolved time value.
512
+
1. If <var>current scroll offset</var> is less than {{startScrollOffset}}, return 0.
555
513
556
-
: Otherwise,
514
+
Note: TODO(<a href="https://github.com/w3c/csswg-drafts/issues/4325#issuecomment-585295758">Issue 4325</a>): Define what the correct timeline state is based on scroll offset.
557
515
558
-
:: return the [=effective time range=].
559
-
560
-
</div>
561
-
562
-
Note: Checking for {{endScrollOffset}} being the maximum scroll offset ensures that the common
563
-
case of a 'whole scroller' ScrollTimeline does not become inactive when you scroll to the end.
516
+
1. If <var>current scroll offset</var> is greater than or equal to {{endScrollOffset}}, return [=effective time range=].
564
517
565
518
1. Return the result of evaluating the following expression:
566
519
@@ -589,7 +542,7 @@ Computed value: As specified
589
542
Canonical order: per grammar
590
543
</pre>
591
544
592
-
<dfn><single-animation-timeline></dfn> = auto | scroll([element(<<id-selector>>)[, <<scroll-direction>>[, <<scroll-offset>>[, <<scroll-offset>>[, <<time>>[, <<single-animation-fill-mode>>]]]]]])
545
+
<dfn><single-animation-timeline></dfn> = auto | scroll([element(<<id-selector>>)[, <<scroll-direction>>[, <<scroll-offset>>[, <<scroll-offset>>[, <<time>>]]]]])
0 commit comments