@@ -140,7 +140,6 @@ Using the CSS markup:
140140<pre class='lang-css'>
141141@media (prefers-reduced-motion: no-preference) {
142142 div.circle {
143- animation-duration: 1s;
144143 animation-timing-function: linear;
145144 animation-timeline: collision-timeline;
146145 }
@@ -191,13 +190,13 @@ if (window.matchMedia('(prefers-reduced-motion: no-preference)').matches) {
191190 scrollOffsets: [CSS.px(200), CSS.px(300)]
192191 });
193192
194- const left = leftCircle.animate({ transform: 'translate(300px)' }, 1000 );
193+ const left = leftCircle.animate({ transform: 'translate(300px)' });
195194 left.timeline = collisionTimeline;
196195
197- const right = leftCircle.animate({ transform: 'translate(350px)' }, 1000 );
196+ const right = leftCircle.animate({ transform: 'translate(350px)' });
198197 right.timeline = collisionTimeline;
199198
200- const union = unionCircle.animate({ opacity: 1 }, { duration: 1000, fill: "forwards" });
199+ const union = unionCircle.animate({ opacity: 1 }, { fill: "forwards" });
201200 union.timeline = new ScrollTimeline({
202201 source: scrollableElement,
203202 scrollOffsets: [CSS.px(250), CSS.px(300)]
@@ -253,7 +252,7 @@ If we use this API for this case, the example code will be as follow:
253252
254253<pre class='lang-javascript'>
255254if (window.matchMedia('(prefers-reduced-motion: no-preference)' ).matches) {
256- var animation = div.animate({ width: '100%' }, { duration: 1000, fill: "forwards" });
255+ var animation = div.animate({ width: '100%' }, { fill: "forwards" });
257256 animation.timeline = new ScrollTimeline(
258257 {
259258 scrollOffsets: [0, CSS.percent(100)]
@@ -360,7 +359,6 @@ dictionary ScrollTimelineOptions {
360359 Element? source;
361360 ScrollDirection orientation = "block";
362361 sequence<ScrollTimelineOffset> scrollOffsets = [];
363- (double or ScrollTimelineAutoKeyword) timeRange = "auto";
364362};
365363
366364[Exposed=Window]
@@ -369,14 +367,15 @@ interface ScrollTimeline : AnimationTimeline {
369367 readonly attribute Element? source;
370368 readonly attribute ScrollDirection orientation;
371369 readonly attribute FrozenArray<ScrollTimelineOffset> scrollOffsets;
372- readonly attribute (double or ScrollTimelineAutoKeyword) timeRange;
373370};
374371</pre>
375372
376373A <dfn>scroll timeline</dfn> is an {{AnimationTimeline}} whose time values are
377374determined not by wall-clock time, but by the progress of scrolling in a
378375[=scroll container=] .
379376
377+ The {{AnimationTimeline/Duration}} of a <a>scroll timeline</a> is 100%.
378+
380379<div link-for-hint="ScrollTimeline">
381380
382381<div class="constructors">
@@ -403,10 +402,9 @@ determined not by wall-clock time, but by the progress of scrolling in a
403402
404403 1. Set the {{ScrollTimeline/source}} of |timeline| to |source|.
405404
406- 1. Assign the {{ScrollTimeline/orientation}} , {{ScrollTimeline/scrollOffsets}}
407- and {{ScrollTimeline/timeRange }} properties of
405+ 1. Assign the {{ScrollTimeline/orientation}} and
406+ {{ScrollTimeline/scrollOffsets }} properties of
408407 |timeline| to the corresponding value from |options|.
409-
410408</div>
411409
412410<div class="attributes">
@@ -453,25 +451,6 @@ determined not by wall-clock time, but by the progress of scrolling in a
453451
454452 </div>
455453
456- : <dfn attribute for=ScrollTimeline>timeRange</dfn>
457- :: A time duration that allows mapping between a distance scrolled, and
458- quantities specified in time units, such as an animation's [=duration=] and
459- [=start delay=] .
460-
461- Conceptually, {{timeRange}} represents the number of milliseconds to map to
462- the scroll range defined by {{start}} and {{end}} . As a result, this value
463- does not have a correspondence to wall-clock time.
464-
465- This value is used to compute the timeline's [=effective time range=] , and
466- the mapping is then defined by mapping the scroll distance from
467- {{start}} to {{end}} , to the [=effective time range=] .
468-
469- Issue(4862): We are working to remove the need for {{timeRange}} to be declared.
470- The most recent work on this involved introduction of the concept of
471- "progress-based animations" to web animations.
472-
473- </div>
474-
475454### Scroll Timeline Offset ### {#scroll-timeline-offset-section}
476455
477456An <dfn>effective scroll offset</dfn> is a scroll position for a given [=scroll
@@ -711,8 +690,7 @@ if (window.matchMedia('(prefers-reduced-motion: no-preference)').matches) {
711690 transform: ['translateX(0)', 'translateX(50vw)'] ,
712691 opacity: [0, 1]
713692 }, {
714- timeline:timeline,
715- duration: 1000
693+ timeline:timeline
716694 }
717695 );
718696}
@@ -741,36 +719,12 @@ The same logic can be done in CSS markup:
741719
742720 #target {
743721 animation-name: slide-in;
744- animation-duration: 1s;
745722 animation-timeline: image-in-scrollport;
746723 }
747724
748725}
749726</pre>
750727
751-
752- </div>
753-
754- ### The effective time range of a {{ScrollTimeline}} ### {#effective-time-range-algorithm}
755-
756- The <dfn>effective time range</dfn> of a {{ScrollTimeline}} is calculated as
757- follows:
758-
759- <div class="switch">
760-
761- : If the {{timeRange}} has the value `"auto"`,
762- :: The [=effective time range=] is the maximum value of the
763- [=target effect end=] of all animations
764- directly associated with this timeline.
765-
766- If any animation directly associated with the timeline has a
767- [=target effect end=] of infinity, the [=effective time range=]
768- is zero.
769-
770- : Otherwise,
771- :: The [=effective time range=] is the {{ScrollTimeline}} 's
772- {{timeRange}} .
773-
774728</div>
775729
776730### The effective scroll offsets of a {{ScrollTimeline}} ### {#effective-scroll-offsets-algorithm}
@@ -910,15 +864,15 @@ The [=current time=] of a {{ScrollTimeline}} is calculated as follows:
910864
911865: If |current scroll offset| is greater than or equal to [=effective
912866 end offset=] :
913- :: The [=current time=] is the [=effective time range =] .
867+ :: The [=current time=] is the [=duration =] .
914868
915869: Otherwise,
916870:: 1. Let |progress| be a result of applying
917871 [=calculate scroll timeline progress=] procedure for <var> current scroll offset</var> .
918872 1. The [=current time=] is the result of evaluating the following expression:
919873
920874 <blockquote>
921- <code> |progress| × [=effective time range =] </code>
875+ <code> |progress| × [=duration =] </code>
922876 </blockquote>
923877
924878</div>
@@ -1032,17 +986,6 @@ following:
1032986 * {{ElementBasedOffset/threshold}} is the optional value <<number>> . If
1033987 not provided it defaults to 0.
1034988
1035- </div>
1036-
1037- <pre class='descdef'>
1038- Name : time-range
1039- For : @scroll-timeline
1040- Value : auto | <<time>>
1041- Initial : auto
1042- </pre>
1043-
1044- 'time-range' descriptor determines the scroll timeline's {{timeRange}} .
1045-
1046989</div> <!-- link-for-hint="ScrollTimeline" -->
1047990
1048991### The <dfn interface>CSSScrollTimelineRule</dfn> Interface ### {#the-css-scroll-timeline-rule-interface}
@@ -1054,7 +997,6 @@ interface CSSScrollTimelineRule : CSSRule {
1054997 readonly attribute CSSOMString source;
1055998 readonly attribute CSSOMString orientation;
1056999 readonly attribute CSSOMString scrollOffsets;
1057- readonly attribute CSSOMString timeRange;
10581000};
10591001</pre>
10601002
@@ -1079,11 +1021,6 @@ interface CSSScrollTimelineRule : CSSRule {
10791021 <dd>
10801022 The 'scroll-offsets' descriptor associated with the ''@scroll-timeline'' , or "none" if not specified.
10811023 </dd>
1082-
1083- <dt> <dfn>timeRange</dfn> </dt>
1084- <dd>
1085- The 'time-range' descriptor associated with the ''@scroll-timeline'' , or "auto" if not specified.
1086- </dd>
10871024</dl>
10881025
10891026<div algorithm>
@@ -1212,7 +1149,6 @@ interface CSSScrollTimelineRule : CSSRule {
12121149 { width: "100vw" }
12131150 ],
12141151 {
1215- duration: 1000,
12161152 easing: "linear",
12171153 fill: "forwards"
12181154 });
@@ -1255,7 +1191,6 @@ interface CSSScrollTimelineRule : CSSRule {
12551191 /* This name is used to select both the keyframes and the
12561192 scroll-timeline at-rules. */
12571193 animation-name: progress;
1258- animation-duration: 1s;
12591194 animation-fill-mode: forwards;
12601195 animation-timing-function: linear;
12611196 }
0 commit comments