Commit 22a73b7
committed
Fix duplicated prefixed selectors on reformatted CSS
The `already()` check compared `before.selector` to the generated
prefixed selector with strict equality. Generated prefixed selectors
always join the comma list with `', '`, so once an existing prefixed
rule had its selector list reformatted (e.g. one selector per line by a
formatter), the comparison failed and Autoprefixer inserted a duplicate
prefixed rule on every run.
Normalize the compared selector with `list.comma(...).join(', ')` so
whitespace differences in the selector list no longer defeat the
duplication check.
Closes #14971 parent 958d390 commit 22a73b7
2 files changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | | - | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
| |||
0 commit comments