From e56711b75469ca5c903ef40c81502cb01504d89b Mon Sep 17 00:00:00 2001 From: Vladimir Levin Date: Thu, 7 May 2020 12:15:43 -0400 Subject: [PATCH 1/6] Added priority candidates --- css-scroll-anchoring-1/Overview.bs | 40 ++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/css-scroll-anchoring-1/Overview.bs b/css-scroll-anchoring-1/Overview.bs index bc5b8311281..62c4cb0370a 100644 --- a/css-scroll-anchoring-1/Overview.bs +++ b/css-scroll-anchoring-1/Overview.bs @@ -76,7 +76,8 @@ Anchor Node Selection Each scrolling box aims to select an anchor node that is deep in the DOM -and close to the block start edge of its optimal viewing region. +and either should be prioritized as an important DOM node or is close to the +block start edge of its optimal viewing region. Note: If the user agent does not support the 'scroll-padding' property, the optimal viewing region of the scrolling box is equivalent to its content area. @@ -85,16 +86,41 @@ An anchor node can be any box except one for a non-atomic inline. The anchor node is always a descendant of the scrolling box. In some cases, a scrolling box may not select any anchor node. +An element |C| is a viable candidate +for becoming a scroll anchor for a scrolling box |S| if it meets all of the +following criteria: + * |C| is a non-atomic inline. + * |C| is partially visible or fully visible in |S| + * |C| is a descendant of |S| + * |C| is not in an excluded subtree + * None of the ancestors of |C| up to |S| are in an excluded subtree + +Some elements are considered to be priority candidates for anchor selection: + 1. An element that has focus. + 2. An element containing the insertion caret. + 3. An element containing the current active selected match of the + find-in-page user-agent algorithm. If the match spans multiple elements, then + consider only the first such element. + +Note that if the priority candidate is an atomic inline element, +then instead consider its nearest non-atomic inline ancestor element as the +priority candidate. +
The anchor node selection algorithm for a scrolling box |S| is as follows: - 1. If |S| is associated with an element - whose computed value of the 'overflow-anchor' property is ''overflow-anchor/none'', - then do not select an anchor node for |S|. - 2. Otherwise, for each DOM child |N| of the element or document associated with |S|, - perform the candidate examination algorithm for |N| in |S|, - and terminate if it selects an anchor node. + 1. If |S| is associated with an element whose computed value of the + 'overflow-anchor' property is ''overflow-anchor/none'', then do not select an + anchor node for |S|. + 2. Otherwise, for each priority candidate |PC| in order specified, + check if |PC| is a viable candidate in |S|. If so, select it as an + anchor node and terminate. + 3. Otherwise, for each DOM child |N| of the element or document associated + with |S|, perform the candidate examination algorithm for |N| in |S|, + and terminate if it selects an anchor node. +
From f353282d7c5e1c423be133bc0bf35eb9a08db7e9 Mon Sep 17 00:00:00 2001 From: Vladimir Levin Date: Fri, 8 May 2020 11:39:58 -0400 Subject: [PATCH 2/6] Fix atomic/non-atomic inline text --- css-scroll-anchoring-1/Overview.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/css-scroll-anchoring-1/Overview.bs b/css-scroll-anchoring-1/Overview.bs index 62c4cb0370a..721ec87a7fa 100644 --- a/css-scroll-anchoring-1/Overview.bs +++ b/css-scroll-anchoring-1/Overview.bs @@ -89,7 +89,7 @@ In some cases, a scrolling box may not select any anchor node. An element |C| is a viable candidate for becoming a scroll anchor for a scrolling box |S| if it meets all of the following criteria: - * |C| is a non-atomic inline. + * |C| is an element that is not a non-atomic inline. * |C| is partially visible or fully visible in |S| * |C| is a descendant of |S| * |C| is not in an excluded subtree @@ -103,9 +103,9 @@ id="anchor-priority-candidates">priority candidates for anchor selection: find-in-page user-agent algorithm. If the match spans multiple elements, then consider only the first such element. -Note that if the priority candidate is an atomic inline element, -then instead consider its nearest non-atomic inline ancestor element as the -priority candidate. +Note that if the priority candidate is a non-atomic inline +element, then instead consider its nearest ancestor element that is not a +non-atomic inline element as the priority candidate.
The anchor node selection algorithm From 665a1e81214b11267edf77677612a500a529335c Mon Sep 17 00:00:00 2001 From: Vladimir Levin Date: Fri, 8 May 2020 15:39:25 -0400 Subject: [PATCH 3/6] Updated formatting and focus link --- css-scroll-anchoring-1/Overview.bs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/css-scroll-anchoring-1/Overview.bs b/css-scroll-anchoring-1/Overview.bs index 721ec87a7fa..967e2a324bc 100644 --- a/css-scroll-anchoring-1/Overview.bs +++ b/css-scroll-anchoring-1/Overview.bs @@ -97,7 +97,7 @@ following criteria: Some elements are considered to be priority candidates for anchor selection: - 1. An element that has focus. + 1. An element that has focus. 2. An element containing the insertion caret. 3. An element containing the current active selected match of the find-in-page user-agent algorithm. If the match spans multiple elements, then @@ -111,15 +111,15 @@ non-atomic inline element as the priority candidate. The anchor node selection algorithm for a scrolling box |S| is as follows: - 1. If |S| is associated with an element whose computed value of the - 'overflow-anchor' property is ''overflow-anchor/none'', then do not select an - anchor node for |S|. - 2. Otherwise, for each priority candidate |PC| in order specified, - check if |PC| is a viable candidate in |S|. If so, select it as an - anchor node and terminate. - 3. Otherwise, for each DOM child |N| of the element or document associated - with |S|, perform the candidate examination algorithm for |N| in |S|, - and terminate if it selects an anchor node. + 1. If |S| is associated with an element + whose computed value of the 'overflow-anchor' property is ''overflow-anchor/none'', + then do not select an anchor node for |S|. + 2. Otherwise, for each priority candidate |PC| in order specified, + check if |PC| is a viable candidate in |S|. If so, select it as an + anchor node and terminate. + 3. Otherwise, for each DOM child |N| of the element or document associated with |S|, + perform the candidate examination algorithm for |N| in |S|, + and terminate if it selects an anchor node.
From 0d1c3bdb9d14ef5c4355ea4a36c62c9ec635a243 Mon Sep 17 00:00:00 2001 From: Vladimir Levin Date: Mon, 11 May 2020 10:22:31 -0400 Subject: [PATCH 4/6] Updated focused element text --- css-scroll-anchoring-1/Overview.bs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/css-scroll-anchoring-1/Overview.bs b/css-scroll-anchoring-1/Overview.bs index 967e2a324bc..980f03c006e 100644 --- a/css-scroll-anchoring-1/Overview.bs +++ b/css-scroll-anchoring-1/Overview.bs @@ -97,7 +97,9 @@ following criteria: Some elements are considered to be priority candidates for anchor selection: - 1. An element that has focus. + 1. The DOM anchor + of the focused area + of the document. 2. An element containing the insertion caret. 3. An element containing the current active selected match of the find-in-page user-agent algorithm. If the match spans multiple elements, then From 9928f132489d41f995657acaeaac631eb57671be Mon Sep 17 00:00:00 2001 From: Vladimir Levin Date: Mon, 11 May 2020 15:03:44 -0400 Subject: [PATCH 5/6] Update html spec links for readability --- css-scroll-anchoring-1/Overview.bs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/css-scroll-anchoring-1/Overview.bs b/css-scroll-anchoring-1/Overview.bs index 980f03c006e..10865ff9518 100644 --- a/css-scroll-anchoring-1/Overview.bs +++ b/css-scroll-anchoring-1/Overview.bs @@ -29,6 +29,13 @@ spec:css22; text:width type:dfn; text:line box +
+spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/;
+    urlPrefix: interaction.html
+        type: dfn;
+            text:DOM anchor
+            text:focused area of the document
+

