Skip to content

rule_order: fold conditional blocks that share a condition - #211

Merged
samoht merged 3 commits into
mainfrom
rule-order-block-fold
Jul 29, 2026
Merged

rule_order: fold conditional blocks that share a condition#211
samoht merged 3 commits into
mainfrom
rule-order-block-fold

Conversation

@samoht

@samoht samoht commented Jul 29, 2026

Copy link
Copy Markdown
Owner

The canonical projection coalesced repeated style rules but skipped conditional blocks, so two sheets that split the same @media content differently never converged and --diff=canonical fell back to reporting the block structure positionally: a merge plus a phantom rule entry for every renumbered block. Blocks already stand in the conflict graph for the union of their interior selectors and declarations, so the existing interval test gates the fold without needing a new safety argument.

Stacked on #210; review that one first. 87ca542 lifts drop_shadowed_declarations out of canonicalize_block beforehand, which is pure code motion.

@samoht
samoht force-pushed the diff-report-shaping branch from 1e1ac4f to 3a7464e Compare July 29, 2026 04:46
samoht added 3 commits July 28, 2026 21:46
It was a 37-line closure nested inside canonicalize_block that captured
nothing from it, which pushed its host well past the length merlint
accepts and hid a self-contained rewrite inside an unrelated function.
The projection coalesced repeated style rules but skipped conditional
blocks, so two sheets that split the same @media content differently never
converged and the comparator fell back to reporting the block structure
positionally, as a merge plus a phantom rule entry per renumbered block.
Blocks already stand in the conflict graph for the union of their interior
selectors and declarations, so the existing interval test gates the fold
without a new safety argument.
@samoht
samoht force-pushed the rule-order-block-fold branch from b952f1a to f5e2160 Compare July 29, 2026 04:47
Base automatically changed from diff-report-shaping to main July 29, 2026 05:03
@samoht
samoht merged commit 16063b3 into main Jul 29, 2026
5 checks passed
@samoht
samoht deleted the rule-order-block-fold branch July 29, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant