@webref/xref 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -0
- package/ed/dfns/ecmascript.json +2 -2
- package/ed/dfns/encoding.json +20 -0
- package/ed/dfns/picture-in-picture.json +58 -18
- package/ed/dfns/shacl12-rules.json +181 -86
- package/ed/dfns/webdriver-bidi.json +148 -17
- package/ed/dfns/webmcp.json +164 -3
- package/ed/headings/ecmascript.json +1 -1
- package/ed/headings/encoding.json +1 -1
- package/ed/headings/picture-in-picture.json +5 -5
- package/ed/headings/rfc2397.json +33 -9
- package/ed/headings/rfc4120.json +164 -134
- package/ed/headings/rfc6386.json +128 -104
- package/ed/headings/rfc6454.json +62 -38
- package/ed/headings/rfc6455.json +120 -90
- package/ed/headings/rfc6797.json +104 -80
- package/ed/headings/rfc7034.json +52 -28
- package/ed/headings/rfc7239.json +55 -31
- package/ed/headings/rfc7469.json +63 -39
- package/ed/headings/rfc7578.json +54 -30
- package/ed/headings/rfc7932.json +70 -40
- package/ed/headings/rfc8610.json +100 -63
- package/ed/headings/rfc8878.json +97 -88
- package/ed/headings/rfc9163.json +62 -59
- package/ed/headings/rfc9649.json +82 -79
- package/ed/headings/rfc9659.json +33 -30
- package/ed/headings/selectors-5.json +8 -1
- package/ed/headings/shacl12-rules.json +127 -77
- package/ed/headings/webdriver-bidi.json +10 -3
- package/ed/headings/webmcp.json +14 -0
- package/ed/headings/webusb.json +1 -1
- package/ed/headings/webvtt1.json +2 -2
- package/index.js +56 -8
- package/package.json +1 -1
- package/specs.json +28890 -0
- package/tr/dfns/shacl12-rules.json +181 -86
- package/tr/dfns/webdriver-bidi.json +148 -17
- package/tr/dfns/webvtt1.json +82 -95
- package/tr/headings/shacl12-rules.json +127 -77
- package/tr/headings/webdriver-bidi.json +10 -3
- 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`.
|
package/ed/dfns/ecmascript.json
CHANGED
|
@@ -34619,7 +34619,7 @@
|
|
|
34619
34619
|
"href": "https://tc39.es/ecma262/multipage/structured-data.html#sec-unicodeescape",
|
|
34620
34620
|
"linkingText": [
|
|
34621
34621
|
"UnicodeEscape",
|
|
34622
|
-
"UnicodeEscape(
|
|
34622
|
+
"UnicodeEscape(codeUnit)"
|
|
34623
34623
|
],
|
|
34624
34624
|
"localLinkingText": [],
|
|
34625
34625
|
"type": "abstract-op",
|
|
@@ -34629,7 +34629,7 @@
|
|
|
34629
34629
|
"heading": {
|
|
34630
34630
|
"id": "sec-unicodeescape",
|
|
34631
34631
|
"href": "https://tc39.es/ecma262/multipage/structured-data.html#sec-unicodeescape",
|
|
34632
|
-
"title": "UnicodeEscape (
|
|
34632
|
+
"title": "UnicodeEscape ( codeUnit )",
|
|
34633
34633
|
"number": "25.5.4.4"
|
|
34634
34634
|
},
|
|
34635
34635
|
"definedIn": "heading",
|
package/ed/dfns/encoding.json
CHANGED
|
@@ -2043,6 +2043,26 @@
|
|
|
2043
2043
|
}
|
|
2044
2044
|
]
|
|
2045
2045
|
},
|
|
2046
|
+
{
|
|
2047
|
+
"id": "set-up-a-text-decoder-stream",
|
|
2048
|
+
"href": "https://encoding.spec.whatwg.org/#set-up-a-text-decoder-stream",
|
|
2049
|
+
"linkingText": [
|
|
2050
|
+
"set up a text decoder stream"
|
|
2051
|
+
],
|
|
2052
|
+
"localLinkingText": [],
|
|
2053
|
+
"type": "dfn",
|
|
2054
|
+
"for": [],
|
|
2055
|
+
"access": "public",
|
|
2056
|
+
"informative": false,
|
|
2057
|
+
"heading": {
|
|
2058
|
+
"id": "interface-textdecoderstream",
|
|
2059
|
+
"href": "https://encoding.spec.whatwg.org/#interface-textdecoderstream",
|
|
2060
|
+
"title": "Interface TextDecoderStream",
|
|
2061
|
+
"number": "7.5"
|
|
2062
|
+
},
|
|
2063
|
+
"definedIn": "prose",
|
|
2064
|
+
"links": []
|
|
2065
|
+
},
|
|
2046
2066
|
{
|
|
2047
2067
|
"id": "decode-and-enqueue-a-chunk",
|
|
2048
2068
|
"href": "https://encoding.spec.whatwg.org/#decode-and-enqueue-a-chunk",
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
},
|
|
6
6
|
"dfns": [
|
|
7
7
|
{
|
|
8
|
-
"id": "
|
|
9
|
-
"href": "https://w3c.github.io/picture-in-picture/#
|
|
8
|
+
"id": "picture-in-picture-window",
|
|
9
|
+
"href": "https://w3c.github.io/picture-in-picture/#picture-in-picture-window",
|
|
10
10
|
"linkingText": [
|
|
11
|
-
"
|
|
11
|
+
"Picture-in-Picture window"
|
|
12
12
|
],
|
|
13
13
|
"localLinkingText": [],
|
|
14
14
|
"type": "dfn",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"heading": {
|
|
19
19
|
"id": "defines",
|
|
20
20
|
"href": "https://w3c.github.io/picture-in-picture/#defines",
|
|
21
|
-
"title": "
|
|
21
|
+
"title": "Definitions",
|
|
22
22
|
"number": "3.1"
|
|
23
23
|
},
|
|
24
24
|
"definedIn": "prose",
|
|
25
25
|
"links": []
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"id": "
|
|
29
|
-
"href": "https://w3c.github.io/picture-in-picture/#
|
|
28
|
+
"id": "picture-in-picture-element",
|
|
29
|
+
"href": "https://w3c.github.io/picture-in-picture/#picture-in-picture-element",
|
|
30
30
|
"linkingText": [
|
|
31
|
-
"
|
|
31
|
+
"Picture-in-Picture element"
|
|
32
32
|
],
|
|
33
33
|
"localLinkingText": [],
|
|
34
34
|
"type": "dfn",
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
"access": "private",
|
|
37
37
|
"informative": false,
|
|
38
38
|
"heading": {
|
|
39
|
-
"id": "
|
|
40
|
-
"href": "https://w3c.github.io/picture-in-picture/#
|
|
41
|
-
"title": "
|
|
42
|
-
"number": "3.
|
|
39
|
+
"id": "defines",
|
|
40
|
+
"href": "https://w3c.github.io/picture-in-picture/#defines",
|
|
41
|
+
"title": "Definitions",
|
|
42
|
+
"number": "3.1"
|
|
43
43
|
},
|
|
44
44
|
"definedIn": "prose",
|
|
45
45
|
"links": []
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
"id": "picture-in-picture-
|
|
49
|
-
"href": "https://w3c.github.io/picture-in-picture/#picture-in-picture-
|
|
48
|
+
"id": "picture-in-picture-parallel-queue",
|
|
49
|
+
"href": "https://w3c.github.io/picture-in-picture/#picture-in-picture-parallel-queue",
|
|
50
50
|
"linkingText": [
|
|
51
|
-
"
|
|
51
|
+
"picture-in-picture parallel queue"
|
|
52
52
|
],
|
|
53
53
|
"localLinkingText": [],
|
|
54
54
|
"type": "dfn",
|
|
@@ -56,10 +56,30 @@
|
|
|
56
56
|
"access": "private",
|
|
57
57
|
"informative": false,
|
|
58
58
|
"heading": {
|
|
59
|
-
"id": "
|
|
60
|
-
"href": "https://w3c.github.io/picture-in-picture/#
|
|
61
|
-
"title": "
|
|
62
|
-
"number": "3.
|
|
59
|
+
"id": "defines",
|
|
60
|
+
"href": "https://w3c.github.io/picture-in-picture/#defines",
|
|
61
|
+
"title": "Definitions",
|
|
62
|
+
"number": "3.1"
|
|
63
|
+
},
|
|
64
|
+
"definedIn": "prose",
|
|
65
|
+
"links": []
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "initiators-of-active-picture-in-picture-sessions",
|
|
69
|
+
"href": "https://w3c.github.io/picture-in-picture/#initiators-of-active-picture-in-picture-sessions",
|
|
70
|
+
"linkingText": [
|
|
71
|
+
"initiators of active Picture-in-Picture sessions"
|
|
72
|
+
],
|
|
73
|
+
"localLinkingText": [],
|
|
74
|
+
"type": "dfn",
|
|
75
|
+
"for": [],
|
|
76
|
+
"access": "private",
|
|
77
|
+
"informative": false,
|
|
78
|
+
"heading": {
|
|
79
|
+
"id": "defines",
|
|
80
|
+
"href": "https://w3c.github.io/picture-in-picture/#defines",
|
|
81
|
+
"title": "Definitions",
|
|
82
|
+
"number": "3.1"
|
|
63
83
|
},
|
|
64
84
|
"definedIn": "prose",
|
|
65
85
|
"links": []
|
|
@@ -172,6 +192,26 @@
|
|
|
172
192
|
"definedIn": "pre",
|
|
173
193
|
"links": []
|
|
174
194
|
},
|
|
195
|
+
{
|
|
196
|
+
"id": "request-picture-in-picture",
|
|
197
|
+
"href": "https://w3c.github.io/picture-in-picture/#request-picture-in-picture",
|
|
198
|
+
"linkingText": [
|
|
199
|
+
"request Picture-in-Picture"
|
|
200
|
+
],
|
|
201
|
+
"localLinkingText": [],
|
|
202
|
+
"type": "dfn",
|
|
203
|
+
"for": [],
|
|
204
|
+
"access": "public",
|
|
205
|
+
"informative": false,
|
|
206
|
+
"heading": {
|
|
207
|
+
"id": "htmlvideoelement-extensions",
|
|
208
|
+
"href": "https://w3c.github.io/picture-in-picture/#htmlvideoelement-extensions",
|
|
209
|
+
"title": "Extensions to HTMLVideoElement",
|
|
210
|
+
"number": "4.1"
|
|
211
|
+
},
|
|
212
|
+
"definedIn": "prose",
|
|
213
|
+
"links": []
|
|
214
|
+
},
|
|
175
215
|
{
|
|
176
216
|
"id": "dom-document-pictureinpictureenabled",
|
|
177
217
|
"href": "https://w3c.github.io/picture-in-picture/#dom-document-pictureinpictureenabled",
|