Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP:viewport-perform-a-scroll
  • Loading branch information
mustaqahmed committed Jul 17, 2025
commit 4fd84a2f8b25aeacd727ae732256712bdd4b13f2
7 changes: 7 additions & 0 deletions cssom-view-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ the following steps must be run:
</div>

<div algorithm="perform a scroll of a viewport">
<!-- @@@:done -->

When a user agent is to <dfn for="viewport" export>perform a scroll</dfn> of a <a>viewport</a> to a given position <var>position</var> and optionally a scroll behavior <var>behavior</var>
(which is "<code>auto</code>" if omitted) it must perform a coordinated viewport scroll by following these steps:
Expand All @@ -465,8 +466,14 @@ When a user agent is to <dfn for="viewport" export>perform a scroll</dfn> of a <
1. Let <var>element</var> be <var>doc</var>'s root element if there is one, null otherwise.
1. <a for="/">Perform a scroll</a> of the <a>viewport</a>'s <a>scrolling box</a> to its current scroll position + (<var>layout dx</var>, <var>layout dy</var>) with <var>element</var> as the
associated element, and <var>behavior</var> as the scroll behavior.
Let <var>scrollPromise1</var> be the promise returned from this step.
1. <a for="/">Perform a scroll</a> of <var>vv</var>'s <a>scrolling box</a> to its current scroll position + (<var>visual dx</var>, <var>visual dy</var>) with <var>element</var> as the associated
element, and <var>behavior</var> as the scroll behavior.
Let <var>scrollPromise2</var> be the promise returned from this step.
1. If both <var>scrollPromise1</var> and <var>scrollPromise2</var> get resolved with true,
return a promise resolved with true.
Otherwise (either one gets resolved with false or gets rejected)
return a promise resolved with a false.

Note: Conceptually, the visual viewport is scrolled until it "bumps up" against the layout viewport
edge and then "pushes" the layout viewport by applying the scroll delta to the layout viewport.
Expand Down