Skip to content

Commit 0416a79

Browse files
committed
Improve duplication removal logic
This moves the check on delta specs after the core superseding logic so that delta specs also get checked for actual duplicates with unrelated specs.
1 parent d041b9f commit 0416a79

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tools/drop-css-property-duplicates.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,6 @@ async function dropCSSPropertyDuplicates(folder) {
164164

165165
function filterSuperseded(spec, specs, type, name) {
166166
const shortname = spec.series.shortname;
167-
if ((spec.seriesComposition === 'delta') &&
168-
specs.find(s => s !== spec && s.series.shortname === shortname)) {
169-
// Property name both defined in delta spec and in base full spec,
170-
// let's ignore the duplication.
171-
return false;
172-
}
173-
174167
const superseding = [supersededBy[shortname]].flat();
175168
if (superseding[0] === '*' ||
176169
specs.find(s => superseding.includes(s.series.shortname))) {
@@ -180,6 +173,13 @@ async function dropCSSPropertyDuplicates(folder) {
180173
spec.needsSaving = true;
181174
return false;
182175
}
176+
177+
if ((spec.seriesComposition === 'delta') &&
178+
specs.find(s => s !== spec && s.series.shortname === shortname)) {
179+
// Property name both defined in delta spec and in base full spec,
180+
// let's ignore the duplication
181+
return false;
182+
}
183183
return true;
184184
}
185185

0 commit comments

Comments
 (0)