@webref/xref 1.1.1 → 1.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.
Files changed (82) hide show
  1. package/README.md +77 -0
  2. package/ed/dfns/attribution.json +17 -17
  3. package/ed/dfns/connection-allowlists.json +780 -0
  4. package/ed/dfns/did-resolution.json +17 -17
  5. package/ed/dfns/ecmascript.json +2 -2
  6. package/ed/dfns/encoding.json +20 -0
  7. package/ed/dfns/picture-in-picture.json +58 -18
  8. package/ed/dfns/pointerevents4.json +27 -0
  9. package/ed/dfns/rfc8610.json +6 -5
  10. package/ed/dfns/sanitizer-api.json +20 -0
  11. package/ed/dfns/shacl12-rules.json +181 -86
  12. package/ed/dfns/speech-api.json +22 -0
  13. package/ed/dfns/vc-recognized-entities.json +6 -6
  14. package/ed/dfns/web-smart-card.json +1065 -1151
  15. package/ed/dfns/webdriver-bidi.json +1748 -679
  16. package/ed/dfns/webmcp.json +164 -3
  17. package/ed/dfns/webnn.json +20 -0
  18. package/ed/dfns/webrtc-encoded-transform.json +28 -28
  19. package/ed/dfns/webrtc-ice.json +2 -2
  20. package/ed/headings/attribution.json +21 -0
  21. package/ed/headings/connection-allowlists.json +228 -0
  22. package/ed/headings/did-resolution.json +161 -92
  23. package/ed/headings/dom.json +1 -1
  24. package/ed/headings/ecmascript.json +1 -1
  25. package/ed/headings/encoding.json +1 -1
  26. package/ed/headings/picture-in-picture.json +5 -5
  27. package/ed/headings/rfc2397.json +33 -9
  28. package/ed/headings/rfc4120.json +164 -134
  29. package/ed/headings/rfc6386.json +128 -104
  30. package/ed/headings/rfc6454.json +62 -38
  31. package/ed/headings/rfc6455.json +120 -90
  32. package/ed/headings/rfc6797.json +104 -80
  33. package/ed/headings/rfc7034.json +52 -28
  34. package/ed/headings/rfc7239.json +55 -31
  35. package/ed/headings/rfc7469.json +63 -39
  36. package/ed/headings/rfc7578.json +54 -30
  37. package/ed/headings/rfc7932.json +70 -40
  38. package/ed/headings/rfc8610.json +93 -63
  39. package/ed/headings/rfc8878.json +97 -88
  40. package/ed/headings/rfc9163.json +62 -59
  41. package/ed/headings/rfc9649.json +82 -79
  42. package/ed/headings/rfc9659.json +33 -30
  43. package/ed/headings/secure-payment-confirmation.json +1 -1
  44. package/ed/headings/selectors-5.json +8 -1
  45. package/ed/headings/service-workers.json +1 -1
  46. package/ed/headings/shacl12-rules.json +125 -85
  47. package/ed/headings/soft-navigations.json +1 -1
  48. package/ed/headings/storage-access.json +2 -2
  49. package/ed/headings/vc-data-model-2.1.json +72 -72
  50. package/ed/headings/vc-jose-cose.json +70 -70
  51. package/ed/headings/vc-recognized-entities.json +62 -32
  52. package/ed/headings/web-smart-card.json +106 -217
  53. package/ed/headings/webdriver-bidi.json +25 -4
  54. package/ed/headings/webidl.json +1 -1
  55. package/ed/headings/webmcp.json +14 -0
  56. package/ed/headings/webnn.json +1 -1
  57. package/ed/headings/webrtc-encoded-transform.json +1 -1
  58. package/ed/headings/webusb.json +1 -1
  59. package/ed/headings/webvtt1.json +2 -2
  60. package/index.js +56 -8
  61. package/package.json +1 -1
  62. package/specs.json +28925 -0
  63. package/tr/dfns/attribution.json +17 -17
  64. package/tr/dfns/did-resolution.json +17 -17
  65. package/tr/dfns/picture-in-picture.json +58 -18
  66. package/tr/dfns/pointerevents4.json +27 -0
  67. package/tr/dfns/shacl12-rules.json +181 -86
  68. package/tr/dfns/webdriver-bidi.json +1748 -679
  69. package/tr/dfns/webnn.json +20 -0
  70. package/tr/dfns/webrtc-encoded-transform.json +28 -28
  71. package/tr/dfns/webvtt1.json +82 -95
  72. package/tr/headings/attribution.json +21 -0
  73. package/tr/headings/did-resolution.json +161 -92
  74. package/tr/headings/picture-in-picture.json +5 -5
  75. package/tr/headings/secure-payment-confirmation.json +1 -1
  76. package/tr/headings/service-workers.json +1 -1
  77. package/tr/headings/shacl12-rules.json +125 -85
  78. package/tr/headings/webauthn-3.json +9 -2
  79. package/tr/headings/webdriver-bidi.json +25 -4
  80. package/tr/headings/webnn.json +1 -1
  81. package/tr/headings/webrtc-encoded-transform.json +1 -1
  82. package/tr/headings/webvtt1.json +3 -9
