Skip to content

Commit 881a0dd

Browse files
committed
Make scroll into a view a no-op if the element is in view
This simplifies some of the language in the rest of the spec by reducing boilerplate.
1 parent 6e7d06b commit 881a0dd

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

webdriver-spec.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4108,11 +4108,16 @@ <h2>Elements</h2>
41084108
<li><p>Otherwise return false.
41094109
</ol>
41104110

4111-
<p>An <a>element</a> is
4112-
<dfn data-lt="scroll into view|scrolls into view">scrolled into view</dfn>
4113-
by calling <a>scrollIntoView</a>
4114-
with the <a><code>ScrollIntoViewOptions</code></a>
4115-
<code>{behavior: "instant", block: "end", inline: "nearest"}</code>.
4111+
<p>An <var><a>element</a></var> is
4112+
<dfn data-lt="scroll into view|scrolls into view">scrolled into view</dfn>
4113+
by following these steps:
4114+
<ol>
4115+
<li><p>If <var>element</var> is <a>in view</a>, do nothing.
4116+
<li><p>Otherwise, <a>[[\CALL]]</a> <a>scrollIntoView</a>
4117+
on <var>element</var> with
4118+
arguments <a><code>ScrollIntoViewOptions</code></a>
4119+
<code>{behavior: "instant", block: "end", inline: "nearest"}</code>.
4120+
</ol>
41164121

41174122
<p>An <a>element</a> is considered <dfn>editable</dfn>
41184123
if one or more of the following conditions are met:
@@ -5215,8 +5220,7 @@ <h3>Element Click</h3>
52155220
an <a><code>input</code> element</a> in the <a>file upload state</a>
52165221
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
52175222

5218-
<li><p><a>Scroll into view</a> the <var>element</var>’s <a>container</a>
5219-
if it is not <a>in view</a>.
5223+
<li><p><a>Scroll into view</a> the <var>element</var>’s <a>container</a>.
52205224

52215225
<li><p>Wait in an implementation-specific way
52225226
up to the <a>session implicit wait timeout</a>

0 commit comments

Comments
 (0)