reffy 18.2.0 → 18.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reffy",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.3.0",
|
|
4
4
|
"description": "W3C/WHATWG spec dependencies exploration companion. Features a short set of tools to study spec references as well as WebIDL term definitions and references found in W3C specifications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"ajv": "8.17.1",
|
|
37
37
|
"ajv-formats": "3.0.1",
|
|
38
|
-
"commander": "13.
|
|
38
|
+
"commander": "13.1.0",
|
|
39
39
|
"fetch-filecache-for-crawling": "5.1.1",
|
|
40
40
|
"puppeteer": "24.1.0",
|
|
41
41
|
"semver": "^7.3.5",
|
|
42
|
-
"web-specs": "3.
|
|
42
|
+
"web-specs": "3.35.0",
|
|
43
43
|
"webidl2": "24.4.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"mocha": "11.0.1",
|
|
47
47
|
"respec": "35.2.2",
|
|
48
48
|
"respec-hljs": "2.1.1",
|
|
49
|
-
"rollup": "4.
|
|
49
|
+
"rollup": "4.31.0",
|
|
50
50
|
"undici": "^7.0.0"
|
|
51
51
|
},
|
|
52
52
|
"overrides": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"value": { "$ref": "../common.json#/$defs/cssValue" },
|
|
19
19
|
"newValues": { "$ref": "../common.json#/$defs/cssValue" },
|
|
20
20
|
"values": { "$ref": "../common.json#/$defs/cssValues" },
|
|
21
|
+
"legacyAliasOf": { "$ref": "../common.json#/$defs/cssPropertyName" },
|
|
21
22
|
"styleDeclaration": {
|
|
22
23
|
"type": "array",
|
|
23
24
|
"items": { "type": "string" },
|
|
@@ -18,13 +18,17 @@ export default function () {
|
|
|
18
18
|
const warnings = [];
|
|
19
19
|
|
|
20
20
|
const res = {
|
|
21
|
-
// Properties are always defined in dedicated tables in modern CSS specs
|
|
22
|
-
properties
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
// Properties are always defined in dedicated tables in modern CSS specs,
|
|
22
|
+
// Legacy properties are always defined in prose in a dfn with a nearby
|
|
23
|
+
// reference to "legacy name alias"
|
|
24
|
+
properties: []
|
|
25
|
+
.concat(extractDfns({
|
|
26
|
+
selector: 'table.propdef:not(.attrdef)',
|
|
27
|
+
extractor: extractTableDfns,
|
|
28
|
+
duplicates: 'merge',
|
|
29
|
+
warnings
|
|
30
|
+
}))
|
|
31
|
+
.concat(extractLegacyProperties(document)),
|
|
28
32
|
|
|
29
33
|
// At-rules, selectors, functions and types are defined through dfns with
|
|
30
34
|
// the right "data-dfn-type" attribute
|
|
@@ -826,3 +830,56 @@ const extractProductionRules = root => {
|
|
|
826
830
|
|
|
827
831
|
return rules;
|
|
828
832
|
}
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Extract legacy alias relationships, looking for occurrences of the term
|
|
837
|
+
* "legacy name alias".
|
|
838
|
+
*
|
|
839
|
+
* Next to it, there should be:
|
|
840
|
+
* 1. a dfn for a property followed by a reference to the aliased property; or
|
|
841
|
+
* 2. a table with two columns: dfns in the first column, references to the
|
|
842
|
+
* aliased properties in the second column.
|
|
843
|
+
*/
|
|
844
|
+
const extractLegacyProperties = doc =>
|
|
845
|
+
[...doc.querySelectorAll('a[href$="#legacy-name-alias"]')]
|
|
846
|
+
.map(el => el.parentElement)
|
|
847
|
+
.map(el => {
|
|
848
|
+
const dfn = el.querySelector('dfn[data-dfn-type="property"]');
|
|
849
|
+
const alias = el.querySelector('a[data-link-type="property"]');
|
|
850
|
+
if (dfn && alias) {
|
|
851
|
+
// Aliasing is defined in prose
|
|
852
|
+
return {
|
|
853
|
+
name: normalize(dfn.textContent),
|
|
854
|
+
href: getAbsoluteUrl(dfn),
|
|
855
|
+
legacyAliasOf: normalize(alias.textContent)
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
else {
|
|
859
|
+
// Look for a compat table right after the paragraph
|
|
860
|
+
const table = el.nextElementSibling;
|
|
861
|
+
if (table?.nodeName !== 'TABLE') {
|
|
862
|
+
return null;
|
|
863
|
+
}
|
|
864
|
+
if ([...table.querySelectorAll('thead > tr > th')].length !== 2) {
|
|
865
|
+
return null;
|
|
866
|
+
}
|
|
867
|
+
return [...table.querySelectorAll('tbody > tr')]
|
|
868
|
+
.map(row => {
|
|
869
|
+
const dfn = row.querySelector('dfn[data-dfn-type="property"]');
|
|
870
|
+
const alias = row.querySelector('a[data-link-type="property"]');
|
|
871
|
+
if (dfn && alias) {
|
|
872
|
+
return {
|
|
873
|
+
name: normalize(dfn.textContent),
|
|
874
|
+
href: getAbsoluteUrl(dfn),
|
|
875
|
+
legacyAliasOf: normalize(alias.textContent)
|
|
876
|
+
};
|
|
877
|
+
}
|
|
878
|
+
else {
|
|
879
|
+
return null;
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
})
|
|
884
|
+
.flat()
|
|
885
|
+
.filter(prop => !!prop);
|