@verajs/ssr 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +507 -390
- package/dist/vera/diagnostics.d.ts +20 -0
- package/dist/vera/diagnostics.js +98 -0
- package/dist/vera/escaping.d.ts +142 -0
- package/dist/vera/escaping.js +267 -0
- package/dist/vera/events.d.ts +41 -0
- package/dist/vera/events.js +162 -0
- package/dist/vera/frames.d.ts +38 -0
- package/dist/vera/frames.js +195 -0
- package/dist/vera/index.d.ts +48 -0
- package/dist/vera/index.js +480 -0
- package/{types → dist/vera}/nodes.d.ts +389 -302
- package/dist/vera/nodes.js +2322 -0
- package/dist/vera/parse.d.ts +37 -0
- package/dist/vera/parse.js +390 -0
- package/dist/vera/reflections.d.ts +566 -0
- package/dist/vera/reflections.js +820 -0
- package/dist/vera/registry.d.ts +14 -0
- package/{src → dist}/vera/registry.js +5 -1
- package/dist/vera/report.d.ts +27 -0
- package/dist/vera/report.js +56 -0
- package/dist/vera/scan.d.ts +37 -0
- package/dist/vera/scan.js +143 -0
- package/dist/vera/select.d.ts +40 -0
- package/dist/vera/select.js +261 -0
- package/dist/vera/serializer.d.ts +39 -0
- package/dist/vera/serializer.js +1372 -0
- package/dist/vera/shim.d.ts +42 -0
- package/dist/vera/shim.js +853 -0
- package/dist/vera/slots.d.ts +5 -0
- package/dist/vera/slots.js +104 -0
- package/dist/vera/stylesheets.d.ts +62 -0
- package/dist/vera/stylesheets.js +180 -0
- package/dist/vera/tokenizer.d.ts +32 -0
- package/dist/vera/tokenizer.js +528 -0
- package/dist/vera/types.d.ts +117 -0
- package/dist/vera/views.d.ts +63 -0
- package/dist/vera/views.js +245 -0
- package/package.json +12 -13
- package/src/vera/escaping.js +0 -135
- package/src/vera/events.js +0 -164
- package/src/vera/frames.js +0 -102
- package/src/vera/index.js +0 -1187
- package/src/vera/nodes.js +0 -2294
- package/src/vera/parse.js +0 -381
- package/src/vera/reflections.js +0 -811
- package/src/vera/select.js +0 -234
- package/src/vera/serializer.js +0 -1080
- package/src/vera/shim.js +0 -761
- package/src/vera/stylesheets.js +0 -155
- package/src/vera/views.js +0 -240
- package/types/escaping.d.ts +0 -27
- package/types/events.d.ts +0 -4
- package/types/frames.d.ts +0 -12
- package/types/index.d.ts +0 -13
- package/types/parse.d.ts +0 -19
- package/types/reflections.d.ts +0 -657
- package/types/registry.d.ts +0 -8
- package/types/select.d.ts +0 -5
- package/types/serializer.d.ts +0 -26
- package/types/shim.d.ts +0 -23
- package/types/stylesheets.d.ts +0 -53
- package/types/views.d.ts +0 -26
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The properties that exist only on *some* elements — `input.disabled`, `a.href`, `td.colSpan` —
|
|
3
|
+
* and the content attributes they reflect.
|
|
4
|
+
*
|
|
5
|
+
* **Why this file exists.** The server DOM had one element type for every tag, carrying only the
|
|
6
|
+
* members every element shares (`id`, `title`, `hidden`, `tabIndex`, the enumerated states). Nothing
|
|
7
|
+
* element-specific existed at all, so `button.disabled = true` stored a plain JavaScript property,
|
|
8
|
+
* wrote no attribute, and **rendered a button that was not disabled** — while reading the property
|
|
9
|
+
* back said `true`, so the code looked right. Setting `input.value`, `input.checked` and
|
|
10
|
+
* `option.selected` failed the same way, and reading any of them before writing gave `undefined`
|
|
11
|
+
* where a browser gives `''` or `false`, so `input.value.trim()` threw on the server and worked in
|
|
12
|
+
* the client.
|
|
13
|
+
*
|
|
14
|
+
* Nothing failed loudly, which is what made it bad: a control that must not be interactive shipped
|
|
15
|
+
* interactive, and stayed that way until the bundle landed and the client set the property for real.
|
|
16
|
+
*
|
|
17
|
+
* **The table is measured, not remembered.** `scripts/measure-element-reflections.mjs` drives
|
|
18
|
+
* Chromium, Firefox and WebKit: for every property on every element-specific interface it reads the
|
|
19
|
+
* value with the attribute absent, assigns a probe, and looks at which attribute appeared and what
|
|
20
|
+
* reading it back gives. A property is only recorded when all three engines agree on every one of
|
|
21
|
+
* those cells, and when reading the attribute back yields exactly what was written — which is what
|
|
22
|
+
* drops `input.width` (laid out, so it reads `0`), `meter.value` (clamped to its max) and
|
|
23
|
+
* `form.action` (resolved against a document URL this DOM does not have). The reasons are listed at
|
|
24
|
+
* the bottom of this file rather than left to be rediscovered.
|
|
25
|
+
*
|
|
26
|
+
* This is the same discipline the generic table in `nodes.js` was built with, and for the same
|
|
27
|
+
* reason: every value there that was written from memory turned out to be wrong. `tabIndex` had no
|
|
28
|
+
* default, so every element claimed to be in the tab order; `draggable` and `spellcheck` were given
|
|
29
|
+
* one shared default when they do not share one.
|
|
30
|
+
*
|
|
31
|
+
* **Enumerated states follow the majority where the engines differ**, as `popover: 'hint'` already
|
|
32
|
+
* does — an enumerated state cannot reach the markup, because the attribute is stored verbatim, so
|
|
33
|
+
* the cost of being in the minority is a property read and nothing else. The six that needed it are
|
|
34
|
+
* named at the bottom.
|
|
35
|
+
*
|
|
36
|
+
* `tests/browser/element-reflections.test.js` re-measures in a real engine and fails if this table
|
|
37
|
+
* and the browser have drifted apart.
|
|
38
|
+
*/
|
|
39
|
+
import type { ElementShim } from './nodes.js';
|
|
40
|
+
/**
|
|
41
|
+
* `[kind, attribute, ...]`, where kind is one of:
|
|
42
|
+
*
|
|
43
|
+
* - `presence` — a boolean; the attribute's presence is the value. A third entry is the answer when
|
|
44
|
+
* the attribute is absent, for the one case where that is not `false` (`script.async`).
|
|
45
|
+
* - `string` — the attribute's text, or `''` when it is absent.
|
|
46
|
+
* - `number` — the attribute parsed as an integer, or the third entry when absent or unparseable.
|
|
47
|
+
* - `enum` — `[missing, invalid, states]`: a limited set of states, answered canonically, with its
|
|
48
|
+
* own answer for absent and for anything outside the set.
|
|
49
|
+
*
|
|
50
|
+
* **An enumerated *content* attribute is not an enumerated *IDL* attribute**, and three rows here
|
|
51
|
+
* confused the two. `area.shape`, `ol.type` and `textarea.wrap` all name a limited set of keywords
|
|
52
|
+
* that affect rendering — but their IDL is a plain `attribute DOMString`, so the property echoes
|
|
53
|
+
* whatever was written. They were listed as `enum` with an invalid-value answer of
|
|
54
|
+
* `"zzz-not-a-state"`, which is not a string any engine produces: it is the **probe value** whoever
|
|
55
|
+
* wrote those rows used to discover an invalid-value default, recorded as though it were the answer.
|
|
56
|
+
*
|
|
57
|
+
* So `area.shape = 'probe'` answered `"zzz-not-a-state"` and `shape = 'CIRCLE'` answered `"circle"`,
|
|
58
|
+
* where every engine echoes the input. The header above says every enumerated state here "was
|
|
59
|
+
* measured on three engines instead of read off a spec" — these three were not; a measurement would
|
|
60
|
+
* have shown the echo. Reclassified as `string`, which is what the IDL says and what a real DOM does.
|
|
61
|
+
*/
|
|
62
|
+
export declare const ELEMENT_REFLECTIONS: {
|
|
63
|
+
a: {
|
|
64
|
+
charset: ["string", string];
|
|
65
|
+
coords: ["string", string];
|
|
66
|
+
download: ["string", string];
|
|
67
|
+
href: ["string", string];
|
|
68
|
+
hreflang: ["string", string];
|
|
69
|
+
name: ["string", string];
|
|
70
|
+
ping: ["string", string];
|
|
71
|
+
referrerPolicy: ["enum", string, string, string, string[]];
|
|
72
|
+
rel: ["string", string];
|
|
73
|
+
rev: ["string", string];
|
|
74
|
+
shape: ["string", string];
|
|
75
|
+
target: ["string", string];
|
|
76
|
+
type: ["string", string];
|
|
77
|
+
};
|
|
78
|
+
area: {
|
|
79
|
+
alt: ["string", string];
|
|
80
|
+
coords: ["string", string];
|
|
81
|
+
download: ["string", string];
|
|
82
|
+
href: ["string", string];
|
|
83
|
+
noHref: ["presence", string];
|
|
84
|
+
ping: ["string", string];
|
|
85
|
+
referrerPolicy: ["enum", string, string, string, string[]];
|
|
86
|
+
rel: ["string", string];
|
|
87
|
+
shape: ["string", string];
|
|
88
|
+
target: ["string", string];
|
|
89
|
+
};
|
|
90
|
+
base: {
|
|
91
|
+
target: ["string", string];
|
|
92
|
+
};
|
|
93
|
+
blockquote: {
|
|
94
|
+
cite: ["string", string];
|
|
95
|
+
};
|
|
96
|
+
br: {
|
|
97
|
+
clear: ["string", string];
|
|
98
|
+
};
|
|
99
|
+
button: {
|
|
100
|
+
disabled: ["presence", string];
|
|
101
|
+
formEnctype: ["enum", string, string, string, string[]];
|
|
102
|
+
formMethod: ["enum", string, string, string, string[]];
|
|
103
|
+
formNoValidate: ["presence", string];
|
|
104
|
+
formTarget: ["string", string];
|
|
105
|
+
name: ["string", string];
|
|
106
|
+
popoverTargetAction: ["enum", string, string, string, string[]];
|
|
107
|
+
type: ["enum", string, string, string, string[]];
|
|
108
|
+
value: ["string", string];
|
|
109
|
+
};
|
|
110
|
+
canvas: {
|
|
111
|
+
height: ["number", string, number];
|
|
112
|
+
width: ["number", string, number];
|
|
113
|
+
};
|
|
114
|
+
caption: {
|
|
115
|
+
align: ["string", string];
|
|
116
|
+
};
|
|
117
|
+
col: {
|
|
118
|
+
align: ["string", string];
|
|
119
|
+
ch: ["string", string];
|
|
120
|
+
chOff: ["string", string];
|
|
121
|
+
span: ["number", string, number];
|
|
122
|
+
vAlign: ["string", string];
|
|
123
|
+
width: ["string", string];
|
|
124
|
+
};
|
|
125
|
+
colgroup: {
|
|
126
|
+
align: ["string", string];
|
|
127
|
+
ch: ["string", string];
|
|
128
|
+
chOff: ["string", string];
|
|
129
|
+
span: ["number", string, number];
|
|
130
|
+
vAlign: ["string", string];
|
|
131
|
+
width: ["string", string];
|
|
132
|
+
};
|
|
133
|
+
data: {
|
|
134
|
+
value: ["string", string];
|
|
135
|
+
};
|
|
136
|
+
del: {
|
|
137
|
+
cite: ["string", string];
|
|
138
|
+
dateTime: ["string", string];
|
|
139
|
+
};
|
|
140
|
+
details: {
|
|
141
|
+
name: ["string", string];
|
|
142
|
+
open: ["presence", string];
|
|
143
|
+
};
|
|
144
|
+
dialog: {
|
|
145
|
+
closedBy: ["enum", string, string, string, string[]];
|
|
146
|
+
open: ["presence", string];
|
|
147
|
+
};
|
|
148
|
+
div: {
|
|
149
|
+
align: ["string", string];
|
|
150
|
+
};
|
|
151
|
+
dl: {
|
|
152
|
+
compact: ["presence", string];
|
|
153
|
+
};
|
|
154
|
+
embed: {
|
|
155
|
+
align: ["string", string];
|
|
156
|
+
height: ["string", string];
|
|
157
|
+
name: ["string", string];
|
|
158
|
+
src: ["string", string];
|
|
159
|
+
type: ["string", string];
|
|
160
|
+
width: ["string", string];
|
|
161
|
+
};
|
|
162
|
+
fieldset: {
|
|
163
|
+
disabled: ["presence", string];
|
|
164
|
+
name: ["string", string];
|
|
165
|
+
};
|
|
166
|
+
form: {
|
|
167
|
+
acceptCharset: ["string", string];
|
|
168
|
+
autocomplete: ["enum", string, string, string, string[]];
|
|
169
|
+
encoding: ["enum", string, string, string, string[]];
|
|
170
|
+
enctype: ["enum", string, string, string, string[]];
|
|
171
|
+
method: ["enum", string, string, string, string[]];
|
|
172
|
+
name: ["string", string];
|
|
173
|
+
noValidate: ["presence", string];
|
|
174
|
+
rel: ["string", string];
|
|
175
|
+
target: ["string", string];
|
|
176
|
+
};
|
|
177
|
+
h1: {
|
|
178
|
+
align: ["string", string];
|
|
179
|
+
};
|
|
180
|
+
h2: {
|
|
181
|
+
align: ["string", string];
|
|
182
|
+
};
|
|
183
|
+
h3: {
|
|
184
|
+
align: ["string", string];
|
|
185
|
+
};
|
|
186
|
+
h4: {
|
|
187
|
+
align: ["string", string];
|
|
188
|
+
};
|
|
189
|
+
h5: {
|
|
190
|
+
align: ["string", string];
|
|
191
|
+
};
|
|
192
|
+
h6: {
|
|
193
|
+
align: ["string", string];
|
|
194
|
+
};
|
|
195
|
+
hr: {
|
|
196
|
+
align: ["string", string];
|
|
197
|
+
color: ["string", string];
|
|
198
|
+
noShade: ["presence", string];
|
|
199
|
+
size: ["string", string];
|
|
200
|
+
width: ["string", string];
|
|
201
|
+
};
|
|
202
|
+
iframe: {
|
|
203
|
+
align: ["string", string];
|
|
204
|
+
allow: ["string", string];
|
|
205
|
+
allowFullscreen: ["presence", string];
|
|
206
|
+
frameBorder: ["string", string];
|
|
207
|
+
height: ["string", string];
|
|
208
|
+
loading: ["enum", string, string, string, string[]];
|
|
209
|
+
longDesc: ["string", string];
|
|
210
|
+
marginHeight: ["string", string];
|
|
211
|
+
marginWidth: ["string", string];
|
|
212
|
+
name: ["string", string];
|
|
213
|
+
referrerPolicy: ["enum", string, string, string, string[]];
|
|
214
|
+
scrolling: ["string", string];
|
|
215
|
+
src: ["string", string];
|
|
216
|
+
srcdoc: ["string", string];
|
|
217
|
+
width: ["string", string];
|
|
218
|
+
};
|
|
219
|
+
img: {
|
|
220
|
+
align: ["string", string];
|
|
221
|
+
alt: ["string", string];
|
|
222
|
+
border: ["string", string];
|
|
223
|
+
decoding: ["enum", string, string, string, string[]];
|
|
224
|
+
fetchPriority: ["enum", string, string, string, string[]];
|
|
225
|
+
height: ["number", string, number];
|
|
226
|
+
hspace: ["number", string, number];
|
|
227
|
+
isMap: ["presence", string];
|
|
228
|
+
loading: ["enum", string, string, string, string[]];
|
|
229
|
+
longDesc: ["string", string];
|
|
230
|
+
lowsrc: ["string", string];
|
|
231
|
+
name: ["string", string];
|
|
232
|
+
referrerPolicy: ["enum", string, string, string, string[]];
|
|
233
|
+
sizes: ["string", string];
|
|
234
|
+
src: ["string", string];
|
|
235
|
+
srcset: ["string", string];
|
|
236
|
+
useMap: ["string", string];
|
|
237
|
+
vspace: ["number", string, number];
|
|
238
|
+
width: ["number", string, number];
|
|
239
|
+
};
|
|
240
|
+
input: {
|
|
241
|
+
accept: ["string", string];
|
|
242
|
+
align: ["string", string];
|
|
243
|
+
alt: ["string", string];
|
|
244
|
+
autocomplete: ["enum", string, string, string, string[]];
|
|
245
|
+
defaultChecked: ["presence", string];
|
|
246
|
+
defaultValue: ["string", string];
|
|
247
|
+
dirName: ["string", string];
|
|
248
|
+
disabled: ["presence", string];
|
|
249
|
+
formEnctype: ["enum", string, string, string, string[]];
|
|
250
|
+
formMethod: ["enum", string, string, string, string[]];
|
|
251
|
+
formNoValidate: ["presence", string];
|
|
252
|
+
formTarget: ["string", string];
|
|
253
|
+
max: ["string", string];
|
|
254
|
+
maxLength: ["number", string, number];
|
|
255
|
+
min: ["string", string];
|
|
256
|
+
minLength: ["number", string, number];
|
|
257
|
+
multiple: ["presence", string];
|
|
258
|
+
name: ["string", string];
|
|
259
|
+
pattern: ["string", string];
|
|
260
|
+
placeholder: ["string", string];
|
|
261
|
+
popoverTargetAction: ["enum", string, string, string, string[]];
|
|
262
|
+
readOnly: ["presence", string];
|
|
263
|
+
required: ["presence", string];
|
|
264
|
+
size: ["number", string, number];
|
|
265
|
+
src: ["string", string];
|
|
266
|
+
step: ["string", string];
|
|
267
|
+
type: ["enum", string, string, string, string[]];
|
|
268
|
+
useMap: ["string", string];
|
|
269
|
+
webkitdirectory: ["presence", string];
|
|
270
|
+
};
|
|
271
|
+
ins: {
|
|
272
|
+
cite: ["string", string];
|
|
273
|
+
dateTime: ["string", string];
|
|
274
|
+
};
|
|
275
|
+
label: {
|
|
276
|
+
htmlFor: ["string", string];
|
|
277
|
+
};
|
|
278
|
+
legend: {
|
|
279
|
+
align: ["string", string];
|
|
280
|
+
};
|
|
281
|
+
li: {
|
|
282
|
+
type: ["string", string];
|
|
283
|
+
value: ["number", string, number];
|
|
284
|
+
};
|
|
285
|
+
link: {
|
|
286
|
+
as: ["enum", string, string, string, string[]];
|
|
287
|
+
charset: ["string", string];
|
|
288
|
+
disabled: ["presence", string];
|
|
289
|
+
fetchPriority: ["enum", string, string, string, string[]];
|
|
290
|
+
href: ["string", string];
|
|
291
|
+
hreflang: ["string", string];
|
|
292
|
+
imageSizes: ["string", string];
|
|
293
|
+
imageSrcset: ["string", string];
|
|
294
|
+
integrity: ["string", string];
|
|
295
|
+
media: ["string", string];
|
|
296
|
+
referrerPolicy: ["enum", string, string, string, string[]];
|
|
297
|
+
rel: ["string", string];
|
|
298
|
+
rev: ["string", string];
|
|
299
|
+
target: ["string", string];
|
|
300
|
+
type: ["string", string];
|
|
301
|
+
};
|
|
302
|
+
map: {
|
|
303
|
+
name: ["string", string];
|
|
304
|
+
};
|
|
305
|
+
menu: {
|
|
306
|
+
compact: ["presence", string];
|
|
307
|
+
};
|
|
308
|
+
meta: {
|
|
309
|
+
content: ["string", string];
|
|
310
|
+
httpEquiv: ["string", string];
|
|
311
|
+
media: ["string", string];
|
|
312
|
+
name: ["string", string];
|
|
313
|
+
scheme: ["string", string];
|
|
314
|
+
};
|
|
315
|
+
meter: {
|
|
316
|
+
max: ["number", string, number];
|
|
317
|
+
min: ["number", string, number];
|
|
318
|
+
};
|
|
319
|
+
object: {
|
|
320
|
+
align: ["string", string];
|
|
321
|
+
archive: ["string", string];
|
|
322
|
+
border: ["string", string];
|
|
323
|
+
code: ["string", string];
|
|
324
|
+
codeBase: ["string", string];
|
|
325
|
+
codeType: ["string", string];
|
|
326
|
+
data: ["string", string];
|
|
327
|
+
declare: ["presence", string];
|
|
328
|
+
height: ["string", string];
|
|
329
|
+
hspace: ["number", string, number];
|
|
330
|
+
name: ["string", string];
|
|
331
|
+
standby: ["string", string];
|
|
332
|
+
type: ["string", string];
|
|
333
|
+
useMap: ["string", string];
|
|
334
|
+
vspace: ["number", string, number];
|
|
335
|
+
width: ["string", string];
|
|
336
|
+
};
|
|
337
|
+
ol: {
|
|
338
|
+
compact: ["presence", string];
|
|
339
|
+
reversed: ["presence", string];
|
|
340
|
+
start: ["number", string, number];
|
|
341
|
+
type: ["string", string];
|
|
342
|
+
};
|
|
343
|
+
optgroup: {
|
|
344
|
+
disabled: ["presence", string];
|
|
345
|
+
label: ["string", string];
|
|
346
|
+
};
|
|
347
|
+
option: {
|
|
348
|
+
defaultSelected: ["presence", string];
|
|
349
|
+
disabled: ["presence", string];
|
|
350
|
+
label: ["string", string];
|
|
351
|
+
value: ["string", string];
|
|
352
|
+
};
|
|
353
|
+
output: {
|
|
354
|
+
name: ["string", string];
|
|
355
|
+
};
|
|
356
|
+
p: {
|
|
357
|
+
align: ["string", string];
|
|
358
|
+
};
|
|
359
|
+
param: {
|
|
360
|
+
name: ["string", string];
|
|
361
|
+
type: ["string", string];
|
|
362
|
+
value: ["string", string];
|
|
363
|
+
valueType: ["string", string];
|
|
364
|
+
};
|
|
365
|
+
pre: {
|
|
366
|
+
width: ["number", string, number];
|
|
367
|
+
};
|
|
368
|
+
progress: {
|
|
369
|
+
max: ["number", string, number];
|
|
370
|
+
};
|
|
371
|
+
q: {
|
|
372
|
+
cite: ["string", string];
|
|
373
|
+
};
|
|
374
|
+
script: {
|
|
375
|
+
async: ["presence", string, true];
|
|
376
|
+
charset: ["string", string];
|
|
377
|
+
defer: ["presence", string];
|
|
378
|
+
event: ["string", string];
|
|
379
|
+
fetchPriority: ["enum", string, string, string, string[]];
|
|
380
|
+
htmlFor: ["string", string];
|
|
381
|
+
integrity: ["string", string];
|
|
382
|
+
noModule: ["presence", string];
|
|
383
|
+
referrerPolicy: ["enum", string, string, string, string[]];
|
|
384
|
+
src: ["string", string];
|
|
385
|
+
type: ["string", string];
|
|
386
|
+
};
|
|
387
|
+
select: {
|
|
388
|
+
autocomplete: ["enum", string, string, string, string[]];
|
|
389
|
+
disabled: ["presence", string];
|
|
390
|
+
multiple: ["presence", string];
|
|
391
|
+
name: ["string", string];
|
|
392
|
+
required: ["presence", string];
|
|
393
|
+
size: ["number", string, number];
|
|
394
|
+
};
|
|
395
|
+
slot: {
|
|
396
|
+
name: ["string", string];
|
|
397
|
+
};
|
|
398
|
+
source: {
|
|
399
|
+
height: ["number", string, number];
|
|
400
|
+
media: ["string", string];
|
|
401
|
+
sizes: ["string", string];
|
|
402
|
+
src: ["string", string];
|
|
403
|
+
srcset: ["string", string];
|
|
404
|
+
type: ["string", string];
|
|
405
|
+
width: ["number", string, number];
|
|
406
|
+
};
|
|
407
|
+
style: {
|
|
408
|
+
media: ["string", string];
|
|
409
|
+
type: ["string", string];
|
|
410
|
+
};
|
|
411
|
+
table: {
|
|
412
|
+
align: ["string", string];
|
|
413
|
+
bgColor: ["string", string];
|
|
414
|
+
border: ["string", string];
|
|
415
|
+
cellPadding: ["string", string];
|
|
416
|
+
cellSpacing: ["string", string];
|
|
417
|
+
frame: ["string", string];
|
|
418
|
+
rules: ["string", string];
|
|
419
|
+
summary: ["string", string];
|
|
420
|
+
width: ["string", string];
|
|
421
|
+
};
|
|
422
|
+
tbody: {
|
|
423
|
+
align: ["string", string];
|
|
424
|
+
ch: ["string", string];
|
|
425
|
+
chOff: ["string", string];
|
|
426
|
+
vAlign: ["string", string];
|
|
427
|
+
};
|
|
428
|
+
td: {
|
|
429
|
+
abbr: ["string", string];
|
|
430
|
+
align: ["string", string];
|
|
431
|
+
axis: ["string", string];
|
|
432
|
+
bgColor: ["string", string];
|
|
433
|
+
ch: ["string", string];
|
|
434
|
+
chOff: ["string", string];
|
|
435
|
+
colSpan: ["number", string, number];
|
|
436
|
+
headers: ["string", string];
|
|
437
|
+
height: ["string", string];
|
|
438
|
+
noWrap: ["presence", string];
|
|
439
|
+
rowSpan: ["number", string, number];
|
|
440
|
+
scope: ["enum", string, string, string, string[]];
|
|
441
|
+
vAlign: ["string", string];
|
|
442
|
+
width: ["string", string];
|
|
443
|
+
};
|
|
444
|
+
template: {
|
|
445
|
+
/**
|
|
446
|
+
* Measured identical on Chromium, Firefox and WebKit: absent and invalid both answer `''`, and a
|
|
447
|
+
* valid keyword is answered lowercased (`'OPEN'` → `'open'`). It is here rather than excluded
|
|
448
|
+
* because this package **emits** `<template shadowrootmode>` for declarative shadow DOM, so a
|
|
449
|
+
* component reading it back on the server is asking about markup this renderer wrote.
|
|
450
|
+
*/
|
|
451
|
+
shadowRootMode: ["enum", string, string, string, string[]];
|
|
452
|
+
shadowRootClonable: ["presence", string];
|
|
453
|
+
shadowRootDelegatesFocus: ["presence", string];
|
|
454
|
+
shadowRootSerializable: ["presence", string];
|
|
455
|
+
};
|
|
456
|
+
textarea: {
|
|
457
|
+
autocomplete: ["enum", string, string, string, string[]];
|
|
458
|
+
cols: ["number", string, number];
|
|
459
|
+
dirName: ["string", string];
|
|
460
|
+
disabled: ["presence", string];
|
|
461
|
+
maxLength: ["number", string, number];
|
|
462
|
+
minLength: ["number", string, number];
|
|
463
|
+
name: ["string", string];
|
|
464
|
+
placeholder: ["string", string];
|
|
465
|
+
readOnly: ["presence", string];
|
|
466
|
+
required: ["presence", string];
|
|
467
|
+
rows: ["number", string, number];
|
|
468
|
+
wrap: ["string", string];
|
|
469
|
+
};
|
|
470
|
+
tfoot: {
|
|
471
|
+
align: ["string", string];
|
|
472
|
+
ch: ["string", string];
|
|
473
|
+
chOff: ["string", string];
|
|
474
|
+
vAlign: ["string", string];
|
|
475
|
+
};
|
|
476
|
+
th: {
|
|
477
|
+
abbr: ["string", string];
|
|
478
|
+
align: ["string", string];
|
|
479
|
+
axis: ["string", string];
|
|
480
|
+
bgColor: ["string", string];
|
|
481
|
+
ch: ["string", string];
|
|
482
|
+
chOff: ["string", string];
|
|
483
|
+
colSpan: ["number", string, number];
|
|
484
|
+
headers: ["string", string];
|
|
485
|
+
height: ["string", string];
|
|
486
|
+
noWrap: ["presence", string];
|
|
487
|
+
rowSpan: ["number", string, number];
|
|
488
|
+
scope: ["enum", string, string, string, string[]];
|
|
489
|
+
vAlign: ["string", string];
|
|
490
|
+
width: ["string", string];
|
|
491
|
+
};
|
|
492
|
+
thead: {
|
|
493
|
+
align: ["string", string];
|
|
494
|
+
ch: ["string", string];
|
|
495
|
+
chOff: ["string", string];
|
|
496
|
+
vAlign: ["string", string];
|
|
497
|
+
};
|
|
498
|
+
time: {
|
|
499
|
+
dateTime: ["string", string];
|
|
500
|
+
};
|
|
501
|
+
tr: {
|
|
502
|
+
align: ["string", string];
|
|
503
|
+
bgColor: ["string", string];
|
|
504
|
+
ch: ["string", string];
|
|
505
|
+
chOff: ["string", string];
|
|
506
|
+
vAlign: ["string", string];
|
|
507
|
+
};
|
|
508
|
+
track: {
|
|
509
|
+
default: ["presence", string];
|
|
510
|
+
kind: ["enum", string, string, string, string[]];
|
|
511
|
+
label: ["string", string];
|
|
512
|
+
src: ["string", string];
|
|
513
|
+
srclang: ["string", string];
|
|
514
|
+
};
|
|
515
|
+
ul: {
|
|
516
|
+
compact: ["presence", string];
|
|
517
|
+
type: ["string", string];
|
|
518
|
+
};
|
|
519
|
+
video: {
|
|
520
|
+
disablePictureInPicture: ["presence", string];
|
|
521
|
+
height: ["number", string, number];
|
|
522
|
+
poster: ["string", string];
|
|
523
|
+
width: ["number", string, number];
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
/**
|
|
527
|
+
* The constructor an element of this tag should be built with: `Base` when the tag has no interface
|
|
528
|
+
* of its own, otherwise a subclass carrying its properties.
|
|
529
|
+
*
|
|
530
|
+
* A class per tag rather than accessors on the shared prototype, because `'disabled' in paragraph`
|
|
531
|
+
* must stay `false` — an element answering for members its interface does not have is the same lie
|
|
532
|
+
* as one missing the members it does.
|
|
533
|
+
*
|
|
534
|
+
* A subclass rather than `Object.setPrototypeOf` on a finished element, which was the first shape
|
|
535
|
+
* this took. Measured over 20,000 elements, three runs each: setting the prototype afterwards cost
|
|
536
|
+
* **~745 ns** per `<input>` (and once wandered to 1004) against ~400 ns for a `<div>`; building it
|
|
537
|
+
* as its own class costs **~458 ns**. The `<div>` figure is unchanged either way, which is the part
|
|
538
|
+
* worth recording — the penalty was local to the element whose prototype was mutated, not spread
|
|
539
|
+
* across the shared path, so the first draft of this comment blamed a deopt it had not measured.
|
|
540
|
+
*/
|
|
541
|
+
export declare const interfaceFor: (tag: string, Base: typeof ElementShim) => typeof ElementShim;
|
|
542
|
+
/**
|
|
543
|
+
* **What the engines expose that this table deliberately does not**, so the next reader does not
|
|
544
|
+
* have to measure it again to find out why:
|
|
545
|
+
*
|
|
546
|
+
* - `base.href`, `form.action`, `button.formAction`, `input.formAction` — resolved against the
|
|
547
|
+
* document's URL, which a server render does not have. Answering the raw attribute would be a
|
|
548
|
+
* different value from the browser's; answering an absolute URL would require inventing an origin.
|
|
549
|
+
* - `input.width`, `input.height` — read back from layout, so a browser answers `0` for anything it
|
|
550
|
+
* has not laid out, whatever the attribute says.
|
|
551
|
+
* - `meter.value`, `meter.low`, `meter.high`, `meter.optimum`, `progress.value` — clamped against
|
|
552
|
+
* each other and against `max`, so the property is not the attribute.
|
|
553
|
+
* - `button.command` — canonicalized to `''` for anything outside its state list, which is not yet
|
|
554
|
+
* stable across engines.
|
|
555
|
+
* - Vendor extensions present in one engine only: `a.attributionSourceId` and its two neighbors,
|
|
556
|
+
* `area.hreflang`, `area.type`, `canvas.mozOpaque`, `iframe.csp`, `iframe.credentialless`,
|
|
557
|
+
* `iframe.allowPaymentRequest`, `input.incremental`, `input.alpha`, `input.colorSpace`,
|
|
558
|
+
* `input.switch`, `video.playsInline`, `video.autoPictureInPicture`,
|
|
559
|
+
* `video.webkitWirelessVideoPlaybackDisabled`.
|
|
560
|
+
*
|
|
561
|
+
* And the six where the engines disagree and the majority was taken, none of which can reach the
|
|
562
|
+
* markup: `input.type` (Chromium accepts `month` and `week`; the others do not), `link.as` (three
|
|
563
|
+
* different state lists), `img.loading` and `iframe.loading` (absent reads `auto` in Chromium and
|
|
564
|
+
* `eager` elsewhere), `button.popoverTargetAction` and `input.popoverTargetAction` (absent reads
|
|
565
|
+
* `''` in Firefox and `toggle` elsewhere).
|
|
566
|
+
*/
|