Skip to content

Commit 09a6eab

Browse files
committed
Declare AutoFill enum for autocomplete values
Add missing value according to spec (`webauthn`).
1 parent f3e42d8 commit 09a6eab

File tree

4 files changed

+90
-8
lines changed

4 files changed

+90
-8
lines changed

baselines/dom.generated.d.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -6676,7 +6676,7 @@ interface HTMLFormElement extends HTMLElement {
66766676
/** Sets or retrieves the URL to which the form content is sent for processing. */
66776677
action: string;
66786678
/** Specifies whether autocomplete is applied to an editable text field. */
6679-
autocomplete: "off" | "on" | "name" | "honorific-prefix" | "given-name" | "family-name" | "honorific-suffix" | "nickname" | "email" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "url" | "photo" | (string & {});
6679+
autocomplete: "off" | "on";
66806680
/** Retrieves a collection, in source order, of all controls in a given form. */
66816681
readonly elements: HTMLFormControlsCollection;
66826682
/** Sets or retrieves the MIME encoding for the form. */
@@ -7105,7 +7105,7 @@ interface HTMLInputElement extends HTMLElement {
71057105
/** Sets or retrieves a text alternative to the graphic. */
71067106
alt: string;
71077107
/** Specifies whether autocomplete is applied to an editable text field. */
7108-
autocomplete: "off" | "on" | "name" | "honorific-prefix" | "given-name" | "family-name" | "honorific-suffix" | "nickname" | "email" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "url" | "photo" | (string & {});
7108+
autocomplete: AutoFill | (string & {});
71097109
capture: string;
71107110
/** Sets or retrieves the state of the check box or radio button. */
71117111
checked: boolean;
@@ -7948,7 +7948,7 @@ declare var HTMLScriptElement: {
79487948

79497949
/** A <select> HTML Element. These elements also share all of the properties and methods of other HTML elements via the HTMLElement interface. */
79507950
interface HTMLSelectElement extends HTMLElement {
7951-
autocomplete: "off" | "on" | "name" | "honorific-prefix" | "given-name" | "family-name" | "honorific-suffix" | "nickname" | "email" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "url" | "photo" | (string & {});
7951+
autocomplete: AutoFill | (string & {});
79527952
disabled: boolean;
79537953
/** Retrieves a reference to the form that the object is embedded in. */
79547954
readonly form: HTMLFormElement | null;
@@ -8402,7 +8402,7 @@ declare var HTMLTemplateElement: {
84028402

84038403
/** Provides special properties and methods for manipulating the layout and presentation of <textarea> elements. */
84048404
interface HTMLTextAreaElement extends HTMLElement {
8405-
autocomplete: "off" | "on" | "name" | "honorific-prefix" | "given-name" | "family-name" | "honorific-suffix" | "nickname" | "email" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "url" | "photo" | (string & {});
8405+
autocomplete: AutoFill | (string & {});
84068406
/** Sets or retrieves the width of the object. */
84078407
cols: number;
84088408
/** Sets or retrieves the initial contents of the object. */
@@ -18550,6 +18550,7 @@ type AudioContextLatencyCategory = "balanced" | "interactive" | "playback";
1855018550
type AudioContextState = "closed" | "running" | "suspended";
1855118551
type AuthenticatorAttachment = "cross-platform" | "platform";
1855218552
type AuthenticatorTransport = "ble" | "hybrid" | "internal" | "nfc" | "usb";
18553+
type AutoFill = "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday" | "bday-day" | "bday-month" | "bday-year" | "cc-additional-name" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "email" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "impp" | "language" | "name" | "new-password" | "nickname" | "off" | "on" | "one-time-code" | "organization" | "organization-title" | "photo" | "postal-code" | "sex" | "street-address" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "transaction-amount" | "transaction-currency" | "url" | "username" | "webauthn";
1855318554
type AutoKeyword = "auto";
1855418555
type AutomationRate = "a-rate" | "k-rate";
1855518556
type BinaryType = "arraybuffer" | "blob";

inputfiles/addedTypes.jsonc

+77
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,83 @@
353353
// https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API#browser_compatibility
354354
"xr-spatial-tracking"
355355
]
356+
},
357+
"AutoFill": {
358+
"name": "AutoFill",
359+
// See the full list of possible autofill values for the `autocomplete`attribut:
360+
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#determine-a-field's-category
361+
// Note that other values are also possible, like section-*, so it should still allow a string.
362+
// Full spec at https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill.
363+
"value": [
364+
// Off
365+
"off",
366+
// Automatic
367+
"on",
368+
369+
// Normal
370+
"name",
371+
"honorific-prefix",
372+
"given-name",
373+
"additional-name",
374+
"family-name",
375+
"honorific-suffix",
376+
"nickname",
377+
"organization-title",
378+
379+
"username",
380+
"new-password",
381+
"current-password",
382+
"one-time-code",
383+
384+
"organization",
385+
"street-address",
386+
"address-line1",
387+
"address-line2",
388+
"address-line3",
389+
"address-level4",
390+
"address-level3",
391+
"address-level2",
392+
"address-level1",
393+
"country",
394+
"country-name",
395+
"postal-code",
396+
397+
"cc-name",
398+
"cc-given-name",
399+
"cc-additional-name",
400+
"cc-family-name",
401+
"cc-number",
402+
"cc-exp",
403+
"cc-exp-month",
404+
"cc-exp-year",
405+
"cc-csc",
406+
"cc-type",
407+
"transaction-currency",
408+
"transaction-amount",
409+
410+
"language",
411+
"bday",
412+
"bday-day",
413+
"bday-month",
414+
"bday-year",
415+
"sex",
416+
"url",
417+
"photo",
418+
419+
// Contact
420+
"tel",
421+
"tel-country-code",
422+
"tel-national",
423+
"tel-area-code",
424+
"tel-local",
425+
"tel-extension",
426+
427+
"email",
428+
"impp",
429+
430+
// Credential
431+
"webauthn"
432+
]
356433
}
357434
}
358435
},

inputfiles/knownTypes.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"AesGcmParams",
77
"AesKeyAlgorithm",
88
"AesKeyGenParams",
9+
"AutoFill",
910
"BigInteger",
1011
"ClientQueryOptions",
1112
"ClientTypes",

inputfiles/overridingTypes.jsonc

+7-4
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,8 @@
12051205
"property": {
12061206
"autocomplete": {
12071207
"name": "autocomplete",
1208-
"overrideType": "\"off\" | \"on\" | \"name\" | \"honorific-prefix\" | \"given-name\" | \"family-name\" | \"honorific-suffix\" | \"nickname\" | \"email\" | \"username\" | \"new-password\" | \"current-password\" | \"one-time-code\" | \"organization-title\" | \"organization\" | \"street-address\" | \"address-line1\" | \"address-line2\" | \"address-line3\" | \"address-level4\" | \"address-level3\" | \"address-level2\" | \"address-level1\" | \"country\" | \"country-name\" | \"postal-code\" | \"cc-name\" | \"cc-given-name\" | \"cc-additional-name\" | \"cc-family-name\" | \"cc-number\" | \"cc-exp\" | \"cc-exp-month\" | \"cc-exp-year\" | \"cc-csc\" | \"cc-type\" | \"transaction-currency\" | \"transaction-amount\" | \"language\" | \"bday\" | \"bday-day\" | \"bday-month\" | \"bday-year\" | \"sex\" | \"tel\" | \"tel-country-code\" | \"tel-national\" | \"tel-area-code\" | \"tel-local\" | \"tel-extension\" | \"impp\" | \"url\" | \"photo\" | (string & {})"
1208+
// allow custom values like section-* without losing type completion
1209+
"overrideType": "AutoFill | (string & {})"
12091210
},
12101211
"selectedOptions": {
12111212
"name": "selectedOptions",
@@ -1612,7 +1613,8 @@
16121613
"property": {
16131614
"autocomplete": {
16141615
"name": "autocomplete",
1615-
"overrideType": "\"off\" | \"on\" | \"name\" | \"honorific-prefix\" | \"given-name\" | \"family-name\" | \"honorific-suffix\" | \"nickname\" | \"email\" | \"username\" | \"new-password\" | \"current-password\" | \"one-time-code\" | \"organization-title\" | \"organization\" | \"street-address\" | \"address-line1\" | \"address-line2\" | \"address-line3\" | \"address-level4\" | \"address-level3\" | \"address-level2\" | \"address-level1\" | \"country\" | \"country-name\" | \"postal-code\" | \"cc-name\" | \"cc-given-name\" | \"cc-additional-name\" | \"cc-family-name\" | \"cc-number\" | \"cc-exp\" | \"cc-exp-month\" | \"cc-exp-year\" | \"cc-csc\" | \"cc-type\" | \"transaction-currency\" | \"transaction-amount\" | \"language\" | \"bday\" | \"bday-day\" | \"bday-month\" | \"bday-year\" | \"sex\" | \"tel\" | \"tel-country-code\" | \"tel-national\" | \"tel-area-code\" | \"tel-local\" | \"tel-extension\" | \"impp\" | \"url\" | \"photo\" | (string & {})"
1616+
// allow custom values like section-* without losing type completion
1617+
"overrideType": "AutoFill | (string & {})"
16161618
},
16171619
"selectionDirection": {
16181620
"name": "selectionDirection",
@@ -1735,7 +1737,8 @@
17351737
"property": {
17361738
"autocomplete": {
17371739
"name": "autocomplete",
1738-
"overrideType": "\"off\" | \"on\" | \"name\" | \"honorific-prefix\" | \"given-name\" | \"family-name\" | \"honorific-suffix\" | \"nickname\" | \"email\" | \"username\" | \"new-password\" | \"current-password\" | \"one-time-code\" | \"organization-title\" | \"organization\" | \"street-address\" | \"address-line1\" | \"address-line2\" | \"address-line3\" | \"address-level4\" | \"address-level3\" | \"address-level2\" | \"address-level1\" | \"country\" | \"country-name\" | \"postal-code\" | \"cc-name\" | \"cc-given-name\" | \"cc-additional-name\" | \"cc-family-name\" | \"cc-number\" | \"cc-exp\" | \"cc-exp-month\" | \"cc-exp-year\" | \"cc-csc\" | \"cc-type\" | \"transaction-currency\" | \"transaction-amount\" | \"language\" | \"bday\" | \"bday-day\" | \"bday-month\" | \"bday-year\" | \"sex\" | \"tel\" | \"tel-country-code\" | \"tel-national\" | \"tel-area-code\" | \"tel-local\" | \"tel-extension\" | \"impp\" | \"url\" | \"photo\" | (string & {})"
1740+
// allow custom values like section-* without losing type completion
1741+
"overrideType": "AutoFill | (string & {})"
17391742
},
17401743
"labels": {
17411744
"name": "labels",
@@ -2371,7 +2374,7 @@
23712374
"property": {
23722375
"autocomplete": {
23732376
"name": "autocomplete",
2374-
"overrideType": "\"off\" | \"on\" | \"name\" | \"honorific-prefix\" | \"given-name\" | \"family-name\" | \"honorific-suffix\" | \"nickname\" | \"email\" | \"username\" | \"new-password\" | \"current-password\" | \"one-time-code\" | \"organization-title\" | \"organization\" | \"street-address\" | \"address-line1\" | \"address-line2\" | \"address-line3\" | \"address-level4\" | \"address-level3\" | \"address-level2\" | \"address-level1\" | \"country\" | \"country-name\" | \"postal-code\" | \"cc-name\" | \"cc-given-name\" | \"cc-additional-name\" | \"cc-family-name\" | \"cc-number\" | \"cc-exp\" | \"cc-exp-month\" | \"cc-exp-year\" | \"cc-csc\" | \"cc-type\" | \"transaction-currency\" | \"transaction-amount\" | \"language\" | \"bday\" | \"bday-day\" | \"bday-month\" | \"bday-year\" | \"sex\" | \"tel\" | \"tel-country-code\" | \"tel-national\" | \"tel-area-code\" | \"tel-local\" | \"tel-extension\" | \"impp\" | \"url\" | \"photo\" | (string & {})"
2377+
"overrideType": "\"off\" | \"on\""
23752378
}
23762379
}
23772380
}

0 commit comments

Comments
 (0)