Skip to content

Commit 4c50d91

Browse files
saschanazemilio
authored andcommitted
Restore scrollTo({ behavior: "instant" }
This reverts commit b270d90. Also clarifies that the algorithm covers `behavior: "instant"` so that no one will retry removing it.
1 parent e8ade2c commit 4c50d91

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cssom-view-1/Overview.bs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,15 @@ the following steps must be run:
359359
</ul>
360360
...then perform a <a>smooth scroll</a> of <var>box</var> to <var>position</var>. Once the position has finished updating, emit the <a event>scrollend</a> event.
361361
Otherwise, perform an <a>instant scroll</a> of <var>box</var> to <var>position</var>. After an <a>instant scroll</a> emit the <a event>scrollend</a> event.
362-
362+
363+
Note: <code>behavior: "instant"</code> always performs an <a>instant scroll</a> by this algorithm.
364+
363365
Note: If the scroll position did not change as a result of the user interaction or programmatic invocation, where no translations were applied as a result, then no <a event>scrollend</a> event fires because no scrolling occured.
364366

365367
Note: In the case the VisualViewport was scrolled, yielding no translation changes in the document, emit the <a event>scrollend</a> on the VisualViewport just as the <a event>scroll</a> event is emitted for VisualViewport scrolling.
366368
</ol>
367369

368-
Scroll is <dfn lt="scroll completed">completed</dfn> when the scroll position has no more pending updates or translations and the user has completed their gesture. Scroll position updates include smooth or instant mouse wheel scrolling, keyboard scrolling, scroll-snap events, or other APIs and gestures which cause the scroll position to update and possibly interpolate. User gestures like touch panning or trackpad scrolling aren't complete until pointers or keys have released.
370+
Scroll is <dfn lt="scroll completed">completed</dfn> when the scroll position has no more pending updates or translations and the user has completed their gesture. Scroll position updates include smooth or instant mouse wheel scrolling, keyboard scrolling, scroll-snap events, or other APIs and gestures which cause the scroll position to update and possibly interpolate. User gestures like touch panning or trackpad scrolling aren't complete until pointers or keys have released.
369371

370372
When a user agent is to perform a <dfn export id=concept-smooth-scroll>smooth scroll</dfn> of a <a>scrolling box</a> <var>box</var> to <var>position</var>,
371373
it must update the scroll position of <var>box</var> in a user-agent-defined fashion over a user-agent-defined amount of time. When the scroll is
@@ -402,7 +404,7 @@ then <var>x</var> must be changed to the value <code>0</code>. [[!WEBIDL]]
402404
<h2 id=extensions-to-the-window-interface>Extensions to the {{Window}} Interface</h2>
403405

404406
<pre class=idl>
405-
enum ScrollBehavior { "auto", "smooth" };
407+
enum ScrollBehavior { "auto", "instant", "smooth" };
406408

407409
dictionary ScrollOptions {
408410
ScrollBehavior behavior = "auto";

0 commit comments

Comments
 (0)