Repository navigation
Commit ead32d3
authored
feat(css): print a minified rule's declarations in one order by property family (#22513)
* feat(css): print a minified rule's declarations in one order by property family
Brings back `reorderDeclarations`, on by default: a rule's declarations
print family by family in the order lightningcss prints its handlers in,
the properties no family names first where they were written, so blocks
setting the same things read alike and compress smaller. Only what no
order can decide moves.
* feat(css): keep a family's declarations in the order written, and check the order in each engine
Every member of a declaration family now shares one rank, so only whole
families move, as in lightningcss: a spec relating two members before
mdn-data does moves nothing. The equivalence suite asks each engine which
longhands every ranked property sets and fails when the minifier moves one
declaration past another setting the same longhand.
* chore: fold the declaration order changeset into the pending CSS minify entry
* fix(css): keep size in the sizing family, which WebKit reads as width and height
The equivalence suite's declaration order check found that WebKit sets
width and height from a size declaration outside @page, so moving size
ahead of width changes what WebKit reads.1 parent a3232d2 commit ead32d3
35 files changed
Lines changed: 1782 additions & 1140 deletions
File tree
- .changeset
- declarations
- lib/css
- schemas
- test
- __snapshots__
- configCases
- css
- minify-chrome-120
- __snapshots__
- minify-legacy-box-prefixes
- minimize-corpus/__snapshots__
- minimize-embedded-data-url/__snapshots__
- minimize-transforms-off
- __snapshots__
- minimize-vendor-prefixes-engine-switch/__snapshots__
- minimize-vendor-prefixes-flexbox-2009/__snapshots__
- minimize-vendor-prefixes/__snapshots__
- minimize-web-corpus/__snapshots__
- minimize
- embedded/everything/__snapshots__
- html/minimize-transforms/__snapshots__
- specCases
- unitCases
- tooling
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3203 | 3203 | | |
3204 | 3204 | | |
3205 | 3205 | | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
3206 | 3211 | | |
3207 | 3212 | | |
3208 | 3213 | | |
| |||
0 commit comments