Skip to content

Commit

Permalink
Make 'autofocus' a global attribute
Browse files Browse the repository at this point in the history
- Add 'autofocus' to the global attribute list
- Move 'autofocus' IDL attribute from HTMLButtonElement, HTMLInputElement,
  HTMLSelectElement, HTMLTextAreaElement to HTMLOrSVGElement

This fixes whatwg#4563
  • Loading branch information
tkent-google committed Aug 9, 2019
1 parent 1224105 commit c1842d2
Showing 1 changed file with 16 additions and 37 deletions.
53 changes: 16 additions & 37 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -10353,6 +10353,7 @@ interface <dfn>HTMLUnknownElement</dfn> : <span>HTMLElement</span> { };</code></
[SameObject] readonly attribute <span>DOMStringMap</span> <span data-x="dom-dataset">dataset</span>;
attribute DOMString <span data-x="dom-HTMLOrSVGElement-nonce">nonce</span>; // <a href="#nonce-does-not-update-dom">intentionally no [CEReactions]</a>

[<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-autofocus">autofocus</span>;
[<span>CEReactions</span>] attribute long <span data-x="dom-tabindex">tabIndex</span>;
void <span data-x="dom-focus">focus</span>(optional <span>FocusOptions</span> options = {});
void <span data-x="dom-blur">blur</span>();
Expand Down Expand Up @@ -11510,6 +11511,7 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%
<ul class="brief">
<li><code data-x="attr-accesskey">accesskey</code></li>
<li><code data-x="attr-autocapitalize">autocapitalize</code></li>
<li><code data-x="attr-fe-autofocus">autofocus</code></li>
<li><code data-x="attr-contenteditable">contenteditable</code></li>
<li><code data-x="attr-dir">dir</code></li>
<li><code data-x="attr-draggable">draggable</code></li>
Expand Down Expand Up @@ -43877,7 +43879,6 @@ interface <dfn>HTMLLabelElement</dfn> : <span>HTMLElement</span> {
<dd><code data-x="attr-input-accept">accept</code></dd>
<dd><code data-x="attr-input-alt">alt</code></dd>
<dd><code data-x="attr-fe-autocomplete">autocomplete</code></dd>
<dd><code data-x="attr-fe-autofocus">autofocus</code></dd>
<dd><code data-x="attr-input-checked">checked</code></dd>
<dd><code data-x="attr-fe-dirname">dirname</code></dd>
<dd><code data-x="attr-fe-disabled">disabled</code></dd>
Expand Down Expand Up @@ -43914,7 +43915,6 @@ interface <dfn>HTMLInputElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-input-accept">accept</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-input-alt">alt</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-fe-autocomplete">autocomplete</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-autofocus">autofocus</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-input-defaultChecked">defaultChecked</span>;
attribute boolean <span data-x="dom-input-checked">checked</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-input-dirName">dirName</span>;
Expand Down Expand Up @@ -45423,7 +45423,6 @@ interface <dfn>HTMLInputElement</dfn> : <span>HTMLElement</span> {
The <code data-x="attr-fe-dirname">dirname</code> attribute controls how the element's <span data-x="the directionality">directionality</span> is submitted.
The <code data-x="attr-fe-disabled">disabled</code> attribute is used to make the control non-interactive and to prevent its value from being submitted.
The <code data-x="attr-fae-form">form</code> attribute is used to explicitly associate the <code>input</code> element with its <span>form owner</span>.
The <code data-x="attr-fe-autofocus">autofocus</code> attribute controls focus.
The <code data-x="attr-fe-autocomplete">autocomplete</code> attribute controls how the user agent provides autofill behavior.
</p>

Expand Down Expand Up @@ -45481,9 +45480,9 @@ interface <dfn>HTMLInputElement</dfn> : <span>HTMLElement</span> {
data-x="dom-textarea/input-selectionDirection">selectionDirection</code>, <code
data-x="dom-textarea/input-setRangeText">setRangeText()</code>, and <code
data-x="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods and IDL attributes
expose the element's text selection. The <code data-x="dom-fe-autofocus">autofocus</code>, <code
data-x="dom-fe-disabled">disabled</code>, <code data-x="dom-fae-form">form</code>, and <code
data-x="dom-fe-name">name</code> IDL attributes are part of the element's forms API.</p>
expose the element's text selection. The <code data-x="dom-fe-disabled">disabled</code>,
<code data-x="dom-fae-form">form</code>, and <code data-x="dom-fe-name">name</code> IDL attributes
are part of the element's forms API.</p>

</div>

Expand Down Expand Up @@ -50037,7 +50036,6 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<dd><span>Phrasing content</span>, but there must be no <span>interactive content</span> descendant.</dd>
<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt>
<dd><span>Global attributes</span></dd>
<dd><code data-x="attr-fe-autofocus">autofocus</code></dd>
<dd><code data-x="attr-fe-disabled">disabled</code></dd>
<dd><code data-x="attr-fae-form">form</code></dd>
<dd><code data-x="attr-fs-formaction">formaction</code></dd>
Expand All @@ -50053,7 +50051,6 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<pre><code class="idl" data-x="">[Exposed=Window,
<span>HTMLConstructor</span>]
interface <dfn>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-autofocus">autofocus</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-disabled">disabled</span>;
readonly attribute <span>HTMLFormElement</span>? <span data-x="dom-fae-form">form</span>;
[<span>CEReactions</span>] attribute USVString <span data-x="dom-fs-formAction">formAction</span>;
Expand Down Expand Up @@ -50154,9 +50151,8 @@ interface <dfn>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
<code>button</code> element with its <span>form owner</span>. The <code
data-x="attr-fe-name">name</code> attribute represents the element's name. The <code
data-x="attr-fe-disabled">disabled</code> attribute is used to make the control non-interactive and
to prevent its value from being submitted. The <code data-x="attr-fe-autofocus">autofocus</code>
attribute controls focus. The <code data-x="attr-fs-formaction">formaction</code>, <code
data-x="attr-fs-formenctype">formenctype</code>, <code
to prevent its value from being submitted. The <code data-x="attr-fs-formaction">formaction</code>,
<code data-x="attr-fs-formenctype">formenctype</code>, <code
data-x="attr-fs-formmethod">formmethod</code>, <code
data-x="attr-fs-formnovalidate">formnovalidate</code>, and <code
data-x="attr-fs-formtarget">formtarget</code> attributes are <span>attributes for form
Expand Down Expand Up @@ -50200,9 +50196,8 @@ interface <dfn>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
data-x="dom-cva-setCustomValidity">setCustomValidity()</code> methods, are part of the
<span>constraint validation API</span>. The <code data-x="dom-lfe-labels">labels</code> IDL
attribute provides a list of the element's <code>label</code>s. The <code
data-x="dom-fe-autofocus">autofocus</code>, <code data-x="dom-fe-disabled">disabled</code>, <code
data-x="dom-fae-form">form</code>, and <code data-x="dom-fe-name">name</code> IDL attributes are
part of the element's forms API.</p>
data-x="dom-fe-disabled">disabled</code>, <code data-x="dom-fae-form">form</code>, and
<code data-x="dom-fe-name">name</code> IDL attributes are part of the element's forms API.</p>

</div>

Expand Down Expand Up @@ -50236,7 +50231,6 @@ interface <dfn>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt>
<dd><span>Global attributes</span></dd>
<dd><code data-x="attr-fe-autocomplete">autocomplete</code></dd>
<dd><code data-x="attr-fe-autofocus">autofocus</code></dd>
<dd><code data-x="attr-fe-disabled">disabled</code></dd>
<dd><code data-x="attr-fae-form">form</code></dd>
<dd><code data-x="attr-select-multiple">multiple</code></dd>
Expand All @@ -50249,7 +50243,6 @@ interface <dfn>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
<span>HTMLConstructor</span>]
interface <dfn>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-fe-autocomplete">autocomplete</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-autofocus">autofocus</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-disabled">disabled</span>;
readonly attribute <span>HTMLFormElement</span>? <span data-x="dom-fae-form">form</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-select-multiple">multiple</span>;
Expand Down Expand Up @@ -50470,7 +50463,6 @@ interface <dfn>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
The <code data-x="attr-fae-form">form</code> attribute is used to explicitly associate the <code>select</code> element with its <span>form owner</span>.
The <code data-x="attr-fe-name">name</code> attribute represents the element's name.
The <code data-x="attr-fe-disabled">disabled</code> attribute is used to make the control non-interactive and to prevent its value from being submitted.
The <code data-x="attr-fe-autofocus">autofocus</code> attribute controls focus.
The <code data-x="attr-fe-autocomplete">autocomplete</code> attribute controls how the user agent provides autofill behavior.
</p>

Expand Down Expand Up @@ -50693,9 +50685,8 @@ interface <dfn>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
data-x="dom-cva-setCustomValidity">setCustomValidity()</code> methods, are part of the
<span>constraint validation API</span>. The <code data-x="dom-lfe-labels">labels</code> IDL
attribute provides a list of the element's <code>label</code>s. The <code
data-x="dom-fe-autofocus">autofocus</code>, <code data-x="dom-fe-disabled">disabled</code>, <code
data-x="dom-fae-form">form</code>, and <code data-x="dom-fe-name">name</code> IDL attributes are
part of the element's forms API.</p>
data-x="dom-fe-disabled">disabled</code>, <code data-x="dom-fae-form">form</code>, and
<code data-x="dom-fe-name">name</code> IDL attributes are part of the element's forms API.</p>

</div>

Expand Down Expand Up @@ -51248,7 +51239,6 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
<dt><span data-x="concept-element-attributes">Content attributes</span>:</dt>
<dd><span>Global attributes</span></dd>
<dd><code data-x="attr-fe-autocomplete">autocomplete</code></dd>
<dd><code data-x="attr-fe-autofocus">autofocus</code></dd>
<dd><code data-x="attr-textarea-cols">cols</code></dd>
<dd><code data-x="attr-fe-dirname">dirname</code></dd>
<dd><code data-x="attr-fe-disabled">disabled</code></dd>
Expand All @@ -51267,7 +51257,6 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
<span>HTMLConstructor</span>]
interface <dfn>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-fe-autocomplete">autocomplete</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-autofocus">autofocus</span>;
[<span>CEReactions</span>] attribute unsigned long <span data-x="dom-textarea-cols">cols</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-textarea-dirName">dirName</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-disabled">disabled</span>;
Expand Down Expand Up @@ -51577,7 +51566,6 @@ interface <dfn>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {
non-interactive and to prevent its value from being submitted.
The <code data-x="attr-fae-form">form</code> attribute is used to explicitly associate the
<code>textarea</code> element with its <span>form owner</span>.
The <code data-x="attr-fe-autofocus">autofocus</code> attribute controls focus.
The <code data-x="attr-fe-autocomplete">autocomplete</code> attribute controls how the user agent
provides autofill behavior.
</p>
Expand Down Expand Up @@ -51675,9 +51663,9 @@ interface <dfn>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {
data-x="dom-textarea/input-selectionDirection">selectionDirection</code>, <code
data-x="dom-textarea/input-setRangeText">setRangeText()</code>, and <code
data-x="dom-textarea/input-setSelectionRange">setSelectionRange()</code> methods and IDL attributes
expose the element's text selection. The <code data-x="dom-fe-autofocus">autofocus</code>, <code
data-x="dom-fe-disabled">disabled</code>, <code data-x="dom-fae-form">form</code>, and <code
data-x="dom-fe-name">name</code> IDL attributes are part of the element's forms API.</p>
expose the element's text selection. The <code data-x="dom-fe-disabled">disabled</code>,
<code data-x="dom-fae-form">form</code>, and <code data-x="dom-fe-name">name</code> IDL attributes
are part of the element's forms API.</p>

</div>

Expand Down Expand Up @@ -53392,8 +53380,6 @@ form.method === input; // => true</code></pre>

<h6>Autofocusing a form control: the <code data-x="attr-fe-autofocus">autofocus</code> attribute</h6>

<!-- v2: Apply this to contentEditable elements -->

<p>The <dfn><code data-x="attr-fe-autofocus">autofocus</code></dfn> content attribute allows the
author to indicate that a control is to be focused as soon as the page is loaded or as soon as the
<code>dialog</code> within which it finds itself is shown, allowing the user to just start typing
Expand Down Expand Up @@ -118830,7 +118816,6 @@ interface <dfn>External</dfn> {
<td><span data-x="Phrasing content">phrasing</span></td>
<td><span data-x="Phrasing content">phrasing</span>*</td>
<td><span data-x="global attributes">globals</span>;
<code data-x="attr-fe-autofocus">autofocus</code>;
<code data-x="attr-fe-disabled">disabled</code>;
<code data-x="attr-fae-form">form</code>;
<code data-x="attr-fs-formaction">formaction</code>;
Expand Down Expand Up @@ -119298,7 +119283,6 @@ interface <dfn>External</dfn> {
<code data-x="attr-input-accept">accept</code>;
<code data-x="attr-input-alt">alt</code>;
<code data-x="attr-fe-autocomplete">autocomplete</code>;
<code data-x="attr-fe-autofocus">autofocus</code>;
<code data-x="attr-input-checked">checked</code>;
<code data-x="attr-fe-dirname">dirname</code>;
<code data-x="attr-fe-disabled">disabled</code>;
Expand Down Expand Up @@ -119816,7 +119800,6 @@ interface <dfn>External</dfn> {
<span>script-supporting elements</span></td>
<td><span data-x="global attributes">globals</span>;
<code data-x="attr-fe-autocomplete">autocomplete</code>;
<code data-x="attr-fe-autofocus">autofocus</code>;
<code data-x="attr-fe-disabled">disabled</code>;
<code data-x="attr-fae-form">form</code>;
<code data-x="attr-select-multiple">multiple</code>;
Expand Down Expand Up @@ -120022,7 +120005,6 @@ interface <dfn>External</dfn> {
<td><span data-x="Phrasing content">phrasing</span></td>
<td><span data-x="text content">text</span></td>
<td><span data-x="global attributes">globals</span>;
<code data-x="attr-fe-autofocus">autofocus</code>;
<code data-x="attr-textarea-cols">cols</code>;
<code data-x="attr-fe-dirname">dirname</code>;
<code data-x="attr-fe-disabled">disabled</code>;
Expand Down Expand Up @@ -120751,11 +120733,8 @@ interface <dfn>External</dfn> {
<td> <span data-x="autofill field">Autofill field</span> name and related tokens*
<tr>
<th> <code data-x="">autofocus</code>
<td> <code data-x="attr-fe-autofocus">button</code>;
<code data-x="attr-fe-autofocus">input</code>;
<code data-x="attr-fe-autofocus">select</code>;
<code data-x="attr-fe-autofocus">textarea</code>
<td> Automatically focus the form control when the page is loaded
<td> <span data-x="attr-fe-autofocus">HTML elements</span>
<td> Automatically focus the element when the page is loaded
<td> <span>Boolean attribute</span>
<tr>
<th> <code data-x="">autoplay</code>
Expand Down

0 comments on commit c1842d2

Please sign in to comment.