Skip to content

Commit 54383b7

Browse files
Make endScrollOffset check inclusive for max-scroll-position (#37)
See the issue for more details Fixes #19
1 parent 3751472 commit 54383b7

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

Overview.bs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -516,18 +516,30 @@ as follows:
516516
1. If {{scrollSource}} is null, does not currently have a [=CSS layout box=], or
517517
if its layout box is not a [=scroll container=], return an unresolved time value.
518518

519-
2. Otherwise, let <var>current scroll offset</var> be the current scroll offset of {{scrollSource}}
519+
1. Otherwise, let <var>current scroll offset</var> be the current scroll offset of {{scrollSource}}
520520
in the direction specified by {{orientation}}.
521521

522-
3. If <var>current scroll offset</var> is less than {{startScrollOffset}}, return an unresolved
523-
time value if {{fill}} is <code>none</code> or <code>forwards</code>,
524-
or 0 otherwise.
522+
1. If <var>current scroll offset</var> is less than {{startScrollOffset}}, return an unresolved
523+
time value if {{fill}} is <code>none</code> or <code>forwards</code>, or 0 otherwise.
525524

526-
4. If <var>current scroll offset</var> is greater than or equal to {{endScrollOffset}},
527-
return an unresolved time value if {{fill}} is <code>none</code> or
528-
<code>backwards</code>, or the [=effective time range=] otherwise.
525+
1. If <var>current scroll offset</var> is greater than or equal to {{endScrollOffset}} then:
526+
<div class="switch">
529527

530-
5. Return the result of evaluating the following expression:
528+
: If {{endScrollOffset}} is less than the maximum scroll offset of {{scrollSource}} in
529+
{{orientation}} and {{fill}} is <code>none</code> or <code>backwards</code>,
530+
531+
:: return an unresolved time value.
532+
533+
: Otherwise,
534+
535+
:: return the [=effective time range=].
536+
537+
</div>
538+
539+
Note: Checking for {{endScrollOffset}} being the maximum scroll offset ensures that the common
540+
case of a 'whole scroller' ScrollTimeline does not become inactive when you scroll to the end.
541+
542+
1. Return the result of evaluating the following expression:
531543

532544
<blockquote>
533545
<code>(<var>current scroll offset</var> - {{startScrollOffset}}) / ({{endScrollOffset}} - {{startScrollOffset}}) &times; [=effective time range=]</code>

0 commit comments

Comments
 (0)