Skip to content

Commit

Permalink
Don't fetch info from Specref for CSS and www.w3.org specs. (#1658)
Browse files Browse the repository at this point in the history
Browser-specs still fetched info from Specref for a few W3C specs, notably the
`css-backgrounds-4` draft and a few policy documents. Info is now fetched
directly from the spec for these specs. This will make it possible to properly
retire `csswg.json` in Specref.

The GIF spec, published under `https://www.w3.org` is treated as an exception
to the rule, because its URL ends with `.txt`, signaling a spec published in
plain text.

Note: Browser-specs still leverages Specref, mainly for WHATWG specs, a few
TC39 and ISO specs, and a couple of CG specs that use their own GitHub org.
  • Loading branch information
tidoust authored Jan 21, 2025
1 parent 0ffbf74 commit 8a45025
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@
"url": "https://www.w3.org/Graphics/GIF/spec-gif89a.txt",
"shortname": "GIF",
"shortTitle": "GIF",
"title": "Graphics Interchange Format",
"organization": "CompuServe Incorporated",
"groups": [
{
Expand Down
13 changes: 12 additions & 1 deletion src/fetch-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ async function fetchInfoFromSpecref(specs, options) {
// these specs to avoid a catch-22 where the info in browser-specs gets stuck
// to the that in Specref.
const filteredSpecs = specs.filter(spec =>
!spec.url.match(/\/\/(wicg|w3c)\.github\.io\//));
!spec.url.match(/\/\/(wicg|w3c)\.github\.io\//) &&
!spec.url.match(/\/\/www\.w3\.org\//) &&
!spec.url.match(/\/\/drafts\.csswg\.org\//));

const chunks = chunkArray(filteredSpecs, 50);
const chunksRes = await Promise.all(chunks.map(async chunk => {
Expand Down Expand Up @@ -505,6 +507,15 @@ async function fetchInfoFromSpecs(specs, options) {
};
}
}
else if (spec.url.endsWith(".txt")) {
// Spec from another time (typically the GIF spec), published as plain
// text. Nothing we can usefully extract from the spec. Let's proceed
// and hope `specs.json` contains the appropriate info for the spec
// (no official status for the spec either, using "Editor's Draft")
return {
nightly: { url, status: "Editor's Draft" }
}
}

const titleAndStatus = await page.evaluate(_ => {
// Extract first heading when set
Expand Down

0 comments on commit 8a45025

Please sign in to comment.