@@ -8,8 +8,8 @@ Group: CSSWG
88URL : https://drafts.csswg.org/scroll-animations-1/
99ED : https://drafts.csswg.org/scroll-animations-1/
1010Shortname : scroll-animations-1
11- Abstract : Defines an API and markup for creating animations that are either
12- triggered by or tied to the scroll offset of a scroll container.
11+ Abstract : Defines an API and markup for creating animations that are tied to
12+ the scroll offset of a scroll container.
1313Editor : Brian Birtles, Invited Expert, brian@birchill.co.jp, w3cid 43194
1414Editor : Botond Ballo, Mozilla, botond@mozilla.com
1515Editor : Antoine Quint, Apple, graouts@apple.com, w3cid 51377
@@ -74,7 +74,7 @@ way that does not require script to run each time the effect is sampled. User
7474agents that support asynchronous scrolling are allowed (but not required) to
7575sample such effects asynchronously as well.
7676
77- ## Value Definitions {#values}
77+ ## Value Definitions ## {#values}
7878
7979This specification follows the <a href="https://www.w3.org/TR/CSS2/about.html#property-defs">CSS property definition conventions</a> from [[!CSS2]]
8080using the <a href="https://www.w3.org/TR/css-values-3/#value-defs">value definition syntax</a> from [[!CSS-VALUES-3]] .
@@ -94,59 +94,8 @@ Note: Based on this <a
9494href="https://github.com/WICG/scroll-animations/blob/master/Use%20cases.md"> curated
9595list of use cases</a> .
9696
97- ## Scroll-triggered animations ## {#scroll-triggered-animations-usecases}
9897
99- ### Navigation bar shrinking effect ### {#navigation-bar-shrinking-effect}
100-
101- It is common to trigger an animation to run when the scroll position
102- reaches a certain point. For example, a navigation bar may shrink once
103- the user begins to scroll a page.
104-
105- <figure>
106- <img src="img/usecase1-2.svg" width="600"
107- alt="Use case: Shrinking navigation bar">
108- <figcaption>
109- Shrinking navigation bar<br>
110- The left figure shows the navigation bar before scrolling with
111- a large menu bar.<br>
112- The right figure shows the shrunken navigation bar after scrolling.
113- </figcaption>
114- </figure>
115-
116- Advisement: The proposal does not yet define CSS markup or programming
117- interfaces to express this use case.
118-
119- ### Navigation highlight effect ### {#navigation-highlight-effect}
120-
121- Similarly, it is common to trigger an animation at certain fixed points
122- in a element's scroll range. For example, a navigation bar that changes
123- highlight based on the reader's position within the document.
124-
125- <figure>
126- <img src="img/usecase1-1.svg" width="600"
127- alt="Use case: A navigation highlight effect.">
128- <figcaption>
129- A navigation highlight effect<br>
130- On the left, the “Abstract” section is scrolled into view
131- and hence the abstract menu item is highlighted.<br>
132- After scrolling down to the “Background” section (right),
133- the background menu item fades in while the abstract menu item fades
134- out.
135- </figcaption>
136- </figure>
137-
138- Advisement: The proposal does not yet define CSS markup or programming
139- interfaces to express this use case.
140-
141- ## Scroll-triggered style changes ## {#scroll-triggered-style-changes-usecase}
142-
143- Advisement: The proposal does not yet define CSS markup or programming
144- interfaces to express this use case.
145-
146-
147- ## Scroll-linked animations ## {#scroll-linked-animations-usecase}
148-
149- ### Scrollable picture-story show ### {#scrollable-animation-usecase}
98+ ## Scrollable picture-story show ## {#scrollable-animation-usecase}
15099
151100Another pattern is an animation that tells a story where the user
152101controls the progress of the animation by scrolling or some other
@@ -247,7 +196,7 @@ if (window.matchMedia('(prefers-reduced-motion: no-preference)').matches) {
247196}
248197</pre>
249198
250- ### The content progress bar # ## {#content-progress-bar-usecase}
199+ ## The content progress bar ## {#content-progress-bar-usecase}
251200
252201Another common example of an animation that tracks scroll position is a
253202progress bar that is used to indicate the reader's position in a long
@@ -449,7 +398,7 @@ not by wall-clock time, but by the progress of scrolling in a [=scroll container
449398
450399: <dfn attribute for=ScrollTimeline>orientation</dfn>
451400:: Determines the direction of scrolling which triggers the activation and drives
452- the progress of the trigger .
401+ the progress of the timeline .
453402
454403: <dfn attribute for=ScrollTimeline>start</dfn>
455404:: A scroll offset, in the direction specified by {{orientation}} , which constitutes
@@ -472,7 +421,7 @@ not by wall-clock time, but by the progress of scrolling in a [=scroll container
472421
473422: <dfn attribute for=ScrollTimeline>end</dfn>
474423:: A scroll offset, in the direction specified by {{orientation}} , which constitutes
475- the end of the range in which the trigger is activated.
424+ the end of the range in which the timeline is activated.
476425
477426 Recognized values are defined by the following grammar:
478427
@@ -856,30 +805,6 @@ run), the user agent may likewise choose not to sample scroll-driven animations
856805for that composited frame. In such cases, the rendered scroll offset and the
857806state of a scroll-driven animation may be inconsistent in the composited frame.
858807
859- # Scroll-triggered (but time-driven) animations # {#scroll-triggered-animations}
860-
861- An earlier draft of this proposal also provided for animations whose progress
862- was driven by time (as with existing animations), but whose activation was
863- triggered by scrolling past a certain scroll offset or into a given scroll range.
864-
865- The main objective was to allow triggering the animation from the compositor
866- thread. (The objective of scroll-linked animations is to make sure that
867- the animation is in sync with the scroll position on each composited frame.
868- If the triggering doesn't happen on the compositor thread, then it's possible
869- that for a few frames the visual scroll position is such that the animation
870- should have started, but it has not in fact started yet because the main thread,
871- which is doing the triggering, is lagging behind.)
872-
873- However, we found that in the vast majority of cases where a web author would
874- want to do this, they would want to do it for a CSS transition (as opposed to
875- a CSS animation). Unfortunately, it's not possible to trigger CSS transitions from
876- the compositor thread (because triggering a transition requires style resolution,
877- which cannot be performed on the compositor thread). Given the extent to which
878- triggering complicated the API, we decided it wasn't worth it if you can't use
879- it for transitions, so this feature was removed.
880-
881- The design space for triggering animations is still open. We welcome input
882- on this subject.
883808
884809<h2 id="appendix-a-considerations-for-security-and-privacy">Appendix A. Considerations for Security and Privacy</h2>
885810
0 commit comments