diff --git a/css-overflow-5/Overview.bs b/css-overflow-5/Overview.bs index 3e772f914a8..7a225008bdd 100644 --- a/css-overflow-5/Overview.bs +++ b/css-overflow-5/Overview.bs @@ -154,6 +154,28 @@ its content will be integrated into this specification, which will then replace it. Until then, this specification only contains additions and extensions to level 4. +
null
,
+and is reset to null
after any scrolling operations in that [=scroll container=]
+initiated by the user,
+or any script initiated operations that do not have a target,
+or when the target is removed from the document.
+Scrolling operations in the [=scroll container=] with a target Element or PseudoElement,
+set the [=current scroll target=] to that target Element or PseudoElement.
+
+Issue: Setting the current scroll target should be defined in how to scroll a target into view.
+
+Issue: Use the current scroll target as an anchor priority candidate for scroll anchoring.
+
|scroll size| - |scrollport size|
.
- 1. If |scroll range| is greater than 0, redistribute unreachable target positions:
- 1. Let distribute range be min(1/8 * |scrollport size|, |scroll range| / 2)
.
- 1. Let before targets be all |targets| whose associated |target position| is less than |distribute range|
.
- 1. Let minimum position be the minimum |target position| of |before targets|.
- 1. Update the associated |target position| of each target in |before targets| to
- (|target position| - |minimum position|) / (|distribute range| - |minimum position|) * |distribute range|
.
- 1. Let after targets be all |targets| whose associated |target position| is greater than |scroll range| - |distribute range|
.
- 1. Let maximum position be the maximum |target position| of |after targets|.
- 1. Update the associated |target position| of each target in |after targets| to
- (|target position| - (|scroll range| - |distribute range|)) / (|maximum position| - (|scroll range| - |distribute range|)) * |distribute range| + (|scroll range| - |distribute range|)
.
- 1. Let |selected position| be the largest |target position|
- where |target position| is equal to or before |position| in the |axis|,
- or whose nearest smaller |target position| < |position| - |scrollport size| / 2 and whose |target position| < |position| + |scrollport size| / 2.
-
- 1. : If there is no such position,
- ::
- Set the |selected position| to the first one.
-
- 1. Let |active| be the all of the |targets| whose associated |target position| is |selected position|.
- 1. Let |active| be the first item in |active| if it has more than one potential target.
+ 1. : If |scroller| has a non-null [=current scroll target=]
+ ::
+ Let active be the first item in |targets| encountered by a reverse tree order walk starting from the [=current scroll target=],
+ or the first item in tree order in |targets| if no target is found in the previous walk.
+
+ : Otherwise,
+ ::
+
+ 1. Let primary be the primary scrolling axis, assumed to be the block direction of the container's writing-mode.
+ 1. Let secondary be the scrolling axis perpendicular to primary.
+ 1. Let position be the 'eventual scroll position' considering ongoing scrolling operations.
+ 1. For each axis of |primary|, followed by |secondary|:
+ 1. Let scrollport size be the client size of |scroller| in the dimension |axis|.
+ 1. For each |target| in |targets|, determine the scroll-into-view position of |target| in |axis|, storing this as the associated |target position| of |target|.
+ 1. Let scroll size be the length of the scrollable overflow area of the |scroller| in the dimension |axis|.
+ 1. Let scroll range be |scroll size| - |scrollport size|
.
+ 1. If |scroll range| is greater than 0, redistribute unreachable target positions:
+ 1. Let distribute range be min(1/8 * |scrollport size|, |scroll range| / 2)
.
+ 1. Let before targets be all |targets| whose associated |target position| is less than |distribute range|
.
+ 1. Let minimum position be the minimum |target position| of |before targets|.
+ 1. Update the associated |target position| of each target in |before targets| to
+ (|target position| - |minimum position|) / (|distribute range| - |minimum position|) * |distribute range|
.
+ 1. Let after targets be all |targets| whose associated |target position| is greater than |scroll range| - |distribute range|
.
+ 1. Let maximum position be the maximum |target position| of |after targets|.
+ 1. Update the associated |target position| of each target in |after targets| to
+ (|target position| - (|scroll range| - |distribute range|)) / (|maximum position| - (|scroll range| - |distribute range|)) * |distribute range| + (|scroll range| - |distribute range|)
.
+ 1. Let |selected position| be the largest |target position|
+ where |target position| is equal to or before |position| in the |axis|,
+ or whose nearest smaller |target position| < |position| - |scrollport size| / 2 and whose |target position| < |position| + |scrollport size| / 2.
+ 1. : If there is no such position,
+ ::
+ Set the |selected position| to the first one.
+
+ 1. Let |active| be the all of the |targets| whose associated |target position| is |selected position|.
+ 1. Let |active| be the first item in |active| if it has more than one potential target.
1. Let |selected marker| be the [=scroll marker=] associated with |active|.
If multiple [=scroll marker=] elements are associated with |active|,