merge_pr_49802
[carousel] Pin the selected scroll-marker for targeted scrolls
The CSS working group resolved[1] that when a scroll operation is aimed
at an element, i.e. Element.scrollIntoView, the associated
scroll-marker-group should select the active scroll-marker based on the
element which the operation is intending to scroll to. In such cases,
the scroll-marker that should be selected is the scroll-marker
associated with the first scroll target (a scroll target is an element
which generates a scroll-marker) found through a search starting from
the target of the scrollIntoView itself and backwards in tree-order.
As soon as some other type of scroll occurs, e.g. Element.scrollTo, or
a user gesture scroll, the scroll-marker-group should no longer
consider its active marker pinned, i.e. it should be based on the
scroll position.
This patch implements this for elements in general, but not for
::column pseudo elements which may also act as scroll targets since
::column::scroll-marker is allowed. The ::column case needs to be
handled specially as ::column pseudos are not parents of the elements
which are flowed into them in the DOM tree. This will be done in a
follow-up patch.
[1] w3c/csswg-drafts#10738 (comment)
Bug: 380062280
Change-Id: I363e0f055f9791ead0b35f4bbe037db91f299624
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6089232
Reviewed-by: Steve Kobes [email protected]
Commit-Queue: David Awogbemila [email protected]
Cr-Commit-Position: refs/heads/main@{#1399197}