Skip to content

Commit c1f04d8

Browse files
committed
Migrate HTML Input
1 parent 3b5b514 commit c1f04d8

File tree

9 files changed

+33
-60
lines changed

9 files changed

+33
-60
lines changed

baselines/dom.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17341,7 +17341,7 @@ interface HTMLInputElement extends HTMLElement, PopoverTargetAttributes {
1734117341
*
1734217342
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/selectionDirection)
1734317343
*/
17344-
selectionDirection: "forward" | "backward" | "none" | null;
17344+
selectionDirection: Directions | null;
1734517345
/**
1734617346
* The **`selectionEnd`** property of the HTMLInputElement interface is a number that represents the end index of the selected text. That is, it represents the index of the character immediately following the selection. Likewise, when there is no selection, this returns the offset of the character immediately following the current text input cursor position.
1734717347
*
@@ -17470,7 +17470,7 @@ interface HTMLInputElement extends HTMLElement, PopoverTargetAttributes {
1747017470
*
1747117471
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setSelectionRange)
1747217472
*/
17473-
setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void;
17473+
setSelectionRange(start: number | null, end: number | null, direction?: Directions): void;
1747417474
/**
1747517475
* The **`HTMLInputElement.showPicker()`** method displays the browser picker for an input element.
1747617476
*
@@ -42434,6 +42434,7 @@ type ConstrainDouble = number | ConstrainDoubleRange;
4243442434
type ConstrainULong = number | ConstrainULongRange;
4243542435
type CookieList = CookieListItem[];
4243642436
type DOMHighResTimeStamp = number;
42437+
type Directions = "forward" | "backward" | "none";
4243742438
type EpochTimeStamp = number;
4243842439
type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
4243942440
type FileSystemWriteChunkType = BufferSource | Blob | string | WriteParams;

baselines/ts5.5/dom.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17323,7 +17323,7 @@ interface HTMLInputElement extends HTMLElement, PopoverTargetAttributes {
1732317323
*
1732417324
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/selectionDirection)
1732517325
*/
17326-
selectionDirection: "forward" | "backward" | "none" | null;
17326+
selectionDirection: Directions | null;
1732717327
/**
1732817328
* The **`selectionEnd`** property of the HTMLInputElement interface is a number that represents the end index of the selected text. That is, it represents the index of the character immediately following the selection. Likewise, when there is no selection, this returns the offset of the character immediately following the current text input cursor position.
1732917329
*
@@ -17452,7 +17452,7 @@ interface HTMLInputElement extends HTMLElement, PopoverTargetAttributes {
1745217452
*
1745317453
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setSelectionRange)
1745417454
*/
17455-
setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void;
17455+
setSelectionRange(start: number | null, end: number | null, direction?: Directions): void;
1745617456
/**
1745717457
* The **`HTMLInputElement.showPicker()`** method displays the browser picker for an input element.
1745817458
*
@@ -42408,6 +42408,7 @@ type ConstrainDouble = number | ConstrainDoubleRange;
4240842408
type ConstrainULong = number | ConstrainULongRange;
4240942409
type CookieList = CookieListItem[];
4241042410
type DOMHighResTimeStamp = number;
42411+
type Directions = "forward" | "backward" | "none";
4241142412
type EpochTimeStamp = number;
4241242413
type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
4241342414
type FileSystemWriteChunkType = BufferSource | Blob | string | WriteParams;

baselines/ts5.6/dom.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17338,7 +17338,7 @@ interface HTMLInputElement extends HTMLElement, PopoverTargetAttributes {
1733817338
*
1733917339
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/selectionDirection)
1734017340
*/
17341-
selectionDirection: "forward" | "backward" | "none" | null;
17341+
selectionDirection: Directions | null;
1734217342
/**
1734317343
* The **`selectionEnd`** property of the HTMLInputElement interface is a number that represents the end index of the selected text. That is, it represents the index of the character immediately following the selection. Likewise, when there is no selection, this returns the offset of the character immediately following the current text input cursor position.
1734417344
*
@@ -17467,7 +17467,7 @@ interface HTMLInputElement extends HTMLElement, PopoverTargetAttributes {
1746717467
*
1746817468
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setSelectionRange)
1746917469
*/
17470-
setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void;
17470+
setSelectionRange(start: number | null, end: number | null, direction?: Directions): void;
1747117471
/**
1747217472
* The **`HTMLInputElement.showPicker()`** method displays the browser picker for an input element.
1747317473
*
@@ -42431,6 +42431,7 @@ type ConstrainDouble = number | ConstrainDoubleRange;
4243142431
type ConstrainULong = number | ConstrainULongRange;
4243242432
type CookieList = CookieListItem[];
4243342433
type DOMHighResTimeStamp = number;
42434+
type Directions = "forward" | "backward" | "none";
4243442435
type EpochTimeStamp = number;
4243542436
type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
4243642437
type FileSystemWriteChunkType = BufferSource | Blob | string | WriteParams;

baselines/ts5.9/dom.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17338,7 +17338,7 @@ interface HTMLInputElement extends HTMLElement, PopoverTargetAttributes {
1733817338
*
1733917339
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/selectionDirection)
1734017340
*/
17341-
selectionDirection: "forward" | "backward" | "none" | null;
17341+
selectionDirection: Directions | null;
1734217342
/**
1734317343
* The **`selectionEnd`** property of the HTMLInputElement interface is a number that represents the end index of the selected text. That is, it represents the index of the character immediately following the selection. Likewise, when there is no selection, this returns the offset of the character immediately following the current text input cursor position.
1734417344
*
@@ -17467,7 +17467,7 @@ interface HTMLInputElement extends HTMLElement, PopoverTargetAttributes {
1746717467
*
1746817468
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setSelectionRange)
1746917469
*/
17470-
setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void;
17470+
setSelectionRange(start: number | null, end: number | null, direction?: Directions): void;
1747117471
/**
1747217472
* The **`HTMLInputElement.showPicker()`** method displays the browser picker for an input element.
1747317473
*
@@ -42431,6 +42431,7 @@ type ConstrainDouble = number | ConstrainDoubleRange;
4243142431
type ConstrainULong = number | ConstrainULongRange;
4243242432
type CookieList = CookieListItem[];
4243342433
type DOMHighResTimeStamp = number;
42434+
type Directions = "forward" | "backward" | "none";
4243442435
type EpochTimeStamp = number;
4243542436
type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
4243642437
type FileSystemWriteChunkType = BufferSource | Blob | string | WriteParams;

inputfiles/addedTypes.jsonc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,6 @@
305305
"name": "IDBOpenDBRequest",
306306
"extends": "IDBRequest<IDBDatabase>"
307307
},
308-
"HTMLInputElement": {
309-
"properties": {
310-
"property": {
311-
"labels": {
312-
"overrideType": "NodeListOf<HTMLLabelElement>"
313-
}
314-
}
315-
}
316-
},
317308
// The spec removed `timestamp` but browsers still have it.
318309
// https://github.com/w3c/webrtc-encoded-transform/pull/204
319310
"RTCEncodedAudioFrame": {
@@ -606,6 +597,10 @@
606597
// Full spec at https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill.
607598
"name": "AutoFill",
608599
"overrideType": "AutoFillBase | `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<AutoFillAddressKind>}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`"
600+
},
601+
{
602+
"name": "Directions",
603+
"overrideType": "\"forward\" | \"backward\" | \"none\""
609604
}
610605
]
611606
}

inputfiles/knownTypes.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"AutoFillContactField",
1515
"AutoFillField",
1616
"AutoFillCredentialField",
17-
"AutoFill",
1817
"BigInteger",
1918
"ClientQueryOptions",
2019
"ClientTypes",

inputfiles/overridingTypes.jsonc

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,48 +1445,6 @@
14451445
}
14461446
}
14471447
},
1448-
"HTMLInputElement": {
1449-
"properties": {
1450-
"property": {
1451-
"autocomplete": {
1452-
"name": "autocomplete",
1453-
"overrideType": "AutoFill"
1454-
},
1455-
"selectionDirection": {
1456-
"name": "selectionDirection",
1457-
"overrideType": "\"forward\" | \"backward\" | \"none\""
1458-
},
1459-
"valueAsDate": {
1460-
"name": "valueAsDate",
1461-
"overrideType": "Date"
1462-
}
1463-
}
1464-
},
1465-
"methods": {
1466-
"method": {
1467-
"setSelectionRange": {
1468-
"signature": {
1469-
"0": {
1470-
"param": [
1471-
{
1472-
"name": "start",
1473-
"nullable": true
1474-
},
1475-
{
1476-
"name": "end",
1477-
"nullable": true
1478-
},
1479-
{
1480-
"name": "direction",
1481-
"overrideType": "\"forward\" | \"backward\" | \"none\""
1482-
}
1483-
]
1484-
}
1485-
}
1486-
}
1487-
}
1488-
}
1489-
},
14901448
"MouseEvent": {
14911449
"methods": {
14921450
"method": {

inputfiles/patches/html.kdl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@ interface HTMLImageElement {
4747
property loading overrideType=#""eager" | "lazy""#
4848
}
4949

50+
interface HTMLInputElement {
51+
property labels {
52+
type NodeListOf {
53+
type HTMLLabelElement
54+
}
55+
}
56+
property autocomplete type=AutoFill
57+
property valueAsDate type=Date
58+
property selectionDirection type=Directions
59+
method setSelectionRange signatureIndex=0 {
60+
param start nullable=#true
61+
param end nullable=#true
62+
param direction type=Directions
63+
}
64+
}
65+
5066
dictionary StructuredSerializeOptions {
5167
member transfer {
5268
type {

src/build/patches.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ function handleParam(node: Node) {
320320
name,
321321
...optionalMember("type", "string", node.properties?.type),
322322
...optionalMember("overrideType", "string", node.properties?.overrideType),
323+
...optionalMember("nullable", "boolean", node.properties?.nullable),
323324
additionalTypes,
324325
};
325326
}

0 commit comments

Comments
 (0)