lightningcss
lightningcss copied to clipboard
minifier: it is not safe to remove the default value of a function in filter
There are several inconsistencies in Chrome's implementation of defaults in older versions, which can cause filters to behave in opposite ways in older browsers. Perhaps other browsers have similar bugs with inconsistent defaults between old and new versions, I didn't continue searching.
Input
.foo {
filter: brightness(1);
}
Output
.foo {
-webkit-filter: brightness(); /* I'm also concerned that `-webkit-filter` does not support omitting the default values. */
filter: brightness(); /* In older versions of Chrome, the calculated value is 0 */
}
Chrome bugs
- https://bugs.chromium.org/p/chromium/issues/detail?id=964696#c13
- https://bugs.chromium.org/p/chromium/issues/detail?id=798683#c6
I would recommend turning off arguments omitting of the functions in the filter by default, it's not worth sacrificing correctness for those few bytes.
in cef which chromium version is 49, -webkit-filter:brightness(); caused a crash