Commit Graph
1 Commits
Author SHA1 Message Date
imccyu 2754e9fe8c ci(css): reject costly unkeyed CSS selectors and retire existing ones
Add verify-css-selectors to the hygiene gates. It rejects a subject
compound without a class, id, attribute or type key that matches through
:not(), :empty or :has(); a universal selector that names no class, id
or attribute anywhere; and :has() outside the subject compound. Chromium
evaluates such rules on every restyled element or invalidates whole
subtrees. Class-scoped forms such as '.card *' and '.list > :first-child'
are accepted, and the listed base stylesheets are exempt from the subject
rules.

Existing occurrences are recorded in scripts/css-selectors.baseline.json;
new ones fail and retired ones must be pruned. Rewrite existing selectors
where the matched elements stay the same, and document the rule in the
Web styling reference.
2026-11-20 01:59:10 +08:00