-
Notifications
You must be signed in to change notification settings - Fork 469
Expand file tree
/
Copy pathhtml.kdl
More file actions
188 lines (169 loc) · 4.41 KB
/
html.kdl
File metadata and controls
188 lines (169 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
enum ImageOrientation {
// The spec removed this but it's still in browsers and WebKit doesn't support the new one.
// Keep it until it's safer to fully migrate.
// See https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1507#issuecomment-1454792451
none
}
interface HTMLTableDataCellElement extends=HTMLTableCellElement exposed=Window deprecated="prefer HTMLTableCellElement" noInterfaceObject=#true
interface HTMLTableHeaderCellElement extends=HTMLTableCellElement exposed=Window deprecated="prefer HTMLTableCellElement" noInterfaceObject=#true
interface HTMLDocument extends=Document exposed=Window
interface HTMLIFrameElement {
property referrerPolicy type=ReferrerPolicy
property loading overrideType=#""eager" | "lazy""#
}
interface HTMLTableElement {
property rows {
type HTMLCollectionOf {
type HTMLTableRowElement
}
}
property tBodies {
type HTMLCollectionOf {
type HTMLTableSectionElement
}
}
}
interface HTMLTableSectionElement {
property rows {
type HTMLCollectionOf {
type HTMLTableRowElement
}
}
}
interface HTMLMeterElement {
property labels {
type NodeListOf {
type HTMLLabelElement
}
}
}
interface HTMLOutputElement {
property labels {
type NodeListOf {
type HTMLLabelElement
}
}
}
interface HTMLProgressElement {
property labels {
type NodeListOf {
type HTMLLabelElement
}
}
}
interface-mixin MessageEventTarget overrideThis=T typeParameter=T
interface-mixin WindowEventHandlers {
property onunload deprecated="The unload event is not reliable, consider visibilitychange or pagehide events."
}
interface HTMLImageElement {
property decoding overrideType=#""async" | "sync" | "auto""#
property loading overrideType=#""eager" | "lazy""#
}
interface HTMLInputElement {
property labels {
type NodeListOf {
type HTMLLabelElement
}
}
property autocomplete type=AutoFill
property valueAsDate type=Date
property selectionDirection type=SelectionDirection
method setSelectionRange signatureIndex=0 {
// nullable types because we want to allow passing selectionStart/End properties, which are nullable.
// See also https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/878.
param start {
type nullable=#true
}
param end {
type nullable=#true
}
param direction type=SelectionDirection
}
}
interface HTMLTextAreaElement {
property autocomplete type=AutoFill
property labels {
type NodeListOf {
type HTMLLabelElement
}
}
property selectionDirection type=SelectionDirection
method setSelectionRange signatureIndex=0 {
// Same as in HTMLInputElement
param start {
type nullable=#true
}
param end {
type nullable=#true
}
param direction type=SelectionDirection
}
}
typedef SelectionDirection overrideType=#""forward" | "backward" | "none""#
dictionary StructuredSerializeOptions {
member transfer {
type {
type Transferable
}
}
}
// https://html.spec.whatwg.org/multipage/dom.html#the-document-object
interface Document {
// Pre-TS-5.1 hack to make document.location assignable
property location readonly=#false {
// Technically this can be null for a detached iframe.
// But that's an edge case and flipping this also breaks compatibility.
type nullable=#false
}
// Similarly body and head are mostly non-null for HTML documents.
// body can frequently be null when executing scripts in head, but flipping
// it also breaks compatibiliity.
property body {
type nullable=#false
}
property head {
type nullable=#false
}
// More specific types for HTMLCollection properties
property anchors {
type HTMLCollectionOf {
type HTMLAnchorElement
}
}
property embeds {
type HTMLCollectionOf {
type HTMLEmbedElement
}
}
property forms {
type HTMLCollectionOf {
type HTMLFormElement
}
}
property images {
type HTMLCollectionOf {
type HTMLImageElement
}
}
property links {
type HTMLCollectionOf {
type HTMLAnchorElement
type HTMLAreaElement
}
}
property plugins {
type HTMLCollectionOf {
type HTMLEmbedElement
}
}
property scripts {
type HTMLCollectionOf {
type HTMLScriptElement
}
}
}
removals {
dictionary CanvasRenderingContext2DSettings {
member colorType // Blink-only as of 2025-12, being tested in WebKit
}
}