Skip to content

minifier: it is not safe to remove the default value of a function in filter #251

@yisibl

Description

@yisibl

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.

Playground

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions