reffy 20.0.13 → 20.0.15

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.
Files changed (78) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +151 -151
  3. package/index.js +29 -29
  4. package/package.json +5 -5
  5. package/reffy.js +324 -324
  6. package/schemas/browserlib/extract-algorithms.json +52 -52
  7. package/schemas/browserlib/extract-cssdfn.json +108 -108
  8. package/schemas/browserlib/extract-dfns.json +90 -90
  9. package/schemas/browserlib/extract-elements.json +17 -17
  10. package/schemas/browserlib/extract-events.json +31 -31
  11. package/schemas/browserlib/extract-headings.json +19 -19
  12. package/schemas/browserlib/extract-ids.json +7 -7
  13. package/schemas/browserlib/extract-links.json +12 -12
  14. package/schemas/browserlib/extract-refs.json +12 -12
  15. package/schemas/common.json +876 -876
  16. package/schemas/files/extracts/algorithms.json +12 -12
  17. package/schemas/files/extracts/css.json +16 -16
  18. package/schemas/files/extracts/dfns.json +12 -12
  19. package/schemas/files/extracts/elements.json +12 -12
  20. package/schemas/files/extracts/events.json +12 -12
  21. package/schemas/files/extracts/headings.json +12 -12
  22. package/schemas/files/extracts/ids.json +12 -12
  23. package/schemas/files/extracts/links.json +12 -12
  24. package/schemas/files/extracts/refs.json +12 -12
  25. package/schemas/files/index.json +59 -59
  26. package/schemas/postprocessing/events.json +50 -50
  27. package/schemas/postprocessing/idlnames-parsed.json +27 -27
  28. package/schemas/postprocessing/idlnames.json +17 -17
  29. package/schemas/postprocessing/idlparsed.json +67 -67
  30. package/src/browserlib/clone-and-clean.mjs +24 -24
  31. package/src/browserlib/create-outline.mjs +353 -353
  32. package/src/browserlib/extract-algorithms.mjs +723 -723
  33. package/src/browserlib/extract-cddl.mjs +125 -125
  34. package/src/browserlib/extract-dfns.mjs +1093 -1093
  35. package/src/browserlib/extract-headings.mjs +76 -76
  36. package/src/browserlib/extract-ids.mjs +28 -28
  37. package/src/browserlib/extract-links.mjs +45 -45
  38. package/src/browserlib/extract-references.mjs +308 -308
  39. package/src/browserlib/extract-webidl.mjs +89 -89
  40. package/src/browserlib/get-absolute-url.mjs +29 -29
  41. package/src/browserlib/get-code-elements.mjs +20 -20
  42. package/src/browserlib/get-generator.mjs +26 -26
  43. package/src/browserlib/get-lastmodified-date.mjs +13 -13
  44. package/src/browserlib/get-revision.mjs +12 -12
  45. package/src/browserlib/get-title.mjs +14 -14
  46. package/src/browserlib/informative-selector.mjs +24 -24
  47. package/src/browserlib/map-ids-to-headings.mjs +173 -173
  48. package/src/browserlib/reffy.json +85 -85
  49. package/src/browserlib/trim-spaces.mjs +35 -35
  50. package/src/cli/check-missing-dfns.js +587 -587
  51. package/src/cli/merge-crawl-results.js +132 -132
  52. package/src/cli/parse-webidl.js +447 -447
  53. package/src/lib/css-grammar-parse-tree.schema.json +109 -109
  54. package/src/lib/css-grammar-parser.js +440 -440
  55. package/src/lib/fetch.js +51 -51
  56. package/src/lib/markdown-report.js +360 -360
  57. package/src/lib/mock-server.js +218 -218
  58. package/src/lib/post-processor.js +322 -322
  59. package/src/lib/throttled-queue.js +129 -129
  60. package/src/postprocessing/annotate-links.js +41 -41
  61. package/src/postprocessing/csscomplete.js +48 -48
  62. package/src/postprocessing/idlnames.js +391 -391
  63. package/src/postprocessing/idlparsed.js +179 -179
  64. package/src/postprocessing/patch-dfns.js +51 -51
  65. package/src/specs/missing-css-rules.json +197 -197
  66. package/src/specs/spec-equivalents.json +149 -149
  67. package/src/browserlib/extract-editors.mjs~ +0 -14
  68. package/src/browserlib/extract-events.mjs~ +0 -3
  69. package/src/browserlib/generate-es-dfn-report.sh~ +0 -4
  70. package/src/browserlib/get-revision.mjs~ +0 -7
  71. package/src/cli/csstree-grammar-check.js +0 -28
  72. package/src/cli/csstree-grammar-check.js~ +0 -10
  73. package/src/cli/csstree-grammar-parser.js +0 -11
  74. package/src/cli/csstree-grammar-parser.js~ +0 -1
  75. package/src/cli/extract-editors.js~ +0 -38
  76. package/src/cli/process-specs.js~ +0 -28
  77. package/src/postprocessing/annotate-links.js~ +0 -8
  78. package/src/postprocessing/events.js~ +0 -245
@@ -1,877 +1,877 @@
1
- {
2
- "$schema": "http://json-schema.org/schema#",
3
- "$id": "https://github.com/w3c/reffy/blob/main/schemas/common.json",
4
-
5
- "$defs": {
6
- "url": {
7
- "type": "string",
8
- "format": "url"
9
- },
10
-
11
- "title": {
12
- "type": "string",
13
- "minLength": 1
14
- },
15
-
16
- "shortname": {
17
- "type": "string",
18
- "pattern": "^[\\w\\-]+((?<=-v?\\d+)\\.\\d+)?$",
19
- "$comment": "Same definition as in browser-specs"
20
- },
21
-
22
- "specInExtract": {
23
- "type": "object",
24
- "additionalProperties": false,
25
- "properties": {
26
- "title": { "$ref": "#/$defs/title" },
27
- "url": { "$ref": "#/$defs/url" }
28
- },
29
- "required": ["title", "url"]
30
- },
31
-
32
- "cssPropertyName": {
33
- "type": "string",
34
- "minLength": 1
35
- },
36
-
37
- "cssValue": {
38
- "type": "string",
39
- "minLength": 1
40
- },
41
-
42
- "cssValues": {
43
- "type": "array",
44
- "items": {
45
- "type": "object",
46
- "required": ["name", "type"],
47
- "additionalProperties": false,
48
- "properties": {
49
- "name": { "$ref": "#/$defs/cssValue" },
50
- "type": { "type": "string", "enum": ["type", "function", "value", "selector"] },
51
- "href": { "$ref": "#/$defs/url" },
52
- "prose": { "type": "string" },
53
- "value": { "$ref": "#/$defs/cssValue" },
54
- "values": { "$ref": "#/$defs/cssValues" }
55
- }
56
- }
57
- },
58
-
59
- "interface": {
60
- "type": "string",
61
- "pattern": "^[A-Z]([A-Za-z0-9_])*$|^console$",
62
- "$comment": "console is the only interface name that starts with a lower-case character"
63
- },
64
-
65
- "interfacetype": {
66
- "type": "string",
67
- "enum": [
68
- "dictionary", "interface", "interface mixin", "enum", "typedef",
69
- "callback", "callback interface", "namespace"]
70
- },
71
-
72
- "extensiontype": {
73
- "oneOf": [
74
- { "$ref": "#/$defs/interfacetype" },
75
- { "type": "string", "const": "includes" }
76
- ]
77
- },
78
-
79
- "global": {
80
- "oneOf": [
81
- { "$ref": "#/$defs/interface" },
82
- { "type": "string", "const": "*" }
83
- ]
84
- },
85
-
86
- "id": {
87
- "type": "string",
88
- "minLength": 1
89
- },
90
-
91
- "headingNumber": {
92
- "type": "string",
93
- "pattern": "^(\\d+|[A-Z])(\\.\\d+)*$",
94
- "$comment": "Note appendices start with an upper-case A-Z character"
95
- },
96
-
97
- "interfaces": {
98
- "type": "array",
99
- "items": { "$ref": "#/$defs/interface" }
100
- },
101
-
102
- "interfacesByGlobal": {
103
- "type": "object",
104
- "propertyNames": { "$ref": "#/$defs/global" },
105
- "additionalProperties": { "$ref": "#/$defs/interfaces" }
106
- },
107
-
108
- "idlFragment": {
109
- "description": "Represents a Web IDL fragment definition.",
110
- "type": "object",
111
- "properties": {
112
- "fragment": {
113
- "description": "The raw IDL fragment.",
114
- "type": "string",
115
- "minLength": 1
116
- },
117
- "type": {
118
- "description": "The type of the IDL definition.",
119
- "$ref": "#/$defs/extensiontype"
120
- },
121
- "name": {
122
- "description": "The name of the IDL definition.",
123
- "type": "string",
124
- "minLength": 1
125
- },
126
- "target": {
127
- "description": "The target of an includes statement.",
128
- "type": "string",
129
- "minLength": 1
130
- },
131
- "includes": {
132
- "description": "The module that is included.",
133
- "type": "string",
134
- "minLength": 1
135
- },
136
- "inheritance": {
137
- "description": "The name of the inherited interface, if any.",
138
- "type": [
139
- "string",
140
- "null"
141
- ]
142
- },
143
- "members": {
144
- "description": "A list of members of the IDL definition.",
145
- "type": "array",
146
- "items": {
147
- "$ref": "#/$defs/idlMember"
148
- }
149
- },
150
- "idlType": {
151
- "$ref": "#/$defs/idlType"
152
- },
153
- "arguments": {
154
- "type": "array",
155
- "items": {
156
- "$ref": "#/$defs/argument"
157
- }
158
- },
159
- "extAttrs": {
160
- "description": "A list of extended attributes.",
161
- "type": "array",
162
- "items": {
163
- "$ref": "#/$defs/extendedAttribute"
164
- }
165
- },
166
- "partial": {
167
- "description": "Whether the definition is partial.",
168
- "type": "boolean"
169
- },
170
- "href": {
171
- "description": "The URL to the definition.",
172
- "type": "string"
173
- }
174
- },
175
- "required": [
176
- "fragment",
177
- "type",
178
- "extAttrs"
179
- ]
180
- },
181
-
182
- "idlFragmentInSpec": {
183
- "type": "object",
184
- "additionalProperties": false,
185
- "required": ["spec", "fragment"],
186
- "properties": {
187
- "spec": { "$ref": "#/$defs/specInExtract" },
188
- "fragment": { "type": "string" },
189
- "href": { "$ref": "#/$defs/url" }
190
- }
191
- },
192
-
193
- "references": {
194
- "type": "array",
195
- "items": {
196
- "type": "object",
197
- "additionalProperties": false,
198
- "required": ["name"],
199
- "properties": {
200
- "name": { "type": "string", "minLength": 1 },
201
- "url": { "$ref": "#/$defs/url" }
202
- }
203
- }
204
- },
205
-
206
- "links": {
207
- "type": "object",
208
- "propertyNames": { "$ref": "#/$defs/url" },
209
- "additionalProperties": {
210
- "type": "object",
211
- "additionalProperties": false,
212
- "properties": {
213
- "anchors": {
214
- "type": "array",
215
- "items": { "$ref": "#/$defs/id" },
216
- "minItems": 1
217
- },
218
- "specShortname": { "$ref": "#/$defs/shortname" }
219
- }
220
- }
221
- },
222
-
223
- "idlType": {
224
- "description": "Represents a WebIDL type.",
225
- "type": "object",
226
- "properties": {
227
- "type": {
228
- "description": "The type of the IDL type.",
229
- "type": [
230
- "string",
231
- "null"
232
- ],
233
- "enum": [
234
- "argument-type",
235
- "attribute-type",
236
- "return-type",
237
- "const-type",
238
- "dictionary-type",
239
- "field-type",
240
- "typedef-type",
241
- null
242
- ]
243
- },
244
- "extAttrs": {
245
- "description": "A list of extended attributes.",
246
- "type": "array",
247
- "items": {
248
- "$ref": "#/$defs/extendedAttribute"
249
- }
250
- },
251
- "generic": {
252
- "description": "The type of a parameterized type, if any.",
253
- "type": "string",
254
- "enum": [
255
- "",
256
- "FrozenArray",
257
- "ObservableArray",
258
- "Promise",
259
- "record",
260
- "sequence",
261
- "async_sequence"
262
- ]
263
- },
264
- "nullable": {
265
- "description": "Whether the type is nullable.",
266
- "type": "boolean"
267
- },
268
- "union": {
269
- "description": "Whether the type is a union type.",
270
- "type": "boolean"
271
- },
272
- "idlType": {
273
- "description": "The inner IDL type. Can be a string or an array of idlType objects for union or parameterized types.",
274
- "oneOf": [
275
- {
276
- "type": "string"
277
- },
278
- {
279
- "type": "array",
280
- "items": {
281
- "$ref": "#/$defs/idlType"
282
- }
283
- }
284
- ]
285
- }
286
- },
287
- "required": [
288
- "type",
289
- "extAttrs",
290
- "generic",
291
- "nullable",
292
- "union",
293
- "idlType"
294
- ]
295
- },
296
- "extendedAttribute": {
297
- "description": "Represents a WebIDL extended attribute.",
298
- "type": "object",
299
- "properties": {
300
- "type": {
301
- "type": "string",
302
- "enum": [
303
- "extended-attribute"
304
- ]
305
- },
306
- "name": {
307
- "description": "The name of the extended attribute.",
308
- "type": "string"
309
- },
310
- "rhs": {
311
- "description": "The right-hand side of the extended attribute, if applicable.",
312
- "type": [
313
- "object",
314
- "null"
315
- ]
316
- },
317
- "arguments": {
318
- "description": "A list of arguments for the extended attribute.",
319
- "type": "array"
320
- }
321
- },
322
- "required": [
323
- "type",
324
- "name",
325
- "rhs",
326
- "arguments"
327
- ]
328
- },
329
- "argument": {
330
- "description": "Represents an argument to a WebIDL operation or constructor.",
331
- "type": "object",
332
- "properties": {
333
- "type": {
334
- "const": "argument"
335
- },
336
- "name": {
337
- "description": "The name of the argument.",
338
- "type": "string"
339
- },
340
- "extAttrs": {
341
- "description": "A list of extended attributes.",
342
- "type": "array",
343
- "items": {
344
- "$ref": "#/$defs/extendedAttribute"
345
- }
346
- },
347
- "idlType": {
348
- "$ref": "#/$defs/idlType"
349
- },
350
- "default": {
351
- "$ref": "#/$defs/defaultValue"
352
- },
353
- "optional": {
354
- "description": "Whether the argument is optional.",
355
- "type": "boolean"
356
- },
357
- "variadic": {
358
- "description": "Whether the argument is variadic.",
359
- "type": "boolean"
360
- }
361
- },
362
- "required": [
363
- "type",
364
- "name",
365
- "extAttrs",
366
- "idlType",
367
- "default",
368
- "optional",
369
- "variadic"
370
- ]
371
- },
372
- "idlMember": {
373
- "description": "Represents a member of a WebIDL interface, dictionary, etc.",
374
- "oneOf": [
375
- {
376
- "$ref": "#/$defs/constructorMember"
377
- },
378
- {
379
- "$ref": "#/$defs/attributeMember"
380
- },
381
- {
382
- "$ref": "#/$defs/operationMember"
383
- },
384
- {
385
- "$ref": "#/$defs/constMember"
386
- },
387
- {
388
- "$ref": "#/$defs/fieldMember"
389
- },
390
- {
391
- "$ref": "#/$defs/iterableMember"
392
- },
393
- {
394
- "$ref": "#/$defs/setlikeMember"
395
- },
396
- {
397
- "$ref": "#/$defs/maplikeMember"
398
- },
399
- {
400
- "$ref": "#/$defs/asyncIterableMember"
401
- }
402
- ]
403
- },
404
- "constructorMember": {
405
- "type": "object",
406
- "properties": {
407
- "type": {
408
- "const": "constructor"
409
- },
410
- "arguments": {
411
- "description": "A list of arguments for the constructor.",
412
- "type": "array",
413
- "items": {
414
- "$ref": "#/$defs/argument"
415
- }
416
- },
417
- "extAttrs": {
418
- "description": "A list of extended attributes.",
419
- "type": "array",
420
- "items": {
421
- "$ref": "#/$defs/extendedAttribute"
422
- }
423
- },
424
- "href": {
425
- "description": "The URL to the definition of the constructor.",
426
- "type": "string"
427
- }
428
- },
429
- "required": [
430
- "type",
431
- "arguments",
432
- "extAttrs"
433
- ]
434
- },
435
- "attributeMember": {
436
- "type": "object",
437
- "properties": {
438
- "type": {
439
- "const": "attribute"
440
- },
441
- "name": {
442
- "description": "The name of the attribute.",
443
- "type": "string"
444
- },
445
- "idlType": {
446
- "$ref": "#/$defs/idlType"
447
- },
448
- "extAttrs": {
449
- "description": "A list of extended attributes.",
450
- "type": "array",
451
- "items": {
452
- "$ref": "#/$defs/extendedAttribute"
453
- }
454
- },
455
- "special": {
456
- "description": "The special property of the attribute (e.g., 'static').",
457
- "type": "string",
458
- "enum": [
459
- "",
460
- "inherit",
461
- "static",
462
- "stringifier"
463
- ]
464
- },
465
- "readonly": {
466
- "description": "Whether the attribute is read-only.",
467
- "type": "boolean"
468
- },
469
- "href": {
470
- "description": "The URL to the definition of the attribute.",
471
- "type": "string"
472
- }
473
- },
474
- "required": [
475
- "type",
476
- "name",
477
- "idlType",
478
- "extAttrs",
479
- "special"
480
- ]
481
- },
482
- "operationMember": {
483
- "type": "object",
484
- "properties": {
485
- "type": {
486
- "const": "operation"
487
- },
488
- "name": {
489
- "description": "The name of the operation.",
490
- "type": "string"
491
- },
492
- "idlType": {
493
- "$ref": "#/$defs/idlType"
494
- },
495
- "arguments": {
496
- "description": "A list of arguments for the operation.",
497
- "type": "array",
498
- "items": {
499
- "$ref": "#/$defs/argument"
500
- }
501
- },
502
- "extAttrs": {
503
- "description": "A list of extended attributes.",
504
- "type": "array",
505
- "items": {
506
- "$ref": "#/$defs/extendedAttribute"
507
- }
508
- },
509
- "special": {
510
- "description": "The special property of the operation (e.g., 'static').",
511
- "type": "string",
512
- "enum": [
513
- "",
514
- "deleter",
515
- "getter",
516
- "setter",
517
- "static",
518
- "stringifier"
519
- ]
520
- },
521
- "readonly": {
522
- "description": "Whether the operation is read-only.",
523
- "type": "boolean"
524
- },
525
- "href": {
526
- "description": "The URL to the definition of the operation.",
527
- "type": "string"
528
- }
529
- },
530
- "required": [
531
- "type",
532
- "name",
533
- "arguments",
534
- "extAttrs",
535
- "special"
536
- ]
537
- },
538
- "constMember": {
539
- "type": "object",
540
- "properties": {
541
- "type": {
542
- "const": "const"
543
- },
544
- "name": {
545
- "description": "The name of the constant.",
546
- "type": "string"
547
- },
548
- "idlType": {
549
- "$ref": "#/$defs/idlType"
550
- },
551
- "extAttrs": {
552
- "description": "A list of extended attributes.",
553
- "type": "array",
554
- "items": {
555
- "$ref": "#/$defs/extendedAttribute"
556
- }
557
- },
558
- "value": {
559
- "description": "The value of the constant.",
560
- "type": "object"
561
- },
562
- "href": {
563
- "description": "The URL to the definition of the constant.",
564
- "type": "string"
565
- }
566
- },
567
- "required": [
568
- "type",
569
- "name",
570
- "idlType",
571
- "extAttrs",
572
- "value"
573
- ]
574
- },
575
- "fieldMember": {
576
- "type": "object",
577
- "properties": {
578
- "type": {
579
- "const": "field"
580
- },
581
- "name": {
582
- "description": "The name of the field.",
583
- "type": "string"
584
- },
585
- "extAttrs": {
586
- "description": "A list of extended attributes.",
587
- "type": "array",
588
- "items": {
589
- "$ref": "#/$defs/extendedAttribute"
590
- }
591
- },
592
- "idlType": {
593
- "$ref": "#/$defs/idlType"
594
- },
595
- "default": {
596
- "$ref": "#/$defs/defaultValue"
597
- },
598
- "required": {
599
- "description": "Whether the field is required.",
600
- "type": "boolean"
601
- },
602
- "href": {
603
- "description": "The URL to the definition of the field.",
604
- "type": "string"
605
- }
606
- },
607
- "required": [
608
- "type",
609
- "name",
610
- "extAttrs",
611
- "idlType",
612
- "default",
613
- "required"
614
- ]
615
- },
616
- "iterableMember": {
617
- "type": "object",
618
- "properties": {
619
- "type": {
620
- "const": "iterable"
621
- },
622
- "idlType": {
623
- "type": "array",
624
- "items": {
625
- "$ref": "#/$defs/idlType"
626
- }
627
- },
628
- "arguments": {
629
- "type": "array",
630
- "items": {
631
- "$ref": "#/$defs/argument"
632
- }
633
- },
634
- "extAttrs": {
635
- "type": "array",
636
- "items": {
637
- "$ref": "#/$defs/extendedAttribute"
638
- }
639
- },
640
- "readonly": {
641
- "type": "boolean"
642
- },
643
- "async": {
644
- "type": "boolean"
645
- }
646
- },
647
- "required": [
648
- "type",
649
- "idlType",
650
- "arguments",
651
- "extAttrs",
652
- "readonly",
653
- "async"
654
- ]
655
- },
656
- "setlikeMember": {
657
- "type": "object",
658
- "properties": {
659
- "type": {
660
- "const": "setlike"
661
- },
662
- "idlType": {
663
- "type": "array",
664
- "items": {
665
- "$ref": "#/$defs/idlType"
666
- }
667
- },
668
- "arguments": {
669
- "type": "array",
670
- "items": {
671
- "$ref": "#/$defs/argument"
672
- }
673
- },
674
- "extAttrs": {
675
- "type": "array",
676
- "items": {
677
- "$ref": "#/$defs/extendedAttribute"
678
- }
679
- },
680
- "readonly": {
681
- "type": "boolean"
682
- },
683
- "async": {
684
- "type": "boolean"
685
- }
686
- },
687
- "required": [
688
- "type",
689
- "idlType",
690
- "arguments",
691
- "extAttrs",
692
- "readonly",
693
- "async"
694
- ]
695
- },
696
- "maplikeMember": {
697
- "type": "object",
698
- "properties": {
699
- "type": {
700
- "const": "maplike"
701
- },
702
- "idlType": {
703
- "type": "array",
704
- "items": {
705
- "$ref": "#/$defs/idlType"
706
- }
707
- },
708
- "arguments": {
709
- "type": "array",
710
- "items": {
711
- "$ref": "#/$defs/argument"
712
- }
713
- },
714
- "extAttrs": {
715
- "type": "array",
716
- "items": {
717
- "$ref": "#/$defs/extendedAttribute"
718
- }
719
- },
720
- "readonly": {
721
- "type": "boolean"
722
- },
723
- "async": {
724
- "type": "boolean"
725
- }
726
- },
727
- "required": [
728
- "type",
729
- "idlType",
730
- "arguments",
731
- "extAttrs",
732
- "readonly",
733
- "async"
734
- ]
735
- },
736
- "asyncIterableMember": {
737
- "type": "object",
738
- "properties": {
739
- "type": {
740
- "const": "async_iterable"
741
- },
742
- "idlType": {
743
- "type": "array",
744
- "items": {
745
- "$ref": "#/$defs/idlType"
746
- }
747
- },
748
- "arguments": {
749
- "type": "array",
750
- "items": {
751
- "$ref": "#/$defs/argument"
752
- }
753
- },
754
- "extAttrs": {
755
- "type": "array",
756
- "items": {
757
- "$ref": "#/$defs/extendedAttribute"
758
- }
759
- },
760
- "readonly": {
761
- "type": "boolean"
762
- },
763
- "async": {
764
- "type": "boolean"
765
- }
766
- },
767
- "required": [
768
- "type",
769
- "idlType",
770
- "arguments",
771
- "extAttrs",
772
- "readonly",
773
- "async"
774
- ]
775
- },
776
- "defaultValue": {
777
- "oneOf": [
778
- {
779
- "type": "null"
780
- },
781
- {
782
- "type": "object",
783
- "properties": {
784
- "type": {
785
- "const": "string"
786
- },
787
- "value": {
788
- "type": "string"
789
- }
790
- },
791
- "required": [
792
- "type",
793
- "value"
794
- ],
795
- "additionalProperties": false
796
- },
797
- {
798
- "type": "object",
799
- "properties": {
800
- "type": {
801
- "const": "number"
802
- },
803
- "value": {
804
- "type": [
805
- "number",
806
- "string"
807
- ]
808
- }
809
- },
810
- "required": [
811
- "type",
812
- "value"
813
- ],
814
- "additionalProperties": false
815
- },
816
- {
817
- "type": "object",
818
- "properties": {
819
- "type": {
820
- "const": "boolean"
821
- },
822
- "value": {
823
- "type": "boolean"
824
- }
825
- },
826
- "required": [
827
- "type",
828
- "value"
829
- ],
830
- "additionalProperties": false
831
- },
832
- {
833
- "type": "object",
834
- "properties": {
835
- "type": {
836
- "const": "dictionary"
837
- },
838
- "value": {
839
- "type": "object"
840
- }
841
- },
842
- "required": [
843
- "type"
844
- ],
845
- "additionalProperties": false
846
- },
847
- {
848
- "type": "object",
849
- "properties": {
850
- "type": {
851
- "const": "sequence"
852
- },
853
- "value": {
854
- "type": "array"
855
- }
856
- },
857
- "required": [
858
- "type"
859
- ],
860
- "additionalProperties": false
861
- },
862
- {
863
- "type": "object",
864
- "properties": {
865
- "type": {
866
- "const": "null"
867
- }
868
- },
869
- "required": [
870
- "type"
871
- ],
872
- "additionalProperties": false
873
- }
874
- ]
875
- }
876
- }
1
+ {
2
+ "$schema": "http://json-schema.org/schema#",
3
+ "$id": "https://github.com/w3c/reffy/blob/main/schemas/common.json",
4
+
5
+ "$defs": {
6
+ "url": {
7
+ "type": "string",
8
+ "format": "url"
9
+ },
10
+
11
+ "title": {
12
+ "type": "string",
13
+ "minLength": 1
14
+ },
15
+
16
+ "shortname": {
17
+ "type": "string",
18
+ "pattern": "^[\\w\\-]+((?<=-v?\\d+)\\.\\d+)?$",
19
+ "$comment": "Same definition as in browser-specs"
20
+ },
21
+
22
+ "specInExtract": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "properties": {
26
+ "title": { "$ref": "#/$defs/title" },
27
+ "url": { "$ref": "#/$defs/url" }
28
+ },
29
+ "required": ["title", "url"]
30
+ },
31
+
32
+ "cssPropertyName": {
33
+ "type": "string",
34
+ "minLength": 1
35
+ },
36
+
37
+ "cssValue": {
38
+ "type": "string",
39
+ "minLength": 1
40
+ },
41
+
42
+ "cssValues": {
43
+ "type": "array",
44
+ "items": {
45
+ "type": "object",
46
+ "required": ["name", "type"],
47
+ "additionalProperties": false,
48
+ "properties": {
49
+ "name": { "$ref": "#/$defs/cssValue" },
50
+ "type": { "type": "string", "enum": ["type", "function", "value", "selector"] },
51
+ "href": { "$ref": "#/$defs/url" },
52
+ "prose": { "type": "string" },
53
+ "value": { "$ref": "#/$defs/cssValue" },
54
+ "values": { "$ref": "#/$defs/cssValues" }
55
+ }
56
+ }
57
+ },
58
+
59
+ "interface": {
60
+ "type": "string",
61
+ "pattern": "^[A-Z]([A-Za-z0-9_])*$|^console$",
62
+ "$comment": "console is the only interface name that starts with a lower-case character"
63
+ },
64
+
65
+ "interfacetype": {
66
+ "type": "string",
67
+ "enum": [
68
+ "dictionary", "interface", "interface mixin", "enum", "typedef",
69
+ "callback", "callback interface", "namespace"]
70
+ },
71
+
72
+ "extensiontype": {
73
+ "oneOf": [
74
+ { "$ref": "#/$defs/interfacetype" },
75
+ { "type": "string", "const": "includes" }
76
+ ]
77
+ },
78
+
79
+ "global": {
80
+ "oneOf": [
81
+ { "$ref": "#/$defs/interface" },
82
+ { "type": "string", "const": "*" }
83
+ ]
84
+ },
85
+
86
+ "id": {
87
+ "type": "string",
88
+ "minLength": 1
89
+ },
90
+
91
+ "headingNumber": {
92
+ "type": "string",
93
+ "pattern": "^(\\d+|[A-Z])(\\.\\d+)*$",
94
+ "$comment": "Note appendices start with an upper-case A-Z character"
95
+ },
96
+
97
+ "interfaces": {
98
+ "type": "array",
99
+ "items": { "$ref": "#/$defs/interface" }
100
+ },
101
+
102
+ "interfacesByGlobal": {
103
+ "type": "object",
104
+ "propertyNames": { "$ref": "#/$defs/global" },
105
+ "additionalProperties": { "$ref": "#/$defs/interfaces" }
106
+ },
107
+
108
+ "idlFragment": {
109
+ "description": "Represents a Web IDL fragment definition.",
110
+ "type": "object",
111
+ "properties": {
112
+ "fragment": {
113
+ "description": "The raw IDL fragment.",
114
+ "type": "string",
115
+ "minLength": 1
116
+ },
117
+ "type": {
118
+ "description": "The type of the IDL definition.",
119
+ "$ref": "#/$defs/extensiontype"
120
+ },
121
+ "name": {
122
+ "description": "The name of the IDL definition.",
123
+ "type": "string",
124
+ "minLength": 1
125
+ },
126
+ "target": {
127
+ "description": "The target of an includes statement.",
128
+ "type": "string",
129
+ "minLength": 1
130
+ },
131
+ "includes": {
132
+ "description": "The module that is included.",
133
+ "type": "string",
134
+ "minLength": 1
135
+ },
136
+ "inheritance": {
137
+ "description": "The name of the inherited interface, if any.",
138
+ "type": [
139
+ "string",
140
+ "null"
141
+ ]
142
+ },
143
+ "members": {
144
+ "description": "A list of members of the IDL definition.",
145
+ "type": "array",
146
+ "items": {
147
+ "$ref": "#/$defs/idlMember"
148
+ }
149
+ },
150
+ "idlType": {
151
+ "$ref": "#/$defs/idlType"
152
+ },
153
+ "arguments": {
154
+ "type": "array",
155
+ "items": {
156
+ "$ref": "#/$defs/argument"
157
+ }
158
+ },
159
+ "extAttrs": {
160
+ "description": "A list of extended attributes.",
161
+ "type": "array",
162
+ "items": {
163
+ "$ref": "#/$defs/extendedAttribute"
164
+ }
165
+ },
166
+ "partial": {
167
+ "description": "Whether the definition is partial.",
168
+ "type": "boolean"
169
+ },
170
+ "href": {
171
+ "description": "The URL to the definition.",
172
+ "type": "string"
173
+ }
174
+ },
175
+ "required": [
176
+ "fragment",
177
+ "type",
178
+ "extAttrs"
179
+ ]
180
+ },
181
+
182
+ "idlFragmentInSpec": {
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "required": ["spec", "fragment"],
186
+ "properties": {
187
+ "spec": { "$ref": "#/$defs/specInExtract" },
188
+ "fragment": { "type": "string" },
189
+ "href": { "$ref": "#/$defs/url" }
190
+ }
191
+ },
192
+
193
+ "references": {
194
+ "type": "array",
195
+ "items": {
196
+ "type": "object",
197
+ "additionalProperties": false,
198
+ "required": ["name"],
199
+ "properties": {
200
+ "name": { "type": "string", "minLength": 1 },
201
+ "url": { "$ref": "#/$defs/url" }
202
+ }
203
+ }
204
+ },
205
+
206
+ "links": {
207
+ "type": "object",
208
+ "propertyNames": { "$ref": "#/$defs/url" },
209
+ "additionalProperties": {
210
+ "type": "object",
211
+ "additionalProperties": false,
212
+ "properties": {
213
+ "anchors": {
214
+ "type": "array",
215
+ "items": { "$ref": "#/$defs/id" },
216
+ "minItems": 1
217
+ },
218
+ "specShortname": { "$ref": "#/$defs/shortname" }
219
+ }
220
+ }
221
+ },
222
+
223
+ "idlType": {
224
+ "description": "Represents a WebIDL type.",
225
+ "type": "object",
226
+ "properties": {
227
+ "type": {
228
+ "description": "The type of the IDL type.",
229
+ "type": [
230
+ "string",
231
+ "null"
232
+ ],
233
+ "enum": [
234
+ "argument-type",
235
+ "attribute-type",
236
+ "return-type",
237
+ "const-type",
238
+ "dictionary-type",
239
+ "field-type",
240
+ "typedef-type",
241
+ null
242
+ ]
243
+ },
244
+ "extAttrs": {
245
+ "description": "A list of extended attributes.",
246
+ "type": "array",
247
+ "items": {
248
+ "$ref": "#/$defs/extendedAttribute"
249
+ }
250
+ },
251
+ "generic": {
252
+ "description": "The type of a parameterized type, if any.",
253
+ "type": "string",
254
+ "enum": [
255
+ "",
256
+ "FrozenArray",
257
+ "ObservableArray",
258
+ "Promise",
259
+ "record",
260
+ "sequence",
261
+ "async_sequence"
262
+ ]
263
+ },
264
+ "nullable": {
265
+ "description": "Whether the type is nullable.",
266
+ "type": "boolean"
267
+ },
268
+ "union": {
269
+ "description": "Whether the type is a union type.",
270
+ "type": "boolean"
271
+ },
272
+ "idlType": {
273
+ "description": "The inner IDL type. Can be a string or an array of idlType objects for union or parameterized types.",
274
+ "oneOf": [
275
+ {
276
+ "type": "string"
277
+ },
278
+ {
279
+ "type": "array",
280
+ "items": {
281
+ "$ref": "#/$defs/idlType"
282
+ }
283
+ }
284
+ ]
285
+ }
286
+ },
287
+ "required": [
288
+ "type",
289
+ "extAttrs",
290
+ "generic",
291
+ "nullable",
292
+ "union",
293
+ "idlType"
294
+ ]
295
+ },
296
+ "extendedAttribute": {
297
+ "description": "Represents a WebIDL extended attribute.",
298
+ "type": "object",
299
+ "properties": {
300
+ "type": {
301
+ "type": "string",
302
+ "enum": [
303
+ "extended-attribute"
304
+ ]
305
+ },
306
+ "name": {
307
+ "description": "The name of the extended attribute.",
308
+ "type": "string"
309
+ },
310
+ "rhs": {
311
+ "description": "The right-hand side of the extended attribute, if applicable.",
312
+ "type": [
313
+ "object",
314
+ "null"
315
+ ]
316
+ },
317
+ "arguments": {
318
+ "description": "A list of arguments for the extended attribute.",
319
+ "type": "array"
320
+ }
321
+ },
322
+ "required": [
323
+ "type",
324
+ "name",
325
+ "rhs",
326
+ "arguments"
327
+ ]
328
+ },
329
+ "argument": {
330
+ "description": "Represents an argument to a WebIDL operation or constructor.",
331
+ "type": "object",
332
+ "properties": {
333
+ "type": {
334
+ "const": "argument"
335
+ },
336
+ "name": {
337
+ "description": "The name of the argument.",
338
+ "type": "string"
339
+ },
340
+ "extAttrs": {
341
+ "description": "A list of extended attributes.",
342
+ "type": "array",
343
+ "items": {
344
+ "$ref": "#/$defs/extendedAttribute"
345
+ }
346
+ },
347
+ "idlType": {
348
+ "$ref": "#/$defs/idlType"
349
+ },
350
+ "default": {
351
+ "$ref": "#/$defs/defaultValue"
352
+ },
353
+ "optional": {
354
+ "description": "Whether the argument is optional.",
355
+ "type": "boolean"
356
+ },
357
+ "variadic": {
358
+ "description": "Whether the argument is variadic.",
359
+ "type": "boolean"
360
+ }
361
+ },
362
+ "required": [
363
+ "type",
364
+ "name",
365
+ "extAttrs",
366
+ "idlType",
367
+ "default",
368
+ "optional",
369
+ "variadic"
370
+ ]
371
+ },
372
+ "idlMember": {
373
+ "description": "Represents a member of a WebIDL interface, dictionary, etc.",
374
+ "oneOf": [
375
+ {
376
+ "$ref": "#/$defs/constructorMember"
377
+ },
378
+ {
379
+ "$ref": "#/$defs/attributeMember"
380
+ },
381
+ {
382
+ "$ref": "#/$defs/operationMember"
383
+ },
384
+ {
385
+ "$ref": "#/$defs/constMember"
386
+ },
387
+ {
388
+ "$ref": "#/$defs/fieldMember"
389
+ },
390
+ {
391
+ "$ref": "#/$defs/iterableMember"
392
+ },
393
+ {
394
+ "$ref": "#/$defs/setlikeMember"
395
+ },
396
+ {
397
+ "$ref": "#/$defs/maplikeMember"
398
+ },
399
+ {
400
+ "$ref": "#/$defs/asyncIterableMember"
401
+ }
402
+ ]
403
+ },
404
+ "constructorMember": {
405
+ "type": "object",
406
+ "properties": {
407
+ "type": {
408
+ "const": "constructor"
409
+ },
410
+ "arguments": {
411
+ "description": "A list of arguments for the constructor.",
412
+ "type": "array",
413
+ "items": {
414
+ "$ref": "#/$defs/argument"
415
+ }
416
+ },
417
+ "extAttrs": {
418
+ "description": "A list of extended attributes.",
419
+ "type": "array",
420
+ "items": {
421
+ "$ref": "#/$defs/extendedAttribute"
422
+ }
423
+ },
424
+ "href": {
425
+ "description": "The URL to the definition of the constructor.",
426
+ "type": "string"
427
+ }
428
+ },
429
+ "required": [
430
+ "type",
431
+ "arguments",
432
+ "extAttrs"
433
+ ]
434
+ },
435
+ "attributeMember": {
436
+ "type": "object",
437
+ "properties": {
438
+ "type": {
439
+ "const": "attribute"
440
+ },
441
+ "name": {
442
+ "description": "The name of the attribute.",
443
+ "type": "string"
444
+ },
445
+ "idlType": {
446
+ "$ref": "#/$defs/idlType"
447
+ },
448
+ "extAttrs": {
449
+ "description": "A list of extended attributes.",
450
+ "type": "array",
451
+ "items": {
452
+ "$ref": "#/$defs/extendedAttribute"
453
+ }
454
+ },
455
+ "special": {
456
+ "description": "The special property of the attribute (e.g., 'static').",
457
+ "type": "string",
458
+ "enum": [
459
+ "",
460
+ "inherit",
461
+ "static",
462
+ "stringifier"
463
+ ]
464
+ },
465
+ "readonly": {
466
+ "description": "Whether the attribute is read-only.",
467
+ "type": "boolean"
468
+ },
469
+ "href": {
470
+ "description": "The URL to the definition of the attribute.",
471
+ "type": "string"
472
+ }
473
+ },
474
+ "required": [
475
+ "type",
476
+ "name",
477
+ "idlType",
478
+ "extAttrs",
479
+ "special"
480
+ ]
481
+ },
482
+ "operationMember": {
483
+ "type": "object",
484
+ "properties": {
485
+ "type": {
486
+ "const": "operation"
487
+ },
488
+ "name": {
489
+ "description": "The name of the operation.",
490
+ "type": "string"
491
+ },
492
+ "idlType": {
493
+ "$ref": "#/$defs/idlType"
494
+ },
495
+ "arguments": {
496
+ "description": "A list of arguments for the operation.",
497
+ "type": "array",
498
+ "items": {
499
+ "$ref": "#/$defs/argument"
500
+ }
501
+ },
502
+ "extAttrs": {
503
+ "description": "A list of extended attributes.",
504
+ "type": "array",
505
+ "items": {
506
+ "$ref": "#/$defs/extendedAttribute"
507
+ }
508
+ },
509
+ "special": {
510
+ "description": "The special property of the operation (e.g., 'static').",
511
+ "type": "string",
512
+ "enum": [
513
+ "",
514
+ "deleter",
515
+ "getter",
516
+ "setter",
517
+ "static",
518
+ "stringifier"
519
+ ]
520
+ },
521
+ "readonly": {
522
+ "description": "Whether the operation is read-only.",
523
+ "type": "boolean"
524
+ },
525
+ "href": {
526
+ "description": "The URL to the definition of the operation.",
527
+ "type": "string"
528
+ }
529
+ },
530
+ "required": [
531
+ "type",
532
+ "name",
533
+ "arguments",
534
+ "extAttrs",
535
+ "special"
536
+ ]
537
+ },
538
+ "constMember": {
539
+ "type": "object",
540
+ "properties": {
541
+ "type": {
542
+ "const": "const"
543
+ },
544
+ "name": {
545
+ "description": "The name of the constant.",
546
+ "type": "string"
547
+ },
548
+ "idlType": {
549
+ "$ref": "#/$defs/idlType"
550
+ },
551
+ "extAttrs": {
552
+ "description": "A list of extended attributes.",
553
+ "type": "array",
554
+ "items": {
555
+ "$ref": "#/$defs/extendedAttribute"
556
+ }
557
+ },
558
+ "value": {
559
+ "description": "The value of the constant.",
560
+ "type": "object"
561
+ },
562
+ "href": {
563
+ "description": "The URL to the definition of the constant.",
564
+ "type": "string"
565
+ }
566
+ },
567
+ "required": [
568
+ "type",
569
+ "name",
570
+ "idlType",
571
+ "extAttrs",
572
+ "value"
573
+ ]
574
+ },
575
+ "fieldMember": {
576
+ "type": "object",
577
+ "properties": {
578
+ "type": {
579
+ "const": "field"
580
+ },
581
+ "name": {
582
+ "description": "The name of the field.",
583
+ "type": "string"
584
+ },
585
+ "extAttrs": {
586
+ "description": "A list of extended attributes.",
587
+ "type": "array",
588
+ "items": {
589
+ "$ref": "#/$defs/extendedAttribute"
590
+ }
591
+ },
592
+ "idlType": {
593
+ "$ref": "#/$defs/idlType"
594
+ },
595
+ "default": {
596
+ "$ref": "#/$defs/defaultValue"
597
+ },
598
+ "required": {
599
+ "description": "Whether the field is required.",
600
+ "type": "boolean"
601
+ },
602
+ "href": {
603
+ "description": "The URL to the definition of the field.",
604
+ "type": "string"
605
+ }
606
+ },
607
+ "required": [
608
+ "type",
609
+ "name",
610
+ "extAttrs",
611
+ "idlType",
612
+ "default",
613
+ "required"
614
+ ]
615
+ },
616
+ "iterableMember": {
617
+ "type": "object",
618
+ "properties": {
619
+ "type": {
620
+ "const": "iterable"
621
+ },
622
+ "idlType": {
623
+ "type": "array",
624
+ "items": {
625
+ "$ref": "#/$defs/idlType"
626
+ }
627
+ },
628
+ "arguments": {
629
+ "type": "array",
630
+ "items": {
631
+ "$ref": "#/$defs/argument"
632
+ }
633
+ },
634
+ "extAttrs": {
635
+ "type": "array",
636
+ "items": {
637
+ "$ref": "#/$defs/extendedAttribute"
638
+ }
639
+ },
640
+ "readonly": {
641
+ "type": "boolean"
642
+ },
643
+ "async": {
644
+ "type": "boolean"
645
+ }
646
+ },
647
+ "required": [
648
+ "type",
649
+ "idlType",
650
+ "arguments",
651
+ "extAttrs",
652
+ "readonly",
653
+ "async"
654
+ ]
655
+ },
656
+ "setlikeMember": {
657
+ "type": "object",
658
+ "properties": {
659
+ "type": {
660
+ "const": "setlike"
661
+ },
662
+ "idlType": {
663
+ "type": "array",
664
+ "items": {
665
+ "$ref": "#/$defs/idlType"
666
+ }
667
+ },
668
+ "arguments": {
669
+ "type": "array",
670
+ "items": {
671
+ "$ref": "#/$defs/argument"
672
+ }
673
+ },
674
+ "extAttrs": {
675
+ "type": "array",
676
+ "items": {
677
+ "$ref": "#/$defs/extendedAttribute"
678
+ }
679
+ },
680
+ "readonly": {
681
+ "type": "boolean"
682
+ },
683
+ "async": {
684
+ "type": "boolean"
685
+ }
686
+ },
687
+ "required": [
688
+ "type",
689
+ "idlType",
690
+ "arguments",
691
+ "extAttrs",
692
+ "readonly",
693
+ "async"
694
+ ]
695
+ },
696
+ "maplikeMember": {
697
+ "type": "object",
698
+ "properties": {
699
+ "type": {
700
+ "const": "maplike"
701
+ },
702
+ "idlType": {
703
+ "type": "array",
704
+ "items": {
705
+ "$ref": "#/$defs/idlType"
706
+ }
707
+ },
708
+ "arguments": {
709
+ "type": "array",
710
+ "items": {
711
+ "$ref": "#/$defs/argument"
712
+ }
713
+ },
714
+ "extAttrs": {
715
+ "type": "array",
716
+ "items": {
717
+ "$ref": "#/$defs/extendedAttribute"
718
+ }
719
+ },
720
+ "readonly": {
721
+ "type": "boolean"
722
+ },
723
+ "async": {
724
+ "type": "boolean"
725
+ }
726
+ },
727
+ "required": [
728
+ "type",
729
+ "idlType",
730
+ "arguments",
731
+ "extAttrs",
732
+ "readonly",
733
+ "async"
734
+ ]
735
+ },
736
+ "asyncIterableMember": {
737
+ "type": "object",
738
+ "properties": {
739
+ "type": {
740
+ "const": "async_iterable"
741
+ },
742
+ "idlType": {
743
+ "type": "array",
744
+ "items": {
745
+ "$ref": "#/$defs/idlType"
746
+ }
747
+ },
748
+ "arguments": {
749
+ "type": "array",
750
+ "items": {
751
+ "$ref": "#/$defs/argument"
752
+ }
753
+ },
754
+ "extAttrs": {
755
+ "type": "array",
756
+ "items": {
757
+ "$ref": "#/$defs/extendedAttribute"
758
+ }
759
+ },
760
+ "readonly": {
761
+ "type": "boolean"
762
+ },
763
+ "async": {
764
+ "type": "boolean"
765
+ }
766
+ },
767
+ "required": [
768
+ "type",
769
+ "idlType",
770
+ "arguments",
771
+ "extAttrs",
772
+ "readonly",
773
+ "async"
774
+ ]
775
+ },
776
+ "defaultValue": {
777
+ "oneOf": [
778
+ {
779
+ "type": "null"
780
+ },
781
+ {
782
+ "type": "object",
783
+ "properties": {
784
+ "type": {
785
+ "const": "string"
786
+ },
787
+ "value": {
788
+ "type": "string"
789
+ }
790
+ },
791
+ "required": [
792
+ "type",
793
+ "value"
794
+ ],
795
+ "additionalProperties": false
796
+ },
797
+ {
798
+ "type": "object",
799
+ "properties": {
800
+ "type": {
801
+ "const": "number"
802
+ },
803
+ "value": {
804
+ "type": [
805
+ "number",
806
+ "string"
807
+ ]
808
+ }
809
+ },
810
+ "required": [
811
+ "type",
812
+ "value"
813
+ ],
814
+ "additionalProperties": false
815
+ },
816
+ {
817
+ "type": "object",
818
+ "properties": {
819
+ "type": {
820
+ "const": "boolean"
821
+ },
822
+ "value": {
823
+ "type": "boolean"
824
+ }
825
+ },
826
+ "required": [
827
+ "type",
828
+ "value"
829
+ ],
830
+ "additionalProperties": false
831
+ },
832
+ {
833
+ "type": "object",
834
+ "properties": {
835
+ "type": {
836
+ "const": "dictionary"
837
+ },
838
+ "value": {
839
+ "type": "object"
840
+ }
841
+ },
842
+ "required": [
843
+ "type"
844
+ ],
845
+ "additionalProperties": false
846
+ },
847
+ {
848
+ "type": "object",
849
+ "properties": {
850
+ "type": {
851
+ "const": "sequence"
852
+ },
853
+ "value": {
854
+ "type": "array"
855
+ }
856
+ },
857
+ "required": [
858
+ "type"
859
+ ],
860
+ "additionalProperties": false
861
+ },
862
+ {
863
+ "type": "object",
864
+ "properties": {
865
+ "type": {
866
+ "const": "null"
867
+ }
868
+ },
869
+ "required": [
870
+ "type"
871
+ ],
872
+ "additionalProperties": false
873
+ }
874
+ ]
875
+ }
876
+ }
877
877
  }