package/README.md CHANGED
@@ -38,6 +38,83 @@ for (const url of urls) {
38
38
 
39
39
  *Note:* The function returns an array because the same URL may be used for a dfn and a heading.
40
40
 
41
+ The `lookup()` function takes the URL to search for as first parameter. It also accepts a [lookup options](#lookup-options) object as second parameter.
42
+
43
+ ### Lookup options
44
+
45
+ *Note:* Lookup options apply as a logical AND when combined.
46
+
47
+ #### `series` option
48
+
49
+ By default, the `lookup()` function assumes that the provided URL uses the nightly or release URL of a spec. Set the `series` boolean flag to find definitions and headings that match a URL that uses the [series](https://github.com/w3c/browser-specs/#series) URL of a spec.
50
+
51
+ Internally, the series URL gets converted to the nightly or release URL of the spec known to be the [current spec](https://github.com/w3c/browser-specs/#seriescurrentspecification) in the series.
52
+
53
+ ```js
54
+ import * as xref from '@webref/xref';
55
+ xref.setup();
56
+
57
+ // URL that targets the CSS Paged Media Module series
58
+ const url = 'https://www.w3.org/TR/css-page/#page-selector';
59
+
60
+ // Default lookup won't return anything
61
+ const notfound = xref.lookup(url);
62
+
63
+ // With the `series` flag, lookup will convert the series
64
+ // URL to the URL of the current spec in the series. As of
65
+ // May 2026, the current spec in the css-page series is
66
+ // css-page-3. Returned dfn will have the URL:
67
+ // https://www.w3.org/TR/css-page-3/#page-selector
68
+ const found = xref.lookup(url, { series: true });
69
+ ```
70
+
71
+ *Note:* The flag may be set even when the provided URL is not a series URL, lookup will just proceed as usual in this case.
72
+
73
+ #### `standing` option
74
+
75
+ The cross-references database contains definitions and headings from all crawled specs. The list of crawled specs in Webref matches the list of specs in [`browser-specs`](https://github.com/w3c/browser-specs) whose [`standing`](https://github.com/w3c/browser-specs/#standing) property is `"good"` or `"pending"`. For historical reasons, the list also include a few specific specs whose standing is `"discontinued"` (such as the DOM Level 2 Style spec).
76
+
77
+ Set the `standing` option to one of the possible standing values to only keep results from specs whose standing match the specified one.
78
+
79
+ ```js
80
+ import * as xref from '@webref/xref';
81
+ xref.setup();
82
+
83
+ // As of May 2026, the Direct Sockets proposal is "pending"
84
+ const url = 'https://wicg.github.io/direct-sockets/#dfn-readable';
85
+
86
+ // Default lookup will return a dfn
87
+ const found = xref.lookup(url);
88
+
89
+ // No result if lookup is restricted to specs in good standing
90
+ const notfound = xref.lookup(url, { standing: 'good' });
91
+ ```
92
+
93
+ #### `version` option
94
+
95
+ The cross-references database contains definitions and headings from both nightly and release versions of the specs.
96
+
97
+ Set the `version` option to one of `"nightly"` or `"release"` to only return results from the underlying version of a spec.
98
+
99
+ ```js
100
+ import * as xref from '@webref/xref';
101
+ xref.setup();
102
+
103
+ // A URL that targets the release version of a spec
104
+ const url = 'https://www.w3.org/TR/css-page-3/#page-selector';
105
+
106
+ // Default lookup will return a dfn
107
+ const found = xref.lookup(url);
108
+
109
+ // No result if lookup is restricted to nightly versions
110
+ const notfound = xref.lookup(url, { version: 'nightly' });
111
+
112
+ // Note: This option is a convenience method for the
113
+ // following, which achieves the exact same thing
114
+ const same = xref.lookup(url)
115
+ .filter(match => match.entry.version === 'nightly');
116
+ ```
117
+
41
118
  ## Lookup matches
42
119
 
43
120
  A match returned by the `lookup()` function is an object with two keys: `source` and `entry`.
@@ -137,10 +137,10 @@
137
137
  "access": "private",
138
138
  "informative": false,
139
139
  "heading": {
140
- "id": "overview",
141
- "href": "https://w3c.github.io/attribution/#overview",
142
- "title": "Overview of Operation",
143
- "number": "2"
140
+ "id": "overview-conversion",
141
+ "href": "https://w3c.github.io/attribution/#overview-conversion",
142
+ "title": "Conversions or Querying Impressions",
143
+ "number": "2.2"
144
144
  },
145
145
  "definedIn": "prose",
146
146
  "links": []
@@ -157,10 +157,10 @@
157
157
  "access": "private",
158
158
  "informative": false,
159
159
  "heading": {
160
- "id": "overview",
161
- "href": "https://w3c.github.io/attribution/#overview",
162
- "title": "Overview of Operation",
163
- "number": "2"
160
+ "id": "overview-aggregation",
161
+ "href": "https://w3c.github.io/attribution/#overview-aggregation",
162
+ "title": "Aggregation",
163
+ "number": "2.3"
164
164
  },
165
165
  "definedIn": "prose",
166
166
  "links": []
@@ -830,10 +830,10 @@
830
830
  "links": []
831
831
  },
832
832
  {
833
- "id": "dom-attributionconversionoptions-credit",
834
- "href": "https://w3c.github.io/attribution/#dom-attributionconversionoptions-credit",
833
+ "id": "dom-attributionconversionoptions-value",
834
+ "href": "https://w3c.github.io/attribution/#dom-attributionconversionoptions-value",
835
835
  "linkingText": [
836
- "credit"
836
+ "value"
837
837
  ],
838
838
  "localLinkingText": [],
839
839
  "type": "dict-member",
@@ -852,10 +852,10 @@
852
852
  "links": []
853
853
  },
854
854
  {
855
- "id": "dom-attributionconversionoptions-value",
856
- "href": "https://w3c.github.io/attribution/#dom-attributionconversionoptions-value",
855
+ "id": "dom-attributionconversionoptions-maxvalue",
856
+ "href": "https://w3c.github.io/attribution/#dom-attributionconversionoptions-maxvalue",
857
857
  "linkingText": [
858
- "value"
858
+ "maxValue"
859
859
  ],
860
860
  "localLinkingText": [],
861
861
  "type": "dict-member",
@@ -874,10 +874,10 @@
874
874
  "links": []
875
875
  },
876
876
  {
877
- "id": "dom-attributionconversionoptions-maxvalue",
878
- "href": "https://w3c.github.io/attribution/#dom-attributionconversionoptions-maxvalue",
877
+ "id": "dom-attributionconversionoptions-credit",
878
+ "href": "https://w3c.github.io/attribution/#dom-attributionconversionoptions-credit",
879
879
  "linkingText": [
880
- "maxValue"
880
+ "credit"
881
881
  ],
882
882
  "localLinkingText": [],
883
883
  "type": "dict-member",