From 9bbcdbf23b7b1ba83b82211b46f84c488bfc98e9 Mon Sep 17 00:00:00 2001 From: David Awogbemila Date: Fri, 20 Dec 2024 08:52:16 -0800 Subject: [PATCH] [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] https://github.com/w3c/csswg-drafts/issues/10738#issuecomment-2489046785 Bug: 380062280 Change-Id: I363e0f055f9791ead0b35f4bbe037db91f299624 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6089232 Reviewed-by: Steve Kobes Commit-Queue: David Awogbemila Cr-Commit-Position: refs/heads/main@{#1399197} --- ...ted-scroll-marker-selection.tentative.html | 247 ++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 css/css-overflow/targeted-scroll-marker-selection.tentative.html diff --git a/css/css-overflow/targeted-scroll-marker-selection.tentative.html b/css/css-overflow/targeted-scroll-marker-selection.tentative.html new file mode 100644 index 00000000000000..0f1f6640546ccd --- /dev/null +++ b/css/css-overflow/targeted-scroll-marker-selection.tentative.html @@ -0,0 +1,247 @@ + + + + + + CSS Test: scroll tracking for ::scroll-markers whose orignatin elements cannot be scroll-aligned + + + + + + + + + + + + +
+ +
+ + + + \ No newline at end of file