From 76e9602edde672dded09e26e8cc7d8141af68de3 Mon Sep 17 00:00:00 2001
From: Simon Pieters
-enum ScrollLogicalPosition { "start", "end" };
+enum ScrollLogicalPosition { "start", "center", "end" };
dictionary ScrollIntoViewOptions : ScrollOptions {
ScrollLogicalPosition block = "start";
+ ScrollLogicalPosition inline;
};
partial interface Element {
@@ -1049,7 +1051,7 @@ algorithm:
The scrollIntoView(arg) method must run these steps:
-
+
1. Let options be null.
1. If arg is an object, let options be arg.
@@ -1057,8 +1059,7 @@ The scrollIntoView(arg) method must run
1. If arg is false, let the {{ScrollIntoViewOptions/block}} dictionary member of options have the value "end".
1. If the element does not have any associated layout box terminate these steps.
1. Scroll the element into view
- with the align to top flag set if options {{ScrollIntoViewOptions/block}} dictionary member has the value "start",
- and the scroll behavior being the value of the {{ScrollOptions/behavior}} dictionary member of options.
+ with the options options.
1. Optionally perform some other action that brings the element to the user's attention.
The scroll() method must run these steps:
@@ -1218,8 +1219,9 @@ document are not reflected in the objects.
{{Element}} Scrolling Members {#element-scrolling-members}
----------------------------------------------------------
-To scroll an element into view element, optionally with an align to top flag set, and optionally with a scroll behavior
-behavior (which is "auto" if omitted), means to run these steps for each ancestor element or viewport that establishes
+To scroll an element into view element,
+with a {{ScrollIntoViewOptions}} dictionary options,
+means to run these steps for each ancestor element or viewport that establishes
a scrolling box scrolling box, in order of innermost to outermost scrolling box:
1. If the {{Document}} associated with element is not same origin with the {{Document}} associated with the element or viewport associated with box, terminate these steps.
@@ -1227,14 +1229,19 @@ a scrolling box scrolling box, in order of innermost to outerm
1. Let scrolling box edge A be the beginning edge in the block flow direction of scrolling box, and let element edge A be element bounding border box's edge on the same physical side as that of scrolling box edge A.
1. Let scrolling box edge B be the ending edge in the block flow direction of scrolling box, and let element edge B be element bounding border box's edge on the same physical side as that of scrolling box edge B.
1. Let scrolling box edge C be the beginning edge in the inline base direction of scrolling box, and let element edge C be element bounding border box's edge on the same physical side as that of scrolling box edge C.
-1. Let scrolling box edge D be the ending edge in the inline base direction of scrolling box, and let element edge D be element bounding border box's edge on the same physical side as that of box edge D.
+1. Let scrolling box edge D be the ending edge in the inline base direction of scrolling box, and let element edge D be element bounding border box's edge on the same physical side as that of scrolling box edge D.
1. Let element width be the distance between element edge C and element edge D.
1. Let scrolling box width be the distance between scrolling box edge C and scrolling box edge D.
1. Let position be the scroll position scrolling box would have by following these steps:
- 1. If the align to top flag is set align element edge A with scrolling box edge A.
- 1. Otherwise, the align to top flag is not set; align element edge B with scrolling box edge B.
- 1.
+ 1. If the {{ScrollIntoViewOptions/block}} dictionary member of options is "start", align element edge A with scrolling box edge A.
+ 1. Otherwise, if the {{ScrollIntoViewOptions/block}} dictionary member of options is "end"; align element edge B with scrolling box edge B.
+ 1. Otherwise, it is "center"; align the center of element bounding border box with the center of scrolling box in scrolling box's block flow direction.
+ 1. If the {{ScrollIntoViewOptions/inline}} dictionary member of options is "start", align element edge C with scrolling box edge C.
+ 1. Otherwise, if the {{ScrollIntoViewOptions/inline}} dictionary member of options is "end"; align element edge D with scrolling box edge D.
+ 1. Otherwise, if the {{ScrollIntoViewOptions/inline}} dictionary member of options is "center", align the center of element bounding border box with the center of scrolling box in scrolling box's inline base direction.
+ 1. Otherwise, it is not set; follow these steps:
+
+1. Let behavior be the {{ScrollOptions/behavior}} dictionary member of options.
1. Perform a scroll of scrolling box to position, associated element as the associated element and behavior as the scroll behavior.
From 4dd6811a29ed5bf4ce0075975ae13cfd946daeb7 Mon Sep 17 00:00:00 2001
From: Simon Pieters
-enum ScrollLogicalPosition { "start", "center", "end" };
+enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
dictionary ScrollIntoViewOptions : ScrollOptions {
- ScrollLogicalPosition block = "start";
- ScrollLogicalPosition inline;
+ ScrollLogicalPosition block = "center";
+ ScrollLogicalPosition inline = "center";
};
partial interface Element {
@@ -1056,7 +1056,8 @@ The scrollIntoView(arg) method must run
1. Let options be null.
1. If arg is an object, let options be arg.
1. Convert options to a {{ScrollIntoViewOptions}} dictionary. [[!WEBIDL]]
-1. If arg is false, let the {{ScrollIntoViewOptions/block}} dictionary member of options have the value "end".
+1. If arg is not specified or is true, let the {{ScrollIntoViewOptions/block}} dictionary member of options have the value "start", and let the {{ScrollIntoViewOptions/inline}} dictionary member of options have the value "nearest".
+1. If arg is false, let the {{ScrollIntoViewOptions/block}} dictionary member of options have the value "end", and let the {{ScrollIntoViewOptions/inline}} dictionary member of options have the value "nearest".
1. If the element does not have any associated layout box terminate these steps.
1. Scroll the element into view
with the options options.
@@ -1236,11 +1237,24 @@ a scrolling box scrolling box, in order of innermost to outerm
1. If the {{ScrollIntoViewOptions/block}} dictionary member of options is "start", align element edge A with scrolling box edge A.
1. Otherwise, if the {{ScrollIntoViewOptions/block}} dictionary member of options is "end"; align element edge B with scrolling box edge B.
- 1. Otherwise, it is "center"; align the center of element bounding border box with the center of scrolling box in scrolling box's block flow direction.
+ 1. Otherwise, if the {{ScrollIntoViewOptions/block}} dictionary member of options is "center"; align the center of element bounding border box with the center of scrolling box in scrolling box's block flow direction.
+ 1. Otherwise, it is "nearest"; follow these steps:
+
+
1. If the {{ScrollIntoViewOptions/inline}} dictionary member of options is "start", align element edge C with scrolling box edge C.
1. Otherwise, if the {{ScrollIntoViewOptions/inline}} dictionary member of options is "end"; align element edge D with scrolling box edge D.
1. Otherwise, if the {{ScrollIntoViewOptions/inline}} dictionary member of options is "center", align the center of element bounding border box with the center of scrolling box in scrolling box's inline base direction.
- 1. Otherwise, it is not set; follow these steps:
+ 1. Otherwise, it is "nearest"; follow these steps: