Contact emails
awogb...@google.comExplainer
No information providedSpecification
https://drafts.csswg.org/scroll-animations-1/#valdef-animation-timeline-range-scrollSummary
This feature expands the set of named ranges of view timelines by adding a "scroll" range.
The Scroll-Driven Animations API introduced ViewTimelines along with named ranges which refer to portions of a ViewTimeline that define an animation's range[1]. However, all the named ranges provided were restricted to the portion of the ViewTimeline where its subject is visible. It is useful for authors to be able to refer to the full extent of the scroll container underlying the timeline. This feature facilitates this by adding a named range of "scroll" to the existing set ("entry", "exit", "cover", "contain").
[1] https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/animation-rangeBlink component
Blink>AnimationWeb Feature ID
Missing featureMotivation
A scroll-driven animation's range[1] can be described in terms of the (named) ranges of a ViewTimeline, i.e. "cover", "contain", "entry", "exit." This allows authors to tie the progress of the animation directly to the the position of the ViewTimeline's subject within the scroll container underlying the ViewTimeline. However, ViewTimelines are, by default, constrained to the portion of the underlying scroll container within which the subject is (wholly or partially) visible, i.e. the "cover" range, i.e. { rangeStart: cover 0%, rangeEnd: cover 100%}.
This means that an author has no way, for example, to refer to a range that starts when the subject is visible but ends at the end of the scrolling container (rather than when then subject stops being visible). They could opt for a hack like { rangeStart: cover 0%, rangeEnd: cover 10000%}, having attempted to manually calculate rangeEnd. Similarly, to set rangeStart, to the start of the scroll container they'd need to compute some negative percentage or px offset.