From 0bb2be7a27744617abd4aaff0a3640c5a133ddc8 Mon Sep 17 00:00:00 2001
From: David Awogbemila
Initial scroll target
- The [=initial scroll target=] of a scroll container |scrollcontainer|
+ An [=initial scroll target=] of a scroll container |scrollcontainer|
is an element or pseudo-element
whose 'scroll-start-target'property is non-''scroll-start-target/none''
- and whose nearest scroll container is |scrollcontainer|.
- When multiple such elements or pseudo-elements exist,
- user-agents should select the one
- which comes first in [=tree order=].
- When no such element or pseudo-element exists,
- |scrollcontainer|’s initial scroll target is null.
-
- Determining initial scroll position from
+ scroll-start-target
+ To determine the initial scroll position of a scroll container |scrollcontainer| using its
+ initial scroll targets, user-agents should run the following steps:
+
+ 1. Let initial-scroll-target-list be a list of the initial scroll targets of |scrollcontainer|,
+ sorted in reverse tree order.
+ 1. For |target| in initial-scroll-target-list:
+ 1. Let |position| be the result of running the steps to
+ determine the scroll-into-view position of |target|
+ with behavior set to "auto",
+ block set to "start",
+ inline set to "nearest",
+ and scrolling box set to |scrollcontainer|.
+ 1. Set |scrollcontainer|'s initial scroll position to |position|.
+
+NOTE: Sorting initial-scroll-target-list in reverse
+tree order
+is intended to prioritize having the first initial scroll target in tree order
+scrolled into view.
scroll-start-target Property Definition
@@ -199,10 +200,9 @@ Post-first layout arrivals
a scroll container's [=initial scroll target=] might arrive
after that scroll container has been laid out.
If this happens,
- user agents should still scroll to the [=initial scroll target=]
- unless the user agent has reason to believe
- the user is no longer interested
- in scrolling to the initial scroll position.
+ user agents should still scroll to the initial scroll position
+ determined by 'scroll-start-target' unless the user agent has reason to believe
+ the user is no longer interested in scrolling to the initial scroll position.