You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-overflow-5/Overview.bs
+57-28
Original file line number
Diff line number
Diff line change
@@ -154,6 +154,28 @@ its content will be integrated into this specification,
154
154
which will then replace it.
155
155
Until then, this specification only contains additions and extensions to level 4.
156
156
157
+
<h2 id="overflow-concepts">
158
+
Overflow Concepts and Terminology</h2>
159
+
160
+
Issue: Copy [[css-overflow-3#overflow-concepts|Level 3 content]] when final.
161
+
162
+
<h3 id="scrolling">Scrolling overflow</h3>
163
+
164
+
The following is added to the concepts in scrolling overflow:
165
+
166
+
Every [=scroll container=] maintains a <dfn export>current scroll target</dfn>.
167
+
It is initially <code>null</code>,
168
+
and is reset to <code>null</code> after any scrolling operations in that [=scroll container=]
169
+
initiated by the user,
170
+
or any script initiated operations that do not have a target,
171
+
or when the target is removed from the document.
172
+
Scrolling operations in the [=scroll container=] with a target Element or PseudoElement,
173
+
set the [=current scroll target=] to that target Element or PseudoElement.
174
+
175
+
Issue: Setting the current scroll target should be defined in how to <a>scroll a target into view</a>.
176
+
177
+
Issue: Use the current scroll target as an <a>anchor priority candidate</a> for scroll anchoring.
178
+
157
179
<h2 id="scroll-navigation">
158
180
Scroll navigation controls</h2>
159
181
@@ -304,34 +326,41 @@ Selecting The Active Scroll Marker: the '':target-current'' pseudo-class</h4>
304
326
1. Let <var>scroller</var> be |active|.
305
327
1. Let <var>targets</var> be the set of the [=scroll target=] elements whose nearest ancestor [=scroll container=] is |scroller|
306
328
and the [=scroll container=] elements which contain [=scroll target=] elements targeted by the [=scroll marker group=] whose nearest ancestor [=scroll container=] is |scroller|.
307
-
1. Let <var>primary</var> be the primary scrolling axis, assumed to be the block direction of the container's writing-mode.
308
-
1. Let <var>secondary</var> be the scrolling axis perpendicular to primary.
309
-
1. Let <var>position</var> be the 'eventual scroll position' considering ongoing scrolling operations.
310
-
1. For each <var>axis</var> of |primary|, followed by |secondary|:
311
-
1. Let <var>scrollport size</var> be the client size of |scroller| in the dimension |axis|.
312
-
1. For each |target| in |targets|, <a>determine the scroll-into-view position</a> of |target| in |axis|, storing this as the associated |target position| of |target|.
313
-
1. Let <var>scroll size</var> be the length of the <a>scrollable overflow area</a> of the |scroller| in the dimension |axis|.
314
-
1. Let <var>scroll range</var> be <code>|scroll size| - |scrollport size|</code>.
315
-
1. If |scroll range| is greater than 0, redistribute unreachable target positions:
316
-
1. Let <var>distribute range</var> be <code>min(1/8 * |scrollport size|, |scroll range| / 2)</code>.
317
-
1. Let <var>before targets</var> be all |targets| whose associated |target position| is less than <code>|distribute range|</code>.
318
-
1. Let <var>minimum position</var> be the minimum |target position| of |before targets|.
319
-
1. Update the associated |target position| of each target in |before targets| to
1. Let |active| be the all of the |targets| whose associated |target position| is |selected position|.
334
-
1. Let |active| be the first item in |active| if it has more than one potential target.
329
+
1. : If |scroller| has a non-null [=current scroll target=]
330
+
::
331
+
Let active be the first item in |targets| encountered by a reverse tree order walk starting from the [=current scroll target=],
332
+
or the first item in tree order in |targets| if no target is found in the previous walk.
333
+
334
+
: Otherwise,
335
+
::
336
+
337
+
1. Let <var>primary</var> be the primary scrolling axis, assumed to be the block direction of the container's writing-mode.
338
+
1. Let <var>secondary</var> be the scrolling axis perpendicular to primary.
339
+
1. Let <var>position</var> be the 'eventual scroll position' considering ongoing scrolling operations.
340
+
1. For each <var>axis</var> of |primary|, followed by |secondary|:
341
+
1. Let <var>scrollport size</var> be the client size of |scroller| in the dimension |axis|.
342
+
1. For each |target| in |targets|, <a>determine the scroll-into-view position</a> of |target| in |axis|, storing this as the associated |target position| of |target|.
343
+
1. Let <var>scroll size</var> be the length of the <a>scrollable overflow area</a> of the |scroller| in the dimension |axis|.
344
+
1. Let <var>scroll range</var> be <code>|scroll size| - |scrollport size|</code>.
345
+
1. If |scroll range| is greater than 0, redistribute unreachable target positions:
346
+
1. Let <var>distribute range</var> be <code>min(1/8 * |scrollport size|, |scroll range| / 2)</code>.
347
+
1. Let <var>before targets</var> be all |targets| whose associated |target position| is less than <code>|distribute range|</code>.
348
+
1. Let <var>minimum position</var> be the minimum |target position| of |before targets|.
349
+
1. Update the associated |target position| of each target in |before targets| to
0 commit comments