@@ -9983,7 +9983,7 @@ interface <dfn>HTMLElement</dfn> : <span>Element</span> {
9983
9983
[<span>CEReactions</span>] attribute boolean <span data-x="dom-hidden">hidden</span>;
9984
9984
void <span data-x="dom-click">click</span>();
9985
9985
[<span>CEReactions</span>] attribute long <span data-x="dom-tabindex">tabIndex</span>;
9986
- void <span data-x="dom-focus">focus</span>();
9986
+ void <span data-x="dom-focus">focus</span>(optional <span>FocusOptions</span> options );
9987
9987
void <span data-x="dom-blur">blur</span>();
9988
9988
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-accessKey">accessKey</span>;
9989
9989
readonly attribute DOMString <span data-x="dom-accessKeyLabel">accessKeyLabel</span>;
@@ -9992,6 +9992,7 @@ interface <dfn>HTMLElement</dfn> : <span>Element</span> {
9992
9992
9993
9993
[<span>CEReactions</span>] attribute [TreatNullAs=EmptyString] DOMString <span data-x="dom-innerText">innerText</span>;
9994
9994
};
9995
+
9995
9996
<span>HTMLElement</span> implements <span>GlobalEventHandlers</span>;
9996
9997
<span>HTMLElement</span> implements <span>DocumentAndElementEventHandlers</span>;
9997
9998
<span>HTMLElement</span> implements <span>ElementContentEditable</span>;
@@ -73566,6 +73567,10 @@ END:VCARD</pre>
73566
73567
73567
73568
<h4>Focus management APIs</h4>
73568
73569
73570
+ <pre class="idl">dictionary <dfn>FocusOptions</dfn> {
73571
+ boolean <span data-x="dom-focusoptions-preventscroll">preventScroll</span> = false;
73572
+ };</pre>
73573
+
73569
73574
<dl class="domintro">
73570
73575
73571
73576
<dt><var>document</var> . <code subdfn data-x="dom-document-activeElement">activeElement</code></dt>
@@ -73614,13 +73619,19 @@ END:VCARD</pre>
73614
73619
</dd>
73615
73620
-->
73616
73621
73617
- <dt><var>element</var> . <code subdfn data-x="dom-focus">focus</code>()</dt>
73622
+ <dt><var>element</var> . <code subdfn data-x="dom-focus">focus</code>([ { <code
73623
+ data-x="dom-focusoptions-preventscroll">preventScroll</code>: true } ])</dt>
73618
73624
73619
73625
<dd>
73620
73626
73621
73627
<p>Moves the focus to the element.</p>
73622
73628
73623
- <p>If the element is a <span>browsing context container</span>, moves the focus to the <span>nested browsing context</span> instead.</p>
73629
+ <p>If the element is a <span>browsing context container</span>, moves the focus to the
73630
+ <span>nested browsing context</span> instead.</p>
73631
+
73632
+ <p>By default, this method also scrolls the element into view. Providing the <code
73633
+ data-x="dom-focusoptions-preventscroll">preventScroll</code> option and setting it to true
73634
+ prevents this behavior.</p>
73624
73635
73625
73636
</dd>
73626
73637
@@ -73718,8 +73729,8 @@ END:VCARD</pre>
73718
73729
system widget (e.g. tab or window) that contained the <span>browsing context</span>, but hostile
73719
73730
sites widely abuse this behavior to the user's detriment.</p>
73720
73731
73721
- <p>The <dfn data-dfn-for="HTMLElement" ><code data-x="dom-focus">focus()</code></dfn> method on
73722
- elements, when invoked, must run the following algorithm :</p>
73732
+ <p>The <dfn><code data-x="dom-focus">focus(<var>options</var> )</code></dfn> method on elements, when
73733
+ invoked, must run the following steps :</p>
73723
73734
73724
73735
<ol>
73725
73736
@@ -73729,6 +73740,13 @@ END:VCARD</pre>
73729
73740
73730
73741
<li><p>Run the <span>focusing steps</span> for the element.</p></li>
73731
73742
73743
+ <li><p>If the value of the <dfn><code
73744
+ data-x="dom-focusoptions-preventscroll">preventScroll</code></dfn> dictionary member of
73745
+ <var>options</var> is false, then <span data-x="scroll an element into view">scroll the element
73746
+ into view</span> with scroll behavior "<code data-x="">auto</code>", block flow direction
73747
+ position set to a UA-defined value, and inline base direction position set to a UA-defined
73748
+ value.</p></li>
73749
+
73732
73750
<li><p>Unmark the element as <i data-x="locked for focus">locked for focus</i>.</p></li>
73733
73751
73734
73752
</ol>
@@ -120494,6 +120512,7 @@ INSERT INTERFACES HERE
120494
120512
Jessica Jong,
120495
120513
jfkthame, <!-- GitHub -->
120496
120514
Jian Li,
120515
+ Jihye Hong,
120497
120516
Jim Jewett,
120498
120517
Jim Ley,
120499
120518
Jim Meehan,
0 commit comments