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
@@ -1090,6 +1096,13 @@ partial interface Element {
1090
1096
};
1091
1097
</pre>
1092
1098
1099
+
The {{ScrollIntoViewOptions}} dictionary is used by {{Element/scrollIntoView()}} and similar APIs
1100
+
that primarily scroll something into view.
1101
+
1102
+
The {{FocusScrollOptions}} dictionary is similar to {{ScrollIntoViewOptions}}, but has different
1103
+
defaults, and is used by {{HTMLElement}}'s {{HTMLElement/focus()}} and similar APIs that primarily
1104
+
move focus to something, or equivalent, and secondarily scroll it into view.
1105
+
1093
1106
The <dfn method for=Element>getClientRects()</dfn> method, when invoked, must return the result of the following algorithm:
1094
1107
1095
1108
1. If the element on which it was invoked does not have an associated <a>layout box</a> return an empty {{DOMRectList}} object and stop this algorithm.
@@ -1130,14 +1143,16 @@ The <dfn method for=Element caniuse=scrollintoview>scrollIntoView(<var>arg</var>
1130
1143
1. Let <var>behavior</var> be "<code>auto</code>".
1131
1144
1. Let <var>block</var> be "<code>start</code>".
1132
1145
1. Let <var>inline</var> be "<code>nearest</code>".
1146
+
1. Let <var>notIfViewed</var> be false.
1133
1147
1. If <var>arg</var> is a {{ScrollIntoViewOptions}} dictionary, then:
1134
1148
1. Set <var>behavior</var> to the {{ScrollOptions/behavior}} dictionary member of <var>options</var>.
1135
1149
1. Set <var>block</var> to the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var>.
1136
1150
1. Set <var>inline</var> to the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var>.
1151
+
1. Set <var>notIfViewed</var> to the {{ScrollIntoViewOptions/notIfViewed}} dictionary member of <var>options</var>.
1137
1152
1. Otherwise, if <var>arg</var> is false, then set <var>block</var> to "<code>end</code>".
1138
1153
1. If the element does not have any associated <a>layout box</a>, then return.
1139
1154
1. <a lt='scroll an element into view'>Scroll the element into view</a>
1140
-
with <var>behavior</var>, <var>block</var>, and <var>inline</var>.
1155
+
with <var>behavior</var>, <var>block</var>, <var>inline</var>, and <var>notIfViewed</var>.
1141
1156
1. Optionally perform some other action that brings the element to the user's attention.
1142
1157
1143
1158
The <dfn method for=Element lt="scroll(options)|scroll(x, y)">scroll()</dfn> method must run these steps:
@@ -1290,8 +1305,9 @@ The <dfn attribute for=Element>clientHeight</dfn> attribute must run these steps
1290
1305
1291
1306
To <dfn>scroll an element into view</dfn><var>element</var>,
1292
1307
with a scroll behavior <var>behavior</var>,
1293
-
a block flow direction position <var>block</var>,
1294
-
and an inline base direction position <var>inline</var>,
1308
+
a boolean indicating to not scroll if the element is already in view <var>notIfViewed</var>,
1309
+
optionally a block flow direction position <var>block</var> (undefined if not given),
1310
+
and optionally an inline base direction position <var>inline</var> (undefined if not given),
1295
1311
means to run these steps for each ancestor element or <a>viewport</a> that establishes
1296
1312
a <a>scrolling box</a><var>scrolling box</var>, in order of innermost to outermost <a>scrolling box</a>:
1297
1313
@@ -1305,6 +1321,15 @@ a <a>scrolling box</a> <var>scrolling box</var>, in order of innermost to outerm
1305
1321
1. Let <var>scrolling box height</var> be the distance between <var>scrolling box edge A</var> and <var>scrolling box edge B</var>.
1306
1322
1. Let <var>element width</var> be the distance between <var>element edge C</var> and <var>element edge D</var>.
1307
1323
1. Let <var>scrolling box width</var> be the distance between <var>scrolling box edge C</var> and <var>scrolling box edge D</var>.
1324
+
1. If <var>notIfViewed</var> is true, and <var>element</var> is entirely in view already, then return.
1325
+
1326
+
ISSUE: Define "entirely in view".
1327
+
1328
+
1. If <var>block</var> is undefined, set <var>block</var> to a UA-defined value.
1329
+
1. If <var>inline</var> is undefined, set <var>inline</var> to a UA-defined value.
1330
+
1331
+
ISSUE: Define defaults for <var>block</var> and <var>inline</var> for {{FocusScrollOptions}}.
1332
+
1308
1333
1. Let <var>position</var> be the scroll position <var>scrolling box</var> would have by following these steps:
1309
1334
1310
1335
1. If <var>block</var> is "<code>start</code>", then align <var>element edge A</var> with <var>scrolling box edge A</var>.
0 commit comments