fix #4357: -webkit- prefix for mask shorthand (#4358)

This commit is contained in:
BPJEnnova
2025-12-16 15:29:46 -05:00
committed by GitHub
parent 3323732049
commit 02b00ec8e9
5 changed files with 30 additions and 0 deletions
+20
View File
@@ -8,6 +8,26 @@
This change was contributed by [@hybrist](https://github.com/hybrist).
* Added CSS vendor prefix (`-webkit`) for the [mask](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/mask) shorthand property ([#4357](https://github.com/evanw/esbuild/issues/4357)).
```css
/* Original code */
main {
mask: url(x.png) center/5rem no-repeat
}
/* Old output */
main {
mask: url(x.png) center/5rem no-repeat
}
/* New output */
main {
-webkit-mask: url(x.png) center/5rem no-repeat
mask: url(x.png) center/5rem no-repeat
}
```
* Additional minification of `switch` statements ([#4176](https://github.com/evanw/esbuild/issues/4176), [#4359](https://github.com/evanw/esbuild/issues/4359))
This release contains additional minification patterns for reducing `switch` statements. Here is an example:
+1
View File
@@ -118,6 +118,7 @@ export const cssProperties = {
DHeight: true,
DHyphens: true,
DInitialLetter: true,
DMask: true,
DMaskComposite: true,
DMaskImage: true,
DMaskOrigin: true,
+1
View File
@@ -84,6 +84,7 @@ const similarPrefixedProperty: Record<string, { prefix: string, property: string
const cssPrefixFeatures: Record<string, CSSProperty> = {
'css.properties.height.stretch': 'DHeight',
'css.properties.mask': 'DMask',
'css.properties.mask-composite': 'DMaskComposite',
'css.properties.mask-image': 'DMaskImage',
'css.properties.mask-origin': 'DMaskOrigin',
+7
View File
@@ -249,6 +249,13 @@ var cssPrefixTable = map[css_ast.D][]prefixData{
{engine: IOS, prefix: WebkitPrefix},
{engine: Safari, prefix: WebkitPrefix},
},
css_ast.DMask: {
{engine: Chrome, prefix: WebkitPrefix, withoutPrefix: v{120, 0, 0}},
{engine: Edge, prefix: WebkitPrefix, withoutPrefix: v{120, 0, 0}},
{engine: IOS, prefix: WebkitPrefix, withoutPrefix: v{15, 4, 0}},
{engine: Opera, prefix: WebkitPrefix, withoutPrefix: v{106, 0, 0}},
{engine: Safari, prefix: WebkitPrefix, withoutPrefix: v{15, 4, 0}},
},
css_ast.DMaskComposite: {
{engine: Chrome, prefix: WebkitPrefix, withoutPrefix: v{120, 0, 0}},
{engine: Edge, prefix: WebkitPrefix, withoutPrefix: v{120, 0, 0}},
+1
View File
@@ -2864,6 +2864,7 @@ func TestPrefixInsertion(t *testing.T) {
"clip-path",
"font-kerning",
"initial-letter",
"mask",
"mask-image",
"mask-origin",
"mask-position",