You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[quality] style-contract reduced-motion rule (#281) has no fixture self-test and skips !important / block-final declarations #282
#281 added a scroll-behavior: smooth → @media (prefers-reduced-motion: no-preference) rule to scripts/style-contract.test.mjs, but as an inline loop inside the live style.css test rather than as an exported helper with fixture self-tests — the structure every other rule in that file (18 of them) follows, and the convention the file header relies on ("each rule has a fixture self-test").
scroll-behavior: smooth } as the last declaration without ; → indexOf(";") runs past the block, value never equals smooth.
scroll-behavior: SMOOTH → case-sensitive compare.
The rule only reads style.css; the sibling rules (structure, var(), url()) also run over every page's inline <style>, where 15 redirect/landing pages declare CSS.
braceDepth is tracked but never read.
scripts/coverage-floor.test.mjs does not cover this: it floors scripts/*.mjs helpers, not logic defined inside *.test.mjs, so an unasserted arm in a test-file rule is only caught by the fixture convention.
Recommendation
Extract the rule into export function unguardedSmoothScroll(css, label = "css") returning one problem per unguarded declaration (handling !important, block-final declarations, case, nested @media/@supports), run it over every linked stylesheet and every inline <style> like the neighbouring rules, and add two fixture tests (passing shapes; each failure arm with its line).
Priority
Impact: low (rule is non-vacuous against the live file; the loopholes need a future edit to matter)
Activity