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
@@ -1129,7 +1128,7 @@ Note: The {{DOMRect}} object returned by {{Element/getBoundingClientRect()}} is
1129
1128
<div class='example'>
1130
1129
The following snippet gets the dimensions of the first <code>div</code> element in a document:
1131
1130
1132
-
<pre class='lang-javascript'>
1131
+
<pre highlight=javascript>
1133
1132
var example = document.getElementsByTagName("div")[0].getBoundingClientRect();
1134
1133
var exampleWidth = example.width;
1135
1134
var exampleHeight = example.height;
@@ -1138,18 +1137,24 @@ Note: The {{DOMRect}} object returned by {{Element/getBoundingClientRect()}} is
1138
1137
1139
1138
The <dfn method for=Element caniuse=scrollintoview>scrollIntoView(<var>arg</var>)</dfn> method must run these steps:
1140
1139
1141
-
<!-- scrollIntoView() means arg=true but scrollIntoView(undefined) means arg=false, to align with impls. -->
1142
-
1143
1140
1. Let <var>options</var> be null.
1144
-
1. If <var>arg</var> is an object, let<var>options</var>be<var>arg</var>.
1145
-
1. <a lt="converted to an IDL value">Convert</a><var>options</var> to a {{ScrollIntoViewOptions}} dictionary. [[!WEBIDL]]
1146
-
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>".
1147
-
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>".
1141
+
1. If <var>arg</var> is a {{ScrollIntoViewOptions}} dictionary, set<var>options</var>to<var>arg</var>. Otherwise:
1142
+
1. <a lt="converted to an IDL value">Convert</a><var>options</var> to a {{ScrollIntoViewOptions}} dictionary. [[!WEBIDL]]
1143
+
1. If <var>arg</var> is true, set the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var>to "<code>start</code>", and set the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var>to "<code>nearest</code>".
1144
+
1. If <var>arg</var> is false, let the {{ScrollIntoViewOptions/block}} dictionary member of <var>options</var>to "<code>end</code>", and set the {{ScrollIntoViewOptions/inline}} dictionary member of <var>options</var>to "<code>nearest</code>".
1148
1145
1. If the element does not have any associated <a>layout box</a> terminate these steps.
1149
1146
1. <a lt='scroll an element into view'>Scroll the element into view</a>
1150
1147
with the options <var>options</var>.
1151
1148
1. Optionally perform some other action that brings the element to the user's attention.
1152
1149
1150
+
<p class=note highlight=javascript>For historical reasons, passing in <code>true</code> or
1151
+
<code>undefined</code> to {{Element/scrollIntoView()}} is equivalent to
1152
+
<code>{ block: "start", inline: "nearest" }</code>, and passing in
1153
+
<code>false</code> is equivalent to
1154
+
<code>{ block: "end", inline: "nearest" }</code>. Since centering is a
1155
+
common case, passing in an empty dictionary <code>{}</code> is equivalent to
0 commit comments