Introduction

@@ -97,9 +104,7 @@ following criteria: Some elements are considered to be priority candidates for anchor selection: - 1. The DOM anchor - of the focused area - of the document. + 1. The [=DOM anchor=] of the [=focused area of the document=]. 2. An element containing the insertion caret. 3. An element containing the current active selected match of the find-in-page user-agent algorithm. If the match spans multiple elements, then From ebc427bf95dbc8f6a7f0bf9100c11b4e9bfa9149 Mon Sep 17 00:00:00 2001 From: Vladimir Levin Date: Wed, 13 May 2020 14:33:14 -0400 Subject: [PATCH 6/6] Remove insertion caret from priority list --- css-scroll-anchoring-1/Overview.bs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/css-scroll-anchoring-1/Overview.bs b/css-scroll-anchoring-1/Overview.bs index 10865ff9518..272a12d5c1c 100644 --- a/css-scroll-anchoring-1/Overview.bs +++ b/css-scroll-anchoring-1/Overview.bs @@ -105,8 +105,7 @@ following criteria: Some elements are considered to be priority candidates for anchor selection: 1. The [=DOM anchor=] of the [=focused area of the document=]. - 2. An element containing the insertion caret. - 3. An element containing the current active selected match of the + 2. An element containing the current active selected match of the find-in-page user-agent algorithm. If the match spans multiple elements, then consider only the first such element.