@verajs/ssr 0.1.4 → 0.2.1
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 +391 -10
- package/package.json +37 -4
- package/src/vera/escaping.js +135 -0
- package/src/vera/events.js +164 -0
- package/src/vera/frames.js +102 -0
- package/src/vera/index.js +1132 -46
- package/src/vera/nodes.js +2294 -0
- package/src/vera/parse.js +381 -0
- package/src/vera/reflections.js +811 -0
- package/src/vera/registry.js +9 -0
- package/src/vera/select.js +234 -0
- package/src/vera/serializer.js +947 -43
- package/src/vera/shim.js +734 -108
- package/src/vera/stylesheets.js +155 -0
- package/src/vera/views.js +240 -0
- package/types/escaping.d.ts +27 -0
- package/types/events.d.ts +4 -0
- package/types/frames.d.ts +12 -0
- package/types/index.d.ts +13 -0
- package/types/nodes.d.ts +748 -0
- package/types/parse.d.ts +19 -0
- package/types/reflections.d.ts +657 -0
- package/types/registry.d.ts +8 -0
- package/types/select.d.ts +5 -0
- package/types/serializer.d.ts +26 -0
- package/types/shim.d.ts +23 -0
- package/types/stylesheets.d.ts +53 -0
- package/types/views.d.ts +26 -0
|
@@ -0,0 +1,811 @@
|
|
|
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
|
+
|
|
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 const ELEMENT_REFLECTIONS = {
|
|
63
|
+
a: {
|
|
64
|
+
charset: ["string","charset"],
|
|
65
|
+
coords: ["string","coords"],
|
|
66
|
+
download: ["string","download"],
|
|
67
|
+
href: ["string","href"],
|
|
68
|
+
hreflang: ["string","hreflang"],
|
|
69
|
+
name: ["string","name"],
|
|
70
|
+
ping: ["string","ping"],
|
|
71
|
+
referrerPolicy: ["enum","referrerpolicy","","",["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]],
|
|
72
|
+
rel: ["string","rel"],
|
|
73
|
+
rev: ["string","rev"],
|
|
74
|
+
shape: ["string","shape"],
|
|
75
|
+
target: ["string","target"],
|
|
76
|
+
type: ["string","type"],
|
|
77
|
+
},
|
|
78
|
+
area: {
|
|
79
|
+
alt: ["string","alt"],
|
|
80
|
+
coords: ["string","coords"],
|
|
81
|
+
download: ["string","download"],
|
|
82
|
+
href: ["string","href"],
|
|
83
|
+
noHref: ["presence","nohref"],
|
|
84
|
+
ping: ["string","ping"],
|
|
85
|
+
referrerPolicy: ["enum","referrerpolicy","","",["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]],
|
|
86
|
+
rel: ["string","rel"],
|
|
87
|
+
shape: ["string","shape"],
|
|
88
|
+
target: ["string","target"],
|
|
89
|
+
},
|
|
90
|
+
base: {
|
|
91
|
+
target: ["string","target"],
|
|
92
|
+
},
|
|
93
|
+
blockquote: {
|
|
94
|
+
cite: ["string","cite"],
|
|
95
|
+
},
|
|
96
|
+
br: {
|
|
97
|
+
clear: ["string","clear"],
|
|
98
|
+
},
|
|
99
|
+
button: {
|
|
100
|
+
disabled: ["presence","disabled"],
|
|
101
|
+
formEnctype: ["enum","formenctype","","application/x-www-form-urlencoded",["application/x-www-form-urlencoded","multipart/form-data","text/plain"]],
|
|
102
|
+
formMethod: ["enum","formmethod","","get",["get","post","dialog"]],
|
|
103
|
+
formNoValidate: ["presence","formnovalidate"],
|
|
104
|
+
formTarget: ["string","formtarget"],
|
|
105
|
+
name: ["string","name"],
|
|
106
|
+
popoverTargetAction: ["enum","popovertargetaction","toggle","toggle",["toggle","show","hide"]],
|
|
107
|
+
type: ["enum","type","submit","submit",["submit","reset","button"]],
|
|
108
|
+
value: ["string","value"],
|
|
109
|
+
},
|
|
110
|
+
canvas: {
|
|
111
|
+
height: ["number","height",150],
|
|
112
|
+
width: ["number","width",300],
|
|
113
|
+
},
|
|
114
|
+
caption: {
|
|
115
|
+
align: ["string","align"],
|
|
116
|
+
},
|
|
117
|
+
col: {
|
|
118
|
+
align: ["string","align"],
|
|
119
|
+
ch: ["string","char"],
|
|
120
|
+
chOff: ["string","charoff"],
|
|
121
|
+
span: ["number","span",1],
|
|
122
|
+
vAlign: ["string","valign"],
|
|
123
|
+
width: ["string","width"],
|
|
124
|
+
},
|
|
125
|
+
colgroup: {
|
|
126
|
+
align: ["string","align"],
|
|
127
|
+
ch: ["string","char"],
|
|
128
|
+
chOff: ["string","charoff"],
|
|
129
|
+
span: ["number","span",1],
|
|
130
|
+
vAlign: ["string","valign"],
|
|
131
|
+
width: ["string","width"],
|
|
132
|
+
},
|
|
133
|
+
data: {
|
|
134
|
+
value: ["string","value"],
|
|
135
|
+
},
|
|
136
|
+
del: {
|
|
137
|
+
cite: ["string","cite"],
|
|
138
|
+
dateTime: ["string","datetime"],
|
|
139
|
+
},
|
|
140
|
+
details: {
|
|
141
|
+
name: ["string","name"],
|
|
142
|
+
open: ["presence","open"],
|
|
143
|
+
},
|
|
144
|
+
dialog: {
|
|
145
|
+
closedBy: ["enum","closedby","none","none",["any","closerequest","none"]],
|
|
146
|
+
open: ["presence","open"],
|
|
147
|
+
},
|
|
148
|
+
div: {
|
|
149
|
+
align: ["string","align"],
|
|
150
|
+
},
|
|
151
|
+
dl: {
|
|
152
|
+
compact: ["presence","compact"],
|
|
153
|
+
},
|
|
154
|
+
embed: {
|
|
155
|
+
align: ["string","align"],
|
|
156
|
+
height: ["string","height"],
|
|
157
|
+
name: ["string","name"],
|
|
158
|
+
src: ["string","src"],
|
|
159
|
+
type: ["string","type"],
|
|
160
|
+
width: ["string","width"],
|
|
161
|
+
},
|
|
162
|
+
fieldset: {
|
|
163
|
+
disabled: ["presence","disabled"],
|
|
164
|
+
name: ["string","name"],
|
|
165
|
+
},
|
|
166
|
+
form: {
|
|
167
|
+
acceptCharset: ["string","accept-charset"],
|
|
168
|
+
autocomplete: ["enum","autocomplete","on","on",["on","off"]],
|
|
169
|
+
encoding: ["enum","enctype","application/x-www-form-urlencoded","application/x-www-form-urlencoded",["application/x-www-form-urlencoded","multipart/form-data","text/plain"]],
|
|
170
|
+
enctype: ["enum","enctype","application/x-www-form-urlencoded","application/x-www-form-urlencoded",["application/x-www-form-urlencoded","multipart/form-data","text/plain"]],
|
|
171
|
+
method: ["enum","method","get","get",["get","post","dialog"]],
|
|
172
|
+
name: ["string","name"],
|
|
173
|
+
noValidate: ["presence","novalidate"],
|
|
174
|
+
rel: ["string","rel"],
|
|
175
|
+
target: ["string","target"],
|
|
176
|
+
},
|
|
177
|
+
h1: {
|
|
178
|
+
align: ["string","align"],
|
|
179
|
+
},
|
|
180
|
+
h2: {
|
|
181
|
+
align: ["string","align"],
|
|
182
|
+
},
|
|
183
|
+
h3: {
|
|
184
|
+
align: ["string","align"],
|
|
185
|
+
},
|
|
186
|
+
h4: {
|
|
187
|
+
align: ["string","align"],
|
|
188
|
+
},
|
|
189
|
+
h5: {
|
|
190
|
+
align: ["string","align"],
|
|
191
|
+
},
|
|
192
|
+
h6: {
|
|
193
|
+
align: ["string","align"],
|
|
194
|
+
},
|
|
195
|
+
hr: {
|
|
196
|
+
align: ["string","align"],
|
|
197
|
+
color: ["string","color"],
|
|
198
|
+
noShade: ["presence","noshade"],
|
|
199
|
+
size: ["string","size"],
|
|
200
|
+
width: ["string","width"],
|
|
201
|
+
},
|
|
202
|
+
iframe: {
|
|
203
|
+
align: ["string","align"],
|
|
204
|
+
allow: ["string","allow"],
|
|
205
|
+
allowFullscreen: ["presence","allowfullscreen"],
|
|
206
|
+
frameBorder: ["string","frameborder"],
|
|
207
|
+
height: ["string","height"],
|
|
208
|
+
loading: ["enum","loading","eager","eager",["eager","lazy"]],
|
|
209
|
+
longDesc: ["string","longdesc"],
|
|
210
|
+
marginHeight: ["string","marginheight"],
|
|
211
|
+
marginWidth: ["string","marginwidth"],
|
|
212
|
+
name: ["string","name"],
|
|
213
|
+
referrerPolicy: ["enum","referrerpolicy","","",["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]],
|
|
214
|
+
scrolling: ["string","scrolling"],
|
|
215
|
+
src: ["string","src"],
|
|
216
|
+
srcdoc: ["string","srcdoc"],
|
|
217
|
+
width: ["string","width"],
|
|
218
|
+
},
|
|
219
|
+
img: {
|
|
220
|
+
align: ["string","align"],
|
|
221
|
+
alt: ["string","alt"],
|
|
222
|
+
border: ["string","border"],
|
|
223
|
+
decoding: ["enum","decoding","auto","auto",["sync","async","auto"]],
|
|
224
|
+
fetchPriority: ["enum","fetchpriority","auto","auto",["high","low","auto"]],
|
|
225
|
+
height: ["number","height",0],
|
|
226
|
+
hspace: ["number","hspace",0],
|
|
227
|
+
isMap: ["presence","ismap"],
|
|
228
|
+
loading: ["enum","loading","eager","eager",["eager","lazy"]],
|
|
229
|
+
longDesc: ["string","longdesc"],
|
|
230
|
+
lowsrc: ["string","lowsrc"],
|
|
231
|
+
name: ["string","name"],
|
|
232
|
+
referrerPolicy: ["enum","referrerpolicy","","",["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]],
|
|
233
|
+
sizes: ["string","sizes"],
|
|
234
|
+
src: ["string","src"],
|
|
235
|
+
srcset: ["string","srcset"],
|
|
236
|
+
useMap: ["string","usemap"],
|
|
237
|
+
vspace: ["number","vspace",0],
|
|
238
|
+
width: ["number","width",0],
|
|
239
|
+
},
|
|
240
|
+
input: {
|
|
241
|
+
accept: ["string","accept"],
|
|
242
|
+
align: ["string","align"],
|
|
243
|
+
alt: ["string","alt"],
|
|
244
|
+
autocomplete: ["enum","autocomplete","","",["on","off"]],
|
|
245
|
+
defaultChecked: ["presence","checked"],
|
|
246
|
+
defaultValue: ["string","value"],
|
|
247
|
+
dirName: ["string","dirname"],
|
|
248
|
+
disabled: ["presence","disabled"],
|
|
249
|
+
formEnctype: ["enum","formenctype","","application/x-www-form-urlencoded",["application/x-www-form-urlencoded","multipart/form-data","text/plain"]],
|
|
250
|
+
formMethod: ["enum","formmethod","","get",["get","post","dialog"]],
|
|
251
|
+
formNoValidate: ["presence","formnovalidate"],
|
|
252
|
+
formTarget: ["string","formtarget"],
|
|
253
|
+
max: ["string","max"],
|
|
254
|
+
maxLength: ["number","maxlength",-1],
|
|
255
|
+
min: ["string","min"],
|
|
256
|
+
minLength: ["number","minlength",-1],
|
|
257
|
+
multiple: ["presence","multiple"],
|
|
258
|
+
name: ["string","name"],
|
|
259
|
+
pattern: ["string","pattern"],
|
|
260
|
+
placeholder: ["string","placeholder"],
|
|
261
|
+
popoverTargetAction: ["enum","popovertargetaction","toggle","toggle",["toggle","show","hide"]],
|
|
262
|
+
readOnly: ["presence","readonly"],
|
|
263
|
+
required: ["presence","required"],
|
|
264
|
+
size: ["number","size",20],
|
|
265
|
+
src: ["string","src"],
|
|
266
|
+
step: ["string","step"],
|
|
267
|
+
type: ["enum","type","text","text",["text","password","checkbox","radio","submit","reset","button","hidden","image","file","number","range","date","month","week","time","datetime-local","email","url","search","tel","color"]],
|
|
268
|
+
useMap: ["string","usemap"],
|
|
269
|
+
webkitdirectory: ["presence","webkitdirectory"],
|
|
270
|
+
},
|
|
271
|
+
ins: {
|
|
272
|
+
cite: ["string","cite"],
|
|
273
|
+
dateTime: ["string","datetime"],
|
|
274
|
+
},
|
|
275
|
+
label: {
|
|
276
|
+
htmlFor: ["string","for"],
|
|
277
|
+
},
|
|
278
|
+
legend: {
|
|
279
|
+
align: ["string","align"],
|
|
280
|
+
},
|
|
281
|
+
li: {
|
|
282
|
+
type: ["string","type"],
|
|
283
|
+
value: ["number","value",0],
|
|
284
|
+
},
|
|
285
|
+
link: {
|
|
286
|
+
as: ["enum","as","","",["fetch","font","image","script","style","track","audio","video"]],
|
|
287
|
+
charset: ["string","charset"],
|
|
288
|
+
disabled: ["presence","disabled"],
|
|
289
|
+
fetchPriority: ["enum","fetchpriority","auto","auto",["high","low","auto"]],
|
|
290
|
+
href: ["string","href"],
|
|
291
|
+
hreflang: ["string","hreflang"],
|
|
292
|
+
imageSizes: ["string","imagesizes"],
|
|
293
|
+
imageSrcset: ["string","imagesrcset"],
|
|
294
|
+
integrity: ["string","integrity"],
|
|
295
|
+
media: ["string","media"],
|
|
296
|
+
referrerPolicy: ["enum","referrerpolicy","","",["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]],
|
|
297
|
+
rel: ["string","rel"],
|
|
298
|
+
rev: ["string","rev"],
|
|
299
|
+
target: ["string","target"],
|
|
300
|
+
type: ["string","type"],
|
|
301
|
+
},
|
|
302
|
+
map: {
|
|
303
|
+
name: ["string","name"],
|
|
304
|
+
},
|
|
305
|
+
menu: {
|
|
306
|
+
compact: ["presence","compact"],
|
|
307
|
+
},
|
|
308
|
+
meta: {
|
|
309
|
+
content: ["string","content"],
|
|
310
|
+
httpEquiv: ["string","http-equiv"],
|
|
311
|
+
media: ["string","media"],
|
|
312
|
+
name: ["string","name"],
|
|
313
|
+
scheme: ["string","scheme"],
|
|
314
|
+
},
|
|
315
|
+
meter: {
|
|
316
|
+
max: ["number","max",1],
|
|
317
|
+
min: ["number","min",0],
|
|
318
|
+
},
|
|
319
|
+
object: {
|
|
320
|
+
align: ["string","align"],
|
|
321
|
+
archive: ["string","archive"],
|
|
322
|
+
border: ["string","border"],
|
|
323
|
+
code: ["string","code"],
|
|
324
|
+
codeBase: ["string","codebase"],
|
|
325
|
+
codeType: ["string","codetype"],
|
|
326
|
+
data: ["string","data"],
|
|
327
|
+
declare: ["presence","declare"],
|
|
328
|
+
height: ["string","height"],
|
|
329
|
+
hspace: ["number","hspace",0],
|
|
330
|
+
name: ["string","name"],
|
|
331
|
+
standby: ["string","standby"],
|
|
332
|
+
type: ["string","type"],
|
|
333
|
+
useMap: ["string","usemap"],
|
|
334
|
+
vspace: ["number","vspace",0],
|
|
335
|
+
width: ["string","width"],
|
|
336
|
+
},
|
|
337
|
+
ol: {
|
|
338
|
+
compact: ["presence","compact"],
|
|
339
|
+
reversed: ["presence","reversed"],
|
|
340
|
+
start: ["number","start",1],
|
|
341
|
+
type: ["string","type"],
|
|
342
|
+
},
|
|
343
|
+
optgroup: {
|
|
344
|
+
disabled: ["presence","disabled"],
|
|
345
|
+
label: ["string","label"],
|
|
346
|
+
},
|
|
347
|
+
option: {
|
|
348
|
+
defaultSelected: ["presence","selected"],
|
|
349
|
+
disabled: ["presence","disabled"],
|
|
350
|
+
label: ["string","label"],
|
|
351
|
+
value: ["string","value"],
|
|
352
|
+
},
|
|
353
|
+
output: {
|
|
354
|
+
name: ["string","name"],
|
|
355
|
+
},
|
|
356
|
+
p: {
|
|
357
|
+
align: ["string","align"],
|
|
358
|
+
},
|
|
359
|
+
param: {
|
|
360
|
+
name: ["string","name"],
|
|
361
|
+
type: ["string","type"],
|
|
362
|
+
value: ["string","value"],
|
|
363
|
+
valueType: ["string","valuetype"],
|
|
364
|
+
},
|
|
365
|
+
pre: {
|
|
366
|
+
width: ["number","width",0],
|
|
367
|
+
},
|
|
368
|
+
progress: {
|
|
369
|
+
max: ["number","max",1],
|
|
370
|
+
},
|
|
371
|
+
q: {
|
|
372
|
+
cite: ["string","cite"],
|
|
373
|
+
},
|
|
374
|
+
script: {
|
|
375
|
+
async: ["presence","async",true],
|
|
376
|
+
charset: ["string","charset"],
|
|
377
|
+
defer: ["presence","defer"],
|
|
378
|
+
event: ["string","event"],
|
|
379
|
+
fetchPriority: ["enum","fetchpriority","auto","auto",["high","low","auto"]],
|
|
380
|
+
htmlFor: ["string","for"],
|
|
381
|
+
integrity: ["string","integrity"],
|
|
382
|
+
noModule: ["presence","nomodule"],
|
|
383
|
+
referrerPolicy: ["enum","referrerpolicy","","",["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]],
|
|
384
|
+
src: ["string","src"],
|
|
385
|
+
type: ["string","type"],
|
|
386
|
+
},
|
|
387
|
+
select: {
|
|
388
|
+
autocomplete: ["enum","autocomplete","","",["on","off"]],
|
|
389
|
+
disabled: ["presence","disabled"],
|
|
390
|
+
multiple: ["presence","multiple"],
|
|
391
|
+
name: ["string","name"],
|
|
392
|
+
required: ["presence","required"],
|
|
393
|
+
size: ["number","size",0],
|
|
394
|
+
},
|
|
395
|
+
slot: {
|
|
396
|
+
name: ["string","name"],
|
|
397
|
+
},
|
|
398
|
+
source: {
|
|
399
|
+
height: ["number","height",0],
|
|
400
|
+
media: ["string","media"],
|
|
401
|
+
sizes: ["string","sizes"],
|
|
402
|
+
src: ["string","src"],
|
|
403
|
+
srcset: ["string","srcset"],
|
|
404
|
+
type: ["string","type"],
|
|
405
|
+
width: ["number","width",0],
|
|
406
|
+
},
|
|
407
|
+
style: {
|
|
408
|
+
media: ["string","media"],
|
|
409
|
+
type: ["string","type"],
|
|
410
|
+
},
|
|
411
|
+
table: {
|
|
412
|
+
align: ["string","align"],
|
|
413
|
+
bgColor: ["string","bgcolor"],
|
|
414
|
+
border: ["string","border"],
|
|
415
|
+
cellPadding: ["string","cellpadding"],
|
|
416
|
+
cellSpacing: ["string","cellspacing"],
|
|
417
|
+
frame: ["string","frame"],
|
|
418
|
+
rules: ["string","rules"],
|
|
419
|
+
summary: ["string","summary"],
|
|
420
|
+
width: ["string","width"],
|
|
421
|
+
},
|
|
422
|
+
tbody: {
|
|
423
|
+
align: ["string","align"],
|
|
424
|
+
ch: ["string","char"],
|
|
425
|
+
chOff: ["string","charoff"],
|
|
426
|
+
vAlign: ["string","valign"],
|
|
427
|
+
},
|
|
428
|
+
td: {
|
|
429
|
+
abbr: ["string","abbr"],
|
|
430
|
+
align: ["string","align"],
|
|
431
|
+
axis: ["string","axis"],
|
|
432
|
+
bgColor: ["string","bgcolor"],
|
|
433
|
+
ch: ["string","char"],
|
|
434
|
+
chOff: ["string","charoff"],
|
|
435
|
+
colSpan: ["number","colspan",1],
|
|
436
|
+
headers: ["string","headers"],
|
|
437
|
+
height: ["string","height"],
|
|
438
|
+
noWrap: ["presence","nowrap"],
|
|
439
|
+
rowSpan: ["number","rowspan",1],
|
|
440
|
+
scope: ["enum","scope","","",["row","col","rowgroup","colgroup"]],
|
|
441
|
+
vAlign: ["string","valign"],
|
|
442
|
+
width: ["string","width"],
|
|
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","shadowrootmode","","",["open","closed"]],
|
|
452
|
+
shadowRootClonable: ["presence","shadowrootclonable"],
|
|
453
|
+
shadowRootDelegatesFocus: ["presence","shadowrootdelegatesfocus"],
|
|
454
|
+
shadowRootSerializable: ["presence","shadowrootserializable"],
|
|
455
|
+
},
|
|
456
|
+
textarea: {
|
|
457
|
+
autocomplete: ["enum","autocomplete","","",["on","off"]],
|
|
458
|
+
cols: ["number","cols",20],
|
|
459
|
+
dirName: ["string","dirname"],
|
|
460
|
+
disabled: ["presence","disabled"],
|
|
461
|
+
maxLength: ["number","maxlength",-1],
|
|
462
|
+
minLength: ["number","minlength",-1],
|
|
463
|
+
name: ["string","name"],
|
|
464
|
+
placeholder: ["string","placeholder"],
|
|
465
|
+
readOnly: ["presence","readonly"],
|
|
466
|
+
required: ["presence","required"],
|
|
467
|
+
rows: ["number","rows",2],
|
|
468
|
+
wrap: ["string","wrap"],
|
|
469
|
+
},
|
|
470
|
+
tfoot: {
|
|
471
|
+
align: ["string","align"],
|
|
472
|
+
ch: ["string","char"],
|
|
473
|
+
chOff: ["string","charoff"],
|
|
474
|
+
vAlign: ["string","valign"],
|
|
475
|
+
},
|
|
476
|
+
th: {
|
|
477
|
+
abbr: ["string","abbr"],
|
|
478
|
+
align: ["string","align"],
|
|
479
|
+
axis: ["string","axis"],
|
|
480
|
+
bgColor: ["string","bgcolor"],
|
|
481
|
+
ch: ["string","char"],
|
|
482
|
+
chOff: ["string","charoff"],
|
|
483
|
+
colSpan: ["number","colspan",1],
|
|
484
|
+
headers: ["string","headers"],
|
|
485
|
+
height: ["string","height"],
|
|
486
|
+
noWrap: ["presence","nowrap"],
|
|
487
|
+
rowSpan: ["number","rowspan",1],
|
|
488
|
+
scope: ["enum","scope","","",["row","col","rowgroup","colgroup"]],
|
|
489
|
+
vAlign: ["string","valign"],
|
|
490
|
+
width: ["string","width"],
|
|
491
|
+
},
|
|
492
|
+
thead: {
|
|
493
|
+
align: ["string","align"],
|
|
494
|
+
ch: ["string","char"],
|
|
495
|
+
chOff: ["string","charoff"],
|
|
496
|
+
vAlign: ["string","valign"],
|
|
497
|
+
},
|
|
498
|
+
time: {
|
|
499
|
+
dateTime: ["string","datetime"],
|
|
500
|
+
},
|
|
501
|
+
tr: {
|
|
502
|
+
align: ["string","align"],
|
|
503
|
+
bgColor: ["string","bgcolor"],
|
|
504
|
+
ch: ["string","char"],
|
|
505
|
+
chOff: ["string","charoff"],
|
|
506
|
+
vAlign: ["string","valign"],
|
|
507
|
+
},
|
|
508
|
+
track: {
|
|
509
|
+
default: ["presence","default"],
|
|
510
|
+
kind: ["enum","kind","subtitles","metadata",["subtitles","captions","descriptions","chapters","metadata"]],
|
|
511
|
+
label: ["string","label"],
|
|
512
|
+
src: ["string","src"],
|
|
513
|
+
srclang: ["string","srclang"],
|
|
514
|
+
},
|
|
515
|
+
ul: {
|
|
516
|
+
compact: ["presence","compact"],
|
|
517
|
+
type: ["string","type"],
|
|
518
|
+
},
|
|
519
|
+
video: {
|
|
520
|
+
disablePictureInPicture: ["presence","disablepictureinpicture"],
|
|
521
|
+
height: ["number","height",0],
|
|
522
|
+
poster: ["string","poster"],
|
|
523
|
+
width: ["number","width",0],
|
|
524
|
+
},
|
|
525
|
+
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* The four properties a browser deliberately does **not** reflect, and which this DOM does anyway.
|
|
530
|
+
*
|
|
531
|
+
* `input.value`, `input.checked`, `option.selected` and `textarea.value` carry a "dirty value" in
|
|
532
|
+
* the platform: assigning one changes what the control shows without touching the markup, so that a
|
|
533
|
+
* reload restores what the author wrote. Copying that exactly would be wrong here for a reason that
|
|
534
|
+
* has nothing to do with fidelity — **on a server the markup is the whole output**, so an assignment
|
|
535
|
+
* the markup cannot carry is an assignment that is silently lost.
|
|
536
|
+
*
|
|
537
|
+
* `@verajs/ssr` had already made this call for template bindings: `serializer.js` mirrors
|
|
538
|
+
* `.value`/`.checked`/`.selected` to attributes on form elements "so hydration can read form state
|
|
539
|
+
* back out of the markup". Doing it here too is that same rule applied to the other way of writing
|
|
540
|
+
* the same thing — a property assignment in `connectedCallback` now behaves like the binding, rather
|
|
541
|
+
* than being the one path that quietly drops the value.
|
|
542
|
+
*
|
|
543
|
+
* The reads follow the platform exactly: absent means `''` or `false`, `textarea.value` is its
|
|
544
|
+
* content, and `select.value` is the value of the option that is selected.
|
|
545
|
+
*/
|
|
546
|
+
/**
|
|
547
|
+
* **`[LegacyNullToEmptyString]`** — a handful of IDL string attributes store `''` for `null` rather
|
|
548
|
+
* than the word `"null"`, and `input.value`, `textarea.value` and `innerHTML` are three of them.
|
|
549
|
+
*
|
|
550
|
+
* This is the same defect the README already records as found and fixed: *"`textContent = null`
|
|
551
|
+
* writing the word 'null'"*. It was fixed where it was found rather than for the rule, so the other
|
|
552
|
+
* members of the class stayed wrong — the exact pattern `tests/ssr-spread-equivalence.test.mjs`
|
|
553
|
+
* opens by describing.
|
|
554
|
+
*
|
|
555
|
+
* It matters because `element.value = maybeNull` in a component is ordinary code. The server wrote
|
|
556
|
+
* `value="null"` where the client stores `''`, so the control showed the word "null" until hydration
|
|
557
|
+
* replaced it — and the surface comparison could not catch it, because that check compares a member's
|
|
558
|
+
* *shape* rather than its answer to a particular input, which the README says in as many words.
|
|
559
|
+
*
|
|
560
|
+
* `undefined` is **not** included: the platform stringifies it to `"undefined"`, and only `null` is
|
|
561
|
+
* special-cased by the extended attribute.
|
|
562
|
+
*/
|
|
563
|
+
const legacyNullToEmptyString = (value) => (value === null ? '' : `${value}`);
|
|
564
|
+
|
|
565
|
+
const FORM_STATE = {
|
|
566
|
+
input: {
|
|
567
|
+
value: {
|
|
568
|
+
get() {
|
|
569
|
+
return this.getAttribute('value') ?? '';
|
|
570
|
+
},
|
|
571
|
+
set(value) {
|
|
572
|
+
this.setAttribute('value', legacyNullToEmptyString(value));
|
|
573
|
+
},
|
|
574
|
+
},
|
|
575
|
+
checked: {
|
|
576
|
+
get() {
|
|
577
|
+
return this.hasAttribute('checked');
|
|
578
|
+
},
|
|
579
|
+
set(value) {
|
|
580
|
+
if (value) this.setAttribute('checked', '');
|
|
581
|
+
else this.removeAttribute('checked');
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
},
|
|
585
|
+
textarea: {
|
|
586
|
+
/** A `<textarea>` has no `value` attribute — its value *is* its content, in markup and here. */
|
|
587
|
+
value: {
|
|
588
|
+
get() {
|
|
589
|
+
return this.textContent;
|
|
590
|
+
},
|
|
591
|
+
set(value) {
|
|
592
|
+
this.textContent = legacyNullToEmptyString(value);
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
},
|
|
596
|
+
option: {
|
|
597
|
+
selected: {
|
|
598
|
+
get() {
|
|
599
|
+
return this.hasAttribute('selected');
|
|
600
|
+
},
|
|
601
|
+
set(value) {
|
|
602
|
+
if (value) this.setAttribute('selected', '');
|
|
603
|
+
else this.removeAttribute('selected');
|
|
604
|
+
},
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
select: {
|
|
608
|
+
/**
|
|
609
|
+
* A `<select>` has no `value` content attribute at all: its value is whichever option is
|
|
610
|
+
* selected, so reading walks the options and writing selects one. A value matching no option
|
|
611
|
+
* cannot be served — the same limitation the README records, since there is no markup for it.
|
|
612
|
+
*/
|
|
613
|
+
value: {
|
|
614
|
+
get() {
|
|
615
|
+
const options = this.querySelectorAll('option');
|
|
616
|
+
const chosen = options.find((option) => option.hasAttribute('selected')) ?? options[0];
|
|
617
|
+
return chosen === undefined ? '' : (chosen.getAttribute('value') ?? chosen.textContent);
|
|
618
|
+
},
|
|
619
|
+
set(value) {
|
|
620
|
+
const wanted = `${value}`;
|
|
621
|
+
for (const option of this.querySelectorAll('option')) {
|
|
622
|
+
const own = option.getAttribute('value') ?? option.textContent;
|
|
623
|
+
if (own === wanted) option.setAttribute('selected', '');
|
|
624
|
+
else option.removeAttribute('selected');
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
},
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
/** Per-tag constructors, built once and shared by every element of that tag. */
|
|
632
|
+
const constructors = new Map();
|
|
633
|
+
|
|
634
|
+
const define = (proto, property, accessors) =>
|
|
635
|
+
Object.defineProperty(proto, property, { ...accessors, configurable: true });
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* The constructor an element of this tag should be built with: `Base` when the tag has no interface
|
|
639
|
+
* of its own, otherwise a subclass carrying its properties.
|
|
640
|
+
*
|
|
641
|
+
* A class per tag rather than accessors on the shared prototype, because `'disabled' in paragraph`
|
|
642
|
+
* must stay `false` — an element answering for members its interface does not have is the same lie
|
|
643
|
+
* as one missing the members it does.
|
|
644
|
+
*
|
|
645
|
+
* A subclass rather than `Object.setPrototypeOf` on a finished element, which was the first shape
|
|
646
|
+
* this took. Measured over 20,000 elements, three runs each: setting the prototype afterwards cost
|
|
647
|
+
* **~745 ns** per `<input>` (and once wandered to 1004) against ~400 ns for a `<div>`; building it
|
|
648
|
+
* as its own class costs **~458 ns**. The `<div>` figure is unchanged either way, which is the part
|
|
649
|
+
* worth recording — the penalty was local to the element whose prototype was mutated, not spread
|
|
650
|
+
* across the shared path, so the first draft of this comment blamed a deopt it had not measured.
|
|
651
|
+
*/
|
|
652
|
+
export const interfaceFor = (tag, Base) => {
|
|
653
|
+
const table = ELEMENT_REFLECTIONS[tag];
|
|
654
|
+
const state = FORM_STATE[tag];
|
|
655
|
+
if (table === undefined && state === undefined) return Base;
|
|
656
|
+
const cached = constructors.get(tag);
|
|
657
|
+
if (cached !== undefined) return cached;
|
|
658
|
+
|
|
659
|
+
const Element = class extends Base {};
|
|
660
|
+
const proto = Element.prototype;
|
|
661
|
+
for (const [property, entry] of Object.entries(table ?? {})) {
|
|
662
|
+
const [kind, attribute] = entry;
|
|
663
|
+
if (kind === 'presence') {
|
|
664
|
+
const absent = entry[2] ?? false;
|
|
665
|
+
define(proto, property, {
|
|
666
|
+
get() {
|
|
667
|
+
return this.hasAttribute(attribute) ? true : absent;
|
|
668
|
+
},
|
|
669
|
+
set(value) {
|
|
670
|
+
if (value) this.setAttribute(attribute, '');
|
|
671
|
+
else this.removeAttribute(attribute);
|
|
672
|
+
},
|
|
673
|
+
});
|
|
674
|
+
} else if (kind === 'string') {
|
|
675
|
+
define(proto, property, {
|
|
676
|
+
get() {
|
|
677
|
+
return this.getAttribute(attribute) ?? '';
|
|
678
|
+
},
|
|
679
|
+
set(value) {
|
|
680
|
+
this.setAttribute(attribute, `${value}`);
|
|
681
|
+
},
|
|
682
|
+
});
|
|
683
|
+
} else if (kind === 'number') {
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* **HTML's "rules for parsing integers", which `Number.parseInt` is not.**
|
|
687
|
+
*
|
|
688
|
+
* Measured against Chromium, Firefox and WebKit by `tests/browser/reflection-parsing.test.js`;
|
|
689
|
+
* `Number.parseInt(raw, 10)` diverged from all three on two inputs, and both are the shape this
|
|
690
|
+
* package's README calls its worst: the server and the client disagree about something neither of
|
|
691
|
+
* them renders, so nothing fails until a hydration mismatch surfaces somewhere else entirely.
|
|
692
|
+
*
|
|
693
|
+
* | attribute value | every engine | `parseInt` |
|
|
694
|
+
* | -------------------- | ------------ | ---------- |
|
|
695
|
+
* | `9007199254740993` | the default | 9007199254740992 |
|
|
696
|
+
* | `"\u00a05"` (NBSP) | the default | 5 |
|
|
697
|
+
*
|
|
698
|
+
* The first: the value is outside a `long`, so it is INVALID and the property answers its default —
|
|
699
|
+
* not a float that lost its last digits. The second: these rules skip ASCII whitespace only, while
|
|
700
|
+
* `parseInt` skips every Unicode space, so a non-breaking space made a value parse here that no
|
|
701
|
+
* engine accepts.
|
|
702
|
+
*/
|
|
703
|
+
const ASCII_SPACE = ' \t\n\f\r';
|
|
704
|
+
const LONG_MIN = -2147483648;
|
|
705
|
+
const LONG_MAX = 2147483647;
|
|
706
|
+
|
|
707
|
+
const parseReflectedInteger = (raw) => {
|
|
708
|
+
let i = 0;
|
|
709
|
+
while (i < raw.length && ASCII_SPACE.includes(raw[i])) i++;
|
|
710
|
+
let sign = 1;
|
|
711
|
+
if (raw[i] === '-') {
|
|
712
|
+
sign = -1;
|
|
713
|
+
i++;
|
|
714
|
+
} else if (raw[i] === '+') i++;
|
|
715
|
+
const start = i;
|
|
716
|
+
while (i < raw.length && raw[i] >= '0' && raw[i] <= '9') i++;
|
|
717
|
+
if (i === start) return null;
|
|
718
|
+
const value = sign * Number(raw.slice(start, i));
|
|
719
|
+
return value < LONG_MIN || value > LONG_MAX ? null : value;
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
const absent = entry[2];
|
|
723
|
+
define(proto, property, {
|
|
724
|
+
get() {
|
|
725
|
+
const raw = this.getAttribute(attribute);
|
|
726
|
+
if (raw === null) return absent;
|
|
727
|
+
/** A browser answers the default for anything it cannot parse, not `NaN`. */
|
|
728
|
+
const parsed = parseReflectedInteger(raw);
|
|
729
|
+
return parsed === null ? absent : parsed;
|
|
730
|
+
},
|
|
731
|
+
/**
|
|
732
|
+
* **A numeric property converts before it writes, and this wrote the value verbatim.**
|
|
733
|
+
*
|
|
734
|
+
* The platform applies the WebIDL conversion for the property's type at *assignment*, and
|
|
735
|
+
* writes the **converted** number to the attribute — not what the caller passed. Measured in
|
|
736
|
+
* Chromium across all 31 `number` reflections here, and every one shares this part:
|
|
737
|
+
*
|
|
738
|
+
* | written | attribute a browser writes | this wrote |
|
|
739
|
+
* | --- | --- | --- |
|
|
740
|
+
* | `3.9` | `"3"` | `"3.9"` |
|
|
741
|
+
* | `'probe'` | `"0"` | `"probe"` |
|
|
742
|
+
* | `''` | `"0"` | `""` |
|
|
743
|
+
*
|
|
744
|
+
* The reachable case is the first. `element.width = someComputedValue` is ordinary code, and
|
|
745
|
+
* a fractional result made the server write `width="3.9"` where the client writes `width="3"`
|
|
746
|
+
* — a hydration mismatch nobody did anything wrong to earn.
|
|
747
|
+
*
|
|
748
|
+
* **What this deliberately does not do** is the per-property part. A *negative* value is
|
|
749
|
+
* clamped to 0 by eleven of these properties, to 1 by six, refused outright by four
|
|
750
|
+
* (`maxLength`, `minLength`), allowed by two, and replaced with an element default by
|
|
751
|
+
* `canvas.width`/`height` and `input.size`. Three more (`meter.min`/`max`, `progress.max`) are
|
|
752
|
+
* `double` rather than `unsigned long` and do not truncate at all.
|
|
753
|
+
*
|
|
754
|
+
* Encoding that means thirty-one hand-classified rows in this table — which is how
|
|
755
|
+
* `area.shape`, `ol.type` and `textarea.wrap` came to answer with the probe value used to
|
|
756
|
+
* measure them. A negative width is already a caller's mistake; a fractional one is not. The
|
|
757
|
+
* thirty-one rows were classified against a measured table, kept with the project's private
|
|
758
|
+
* audits, if that trade is ever worth revisiting.
|
|
759
|
+
*/
|
|
760
|
+
set(value) {
|
|
761
|
+
const number = Number(value);
|
|
762
|
+
this.setAttribute(attribute, `${Number.isFinite(number) ? Math.trunc(number) : 0}`);
|
|
763
|
+
},
|
|
764
|
+
});
|
|
765
|
+
} else {
|
|
766
|
+
const [, , missing, invalid, states] = entry;
|
|
767
|
+
define(proto, property, {
|
|
768
|
+
get() {
|
|
769
|
+
const raw = this.getAttribute(attribute);
|
|
770
|
+
if (raw === null) return missing;
|
|
771
|
+
/** Enumerated attributes are ASCII case-insensitive and the getter answers canonically. */
|
|
772
|
+
const state = raw.toLowerCase();
|
|
773
|
+
return states.includes(state) ? state : invalid;
|
|
774
|
+
},
|
|
775
|
+
/** The setter writes what it is given; only the getter maps to a state. */
|
|
776
|
+
set(value) {
|
|
777
|
+
this.setAttribute(attribute, `${value}`);
|
|
778
|
+
},
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
for (const [property, accessors] of Object.entries(state ?? {})) define(proto, property, accessors);
|
|
783
|
+
constructors.set(tag, Element);
|
|
784
|
+
return Element;
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* **What the engines expose that this table deliberately does not**, so the next reader does not
|
|
789
|
+
* have to measure it again to find out why:
|
|
790
|
+
*
|
|
791
|
+
* - `base.href`, `form.action`, `button.formAction`, `input.formAction` — resolved against the
|
|
792
|
+
* document's URL, which a server render does not have. Answering the raw attribute would be a
|
|
793
|
+
* different value from the browser's; answering an absolute URL would require inventing an origin.
|
|
794
|
+
* - `input.width`, `input.height` — read back from layout, so a browser answers `0` for anything it
|
|
795
|
+
* has not laid out, whatever the attribute says.
|
|
796
|
+
* - `meter.value`, `meter.low`, `meter.high`, `meter.optimum`, `progress.value` — clamped against
|
|
797
|
+
* each other and against `max`, so the property is not the attribute.
|
|
798
|
+
* - `button.command` — canonicalised to `''` for anything outside its state list, which is not yet
|
|
799
|
+
* stable across engines.
|
|
800
|
+
* - Vendor extensions present in one engine only: `a.attributionSourceId` and its two neighbours,
|
|
801
|
+
* `area.hreflang`, `area.type`, `canvas.mozOpaque`, `iframe.csp`, `iframe.credentialless`,
|
|
802
|
+
* `iframe.allowPaymentRequest`, `input.incremental`, `input.alpha`, `input.colorSpace`,
|
|
803
|
+
* `input.switch`, `video.playsInline`, `video.autoPictureInPicture`,
|
|
804
|
+
* `video.webkitWirelessVideoPlaybackDisabled`.
|
|
805
|
+
*
|
|
806
|
+
* And the six where the engines disagree and the majority was taken, none of which can reach the
|
|
807
|
+
* markup: `input.type` (Chromium accepts `month` and `week`; the others do not), `link.as` (three
|
|
808
|
+
* different state lists), `img.loading` and `iframe.loading` (absent reads `auto` in Chromium and
|
|
809
|
+
* `eager` elsewhere), `button.popoverTargetAction` and `input.popoverTargetAction` (absent reads
|
|
810
|
+
* `''` in Firefox and `toggle` elsewhere).
|
|
811
|
+
*/
|