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
The <dfn method for=Element>scrollIntoView(<var>arg</var>)</dfn> method must run these steps:
1051
1053
1052
-
<!-- scrollIntoView() means top=true but scrollIntoView(undefined) means top=false, to align with impls. -->
1054
+
<!-- scrollIntoView() means arg=true but scrollIntoView(undefined) means arg=false, to align with impls. -->
1053
1055
1054
1056
1. Let <var>options</var> be null.
1055
1057
1. If <var>arg</var> is an object, let <var>options</var> be <var>arg</var>.
1056
1058
1. <a lt="converted to an IDL value">Convert</a><var>options</var> to a {{ScrollIntoViewOptions}} dictionary. [[!WEBIDL]]
1057
-
1. If <var>arg</var> is false, let the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> have the value "<code>end</code>".
1059
+
1. If <var>arg</var> is not specified or is true, let the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> have the value "<code>start</code>", and let the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var> have the value "<code>nearest</code>".
1060
+
1. If <var>arg</var> is false, let the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> have the value "<code>end</code>", and let the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var> have the value "<code>nearest</code>".
1058
1061
1. If the element does not have any associated <a>layout box</a> terminate these steps.
1059
1062
1. <a lt='scroll an element into view'>Scroll the element into view</a>
1060
-
with the <i>align to top</i> flag set if <var>options</var>{{ScrollIntoViewOptions/block}} dictionary member has the value "<code>start</code>",
1061
-
and the scroll behavior being the value of the {{ScrollOptions/behavior}} dictionary member of <var>options</var>.
1063
+
with the options <var>options</var>.
1062
1064
1. Optionally perform some other action that brings the element to the user's attention.
1063
1065
1064
1066
The <dfn method for=Element lt="scroll(options)|scroll(x, y)">scroll()</dfn> method must run these steps:
@@ -1218,23 +1220,42 @@ document are not reflected in the objects.
1218
1220
{{Element}} Scrolling Members {#element-scrolling-members}
To <dfn>scroll an element into view</dfn><var>element</var>, optionally with an <i>align to top flag</i> set, and optionally with a scroll behavior
1222
-
<var>behavior</var> (which is <code>"auto"</code> if omitted), means to run these steps for each ancestor element or <a>viewport</a> that establishes
1223
+
To <dfn>scroll an element into view</dfn><var>element</var>,
1224
+
with a {{ScrollIntoViewOptions}} dictionary <var>options</var>,
1225
+
means to run these steps for each ancestor element or <a>viewport</a> that establishes
1223
1226
a <a>scrolling box</a><var>scrolling box</var>, in order of innermost to outermost <a>scrolling box</a>:
1224
1227
1225
1228
1. If the {{Document}} associated with <var>element</var> is not <a>same origin</a> with the {{Document}} associated with the element or <a>viewport</a> associated with <var>box</var>, terminate these steps.
1226
1229
1. Let <var>element bounding border box</var> be the box that the return value of invoking {{Element/getBoundingClientRect()}} on <var>element</var> represents.
1227
1230
1. Let <var>scrolling box edge A</var> be the <a>beginning edge</a> in the <a>block flow direction</a> of <var>scrolling box</var>, and let <var>element edge A</var> be <var>element bounding border box</var>'s edge on the same physical side as that of <var>scrolling box edge A</var>.
1228
1231
1. Let <var>scrolling box edge B</var> be the <a>ending edge</a> in the <a>block flow direction</a> of <var>scrolling box</var>, and let <var>element edge B</var> be <var>element bounding border box</var>'s edge on the same physical side as that of <var>scrolling box edge B</var>.
1229
1232
1. Let <var>scrolling box edge C</var> be the <a>beginning edge</a> in the <a>inline base direction</a> of <var>scrolling box</var>, and let <var>element edge C</var> be <var>element bounding border box</var>'s edge on the same physical side as that of <var>scrolling box edge C</var>.
1230
-
1. Let <var>scrolling box edge D</var> be the <a>ending edge</a> in the <a>inline base direction</a> of <var>scrolling box</var>, and let <var>element edge D</var> be <var>element bounding border box</var>'s edge on the same physical side as that of <var>box edge D</var>.
1233
+
1. Let <var>scrolling box edge D</var> be the <a>ending edge</a> in the <a>inline base direction</a> of <var>scrolling box</var>, and let <var>element edge D</var> be <var>element bounding border box</var>'s edge on the same physical side as that of <var>scrolling box edge D</var>.
1231
1234
1. Let <var>element width</var> be the distance between <var>element edge C</var> and <var>element edge D</var>.
1232
1235
1. Let <var>scrolling box width</var> be the distance between <var>scrolling box edge C</var> and <var>scrolling box edge D</var>.
1233
1236
1. Let <var>position</var> be the scroll position <var>scrolling box</var> would have by following these steps:
1234
1237
1235
-
1. If the <i>align to top flag</i> is set align <var>element edge A</var> with <var>scrolling box edge A</var>.
1236
-
1. Otherwise, the <i>align to top flag</i> is not set; align <var>element edge B</var> with <var>scrolling box edge B</var>.
1237
-
1. <dl class=switch>
1238
+
1. If the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> is "start", align <var>element edge A</var> with <var>scrolling box edge A</var>.
1239
+
1. Otherwise, if the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> is "end"; align <var>element edge B</var> with <var>scrolling box edge B</var>.
1240
+
1. Otherwise, if the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var> is "center"; align the center of <var>element bounding border box</var> with the center of <var>scrolling box</var> in <var>scrolling box</var>'s <a>block flow direction</a>.
1241
+
1. Otherwise, it is "nearest"; follow these steps:
1242
+
<dl class=switch>
1243
+
<dt>If <var>element edge A</var> and <var>element edge B</var> are both outside <var>scrolling box edge A</var> and <var>scrolling box edge B</var>
1244
+
<dd>Do nothing.
1245
+
1246
+
<dt>If <var>element edge A</var> is outside <var>scrolling box edge A</var> and <var>element width</var> is less than <var>scrolling box width</var>
1247
+
<dt>If <var>element edge B</var> is outside <var>scrolling box edge B</var> and <var>element width</var> is greater than <var>scrolling box width</var>
1248
+
<dd>Align <var>element edge A</var> with <var>scrolling box edge A</var>.
1249
+
1250
+
<dt>If <var>element edge A</var> is outside <var>scrolling box edge A</var> and <var>element width</var> is greater than <var>scrolling box width</var>
1251
+
<dt>If <var>element edge B</var> is outside <var>scrolling box edge B</var> and <var>element width</var> is less than <var>scrolling box width</var>
1252
+
<dd>Align <var>element edge B</var> with <var>scrolling box edge B</var>.
1253
+
</dl>
1254
+
1. If the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var> is "start", align <var>element edge C</var> with <var>scrolling box edge C</var>.
1255
+
1. Otherwise, if the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var> is "end"; align <var>element edge D</var> with <var>scrolling box edge D</var>.
1256
+
1. Otherwise, if the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var> is "center", align the center of <var>element bounding border box</var> with the center of <var>scrolling box</var> in <var>scrolling box</var>'s <a>inline base direction</a>.
1257
+
1. Otherwise, it is "nearest"; follow these steps:
1258
+
<dl class=switch>
1238
1259
<dt>If <var>element edge C</var> and <var>element edge D</var> are both outside <var>scrolling box edge C</var> and <var>scrolling box edge D</var>
1239
1260
<dd>Do nothing.
1240
1261
@@ -1258,6 +1279,7 @@ a <a>scrolling box</a> <var>scrolling box</var>, in order of innermost to outerm
1258
1279
Let <var>document</var> be the <a>viewport’s</a> associated {{Document}}.
1259
1280
Let <var>associated element</var> be <var>document</var>'s root element, if there is one, or null otherwise.
1260
1281
</dl>
1282
+
1. Let <var>behavior</var> be the {{ScrollOptions/behavior}} dictionary member of <var>options</var>.
1261
1283
1. <a>Perform a scroll</a> of <var>scrolling box</var> to <var>position</var>, <var>associated element</var> as the associated element and <var>behavior</var> as the scroll behavior.
0 commit comments