Skip to content

Commit 34cdac9

Browse files
authored
Fix naming logic when dropping duplicate CSS properties (#1444)
The script that drops duplicate CSS properties in known superseded specs did not follow the exact same file naming logic as that followed by the crawler. It took for granted that the file had to be the spec's shortname if the spec wasn't the current specification, but the logic followed by the crawler is rather that defined in `isLatestLevelThatPasses`: the latest full level that defines some CSS is the one that provides the series CSS extract. This nuance had never led to any problem in this part of the code because a spec that defines superseded content typically does not have a "next" level that is not the current level and that keeps on defining the superseded content. Copying the superseded content to a newer level does not make sense, right? Well, that's what `css-multicol-2` currently does. This update fixes the file naming logic, which should have followed that of the crawler in any case.
1 parent 3524b46 commit 34cdac9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/drop-css-property-duplicates.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import util from 'node:util';
1616
import { fileURLToPath } from 'node:url';
1717
import { execFile as execFileCb } from 'node:child_process';
1818
import { loadJSON } from './utils.js';
19-
import { expandCrawlResult } from 'reffy';
19+
import { expandCrawlResult, isLatestLevelThatPasses } from 'reffy';
2020
const execFile = util.promisify(execFileCb);
2121

2222

@@ -247,7 +247,7 @@ async function dropCSSPropertyDuplicates(folder) {
247247
}
248248
}, spec.css);
249249
const json = JSON.stringify(css, null, 2) + '\n';
250-
const filename = spec.shortname === spec.series.currentSpecification ?
250+
const filename = isLatestLevelThatPasses(spec, index.results, spec => spec.css) ?
251251
spec.series.shortname :
252252
spec.shortname
253253
const pathname = path.join(folder, 'css', filename + '.json');

0 commit comments

Comments
 (0)