From 61a2d96f5a7dd2dd618fe66cb596ec5f6124b9bd Mon Sep 17 00:00:00 2001 From: David Awogbemila Date: Fri, 20 Dec 2024 08:52:24 -0800 Subject: [PATCH] [carousel] Implement targeted scroll-marker selection for ::column ::column pseudos[1] may create ::scroll-markers, but do not exist in the DOM tree as parents of the elements which are flowed into them. They also do not appear to have LayoutObjects and are not found[2] in the layout tree. So, when searching for the appropriate scroll-marker to select for a targeted scroll we need to consider whether the scroll-marker-generating element (marker-generating-element) found in the layout tree is also flowed into the same scroll-marker-generating ::column (marker-generating-column) as the target of the scrollIntoView operation. If the target and marker-generating-element are both in marker-generating-column, marker-generating-element is the preferred[3] choice. The only means we have of checking whether an element is flowed into a ::column is by looking at the rect associated with that ::column. [1] https://drafts.csswg.org/css-multicol-2/#column-pseudo [2] https://source.chromium.org/chromium/chromium/src/+/165f5ddad25b289f886a248ca810d075b1e7bb87:third_party/blink/renderer/core/page/scrolling/snap_coordinator.cc;l=254-255 [3] https://github.com/w3c/csswg-drafts/issues/10738#issuecomment-2557319506 Bug: 380062280 Change-Id: Ie2ad58c3beca13a4945325d9aa9c4aec6a5fc332 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6088285 Commit-Queue: David Awogbemila Reviewed-by: Steve Kobes Cr-Commit-Position: refs/heads/main@{#1399198} --- ...olumn-scroll-marker-selection-001-ref.html | 89 +++++++++++++ ...ed-column-scroll-marker-selection-001.html | 103 +++++++++++++++ ...olumn-scroll-marker-selection-002-ref.html | 95 ++++++++++++++ ...ed-column-scroll-marker-selection-002.html | 103 +++++++++++++++ ...olumn-scroll-marker-selection-003-ref.html | 119 +++++++++++++++++ ...ed-column-scroll-marker-selection-003.html | 112 ++++++++++++++++ ...olumn-scroll-marker-selection-004-ref.html | 123 ++++++++++++++++++ ...ed-column-scroll-marker-selection-004.html | 113 ++++++++++++++++ 8 files changed, 857 insertions(+) create mode 100644 css/css-overflow/targeted-column-scroll-marker-selection-001-ref.html create mode 100644 css/css-overflow/targeted-column-scroll-marker-selection-001.html create mode 100644 css/css-overflow/targeted-column-scroll-marker-selection-002-ref.html create mode 100644 css/css-overflow/targeted-column-scroll-marker-selection-002.html create mode 100644 css/css-overflow/targeted-column-scroll-marker-selection-003-ref.html create mode 100644 css/css-overflow/targeted-column-scroll-marker-selection-003.html create mode 100644 css/css-overflow/targeted-column-scroll-marker-selection-004-ref.html create mode 100644 css/css-overflow/targeted-column-scroll-marker-selection-004.html diff --git a/css/css-overflow/targeted-column-scroll-marker-selection-001-ref.html b/css/css-overflow/targeted-column-scroll-marker-selection-001-ref.html new file mode 100644 index 00000000000000..e4dbe28a85a987 --- /dev/null +++ b/css/css-overflow/targeted-column-scroll-marker-selection-001-ref.html @@ -0,0 +1,89 @@ + + + + + + CSS Test: scroll tracking for ::scroll-markers whose orignatin elements cannot be scroll-aligned + + + + + +
+ +
+ + + diff --git a/css/css-overflow/targeted-column-scroll-marker-selection-001.html b/css/css-overflow/targeted-column-scroll-marker-selection-001.html new file mode 100644 index 00000000000000..a9b79ae1d097dc --- /dev/null +++ b/css/css-overflow/targeted-column-scroll-marker-selection-001.html @@ -0,0 +1,103 @@ + + + + + + CSS Test: scroll tracking for ::scroll-markers whose orignatin elements cannot be scroll-aligned + + + + + + + + + +
+ +
+ + + + diff --git a/css/css-overflow/targeted-column-scroll-marker-selection-002-ref.html b/css/css-overflow/targeted-column-scroll-marker-selection-002-ref.html new file mode 100644 index 00000000000000..63790cb7edc623 --- /dev/null +++ b/css/css-overflow/targeted-column-scroll-marker-selection-002-ref.html @@ -0,0 +1,95 @@ + + + + + + CSS Test: scroll tracking for ::scroll-markers whose orignatin elements cannot be scroll-aligned + + + + + +
+ +
+ + + diff --git a/css/css-overflow/targeted-column-scroll-marker-selection-002.html b/css/css-overflow/targeted-column-scroll-marker-selection-002.html new file mode 100644 index 00000000000000..08c3a302a5491c --- /dev/null +++ b/css/css-overflow/targeted-column-scroll-marker-selection-002.html @@ -0,0 +1,103 @@ + + + + + + CSS Test: scroll tracking for ::scroll-markers whose orignatin elements cannot be scroll-aligned + + + + + + + + + +
+ +
+ + + + diff --git a/css/css-overflow/targeted-column-scroll-marker-selection-003-ref.html b/css/css-overflow/targeted-column-scroll-marker-selection-003-ref.html new file mode 100644 index 00000000000000..79bc87ff729472 --- /dev/null +++ b/css/css-overflow/targeted-column-scroll-marker-selection-003-ref.html @@ -0,0 +1,119 @@ + + + + + + CSS Test: scroll tracking for ::scroll-markers whose orignatin elements cannot be scroll-aligned + + + + + +
+ +
+
+ + + diff --git a/css/css-overflow/targeted-column-scroll-marker-selection-003.html b/css/css-overflow/targeted-column-scroll-marker-selection-003.html new file mode 100644 index 00000000000000..4f8f68646ded53 --- /dev/null +++ b/css/css-overflow/targeted-column-scroll-marker-selection-003.html @@ -0,0 +1,112 @@ + + + + + + CSS Test: scroll tracking for ::scroll-markers whose orignatin elements cannot be scroll-aligned + + + + + + + + + +
+ +
+ + + + diff --git a/css/css-overflow/targeted-column-scroll-marker-selection-004-ref.html b/css/css-overflow/targeted-column-scroll-marker-selection-004-ref.html new file mode 100644 index 00000000000000..48baf79e80dc6f --- /dev/null +++ b/css/css-overflow/targeted-column-scroll-marker-selection-004-ref.html @@ -0,0 +1,123 @@ + + + + + + CSS Test: scroll tracking for ::scroll-markers whose orignatin elements cannot be scroll-aligned + + + + + +
+ +
+
+ + + diff --git a/css/css-overflow/targeted-column-scroll-marker-selection-004.html b/css/css-overflow/targeted-column-scroll-marker-selection-004.html new file mode 100644 index 00000000000000..60ed33c73b673f --- /dev/null +++ b/css/css-overflow/targeted-column-scroll-marker-selection-004.html @@ -0,0 +1,113 @@ + + + + + + CSS Test: scroll tracking for ::scroll-markers whose orignatin elements cannot be scroll-aligned + + + + + + + + + +
+ +
+
+ + + +