postcss / autoprefixer

Parse CSS and add vendor prefixes to rules by Can I Use
https://twitter.com/autoprefixer
MIT License
21.57k stars 1.25k forks source link

Unexpected vendor prefix "::-moz-placeholder" #1512

Closed r3dDoX closed 4 months ago

r3dDoX commented 4 months ago

We noticed in our output that we see autoprefixer adding ::-moz-placeholder vendor prefix when it does not seem to be necessary by the browsers we selected. I tried it on the Playground by using the defaults browsers and input:

::placeholder {
  color: red;
}

The output I get is this:

/*
* Prefixed by https://autoprefixer.github.io
* PostCSS: v8.4.14,
* Autoprefixer: v10.4.7
* Browsers: defaults
*/

::-moz-placeholder {
  color: red;
}
::placeholder {
  color: red;
}

As far as I can see, this placeholder vendor prefix should not be added, no selected browser needs this. Or am I missing something?

ai commented 4 months ago

It will be missed on last 1 FF version Browserslist.

Seems like Autoprefixer adds it because of Firefox ESR.

RobertMe commented 2 weeks ago

I made the same observation with ::-moz-placeholder still being used / added, and dug a bit deeper. This is not because of Firefox (ESR), but because of KaiOS, which was originally based on Firefox OS and (seemingly) still uses the Firefox / Gecko engine. Caniuse / browserslists recognizes two versions of it, 2.5 and 3.0-3.1, which are both included in defaults. And version 2.5 still requires the -moz- prefix.

(If you really don't don't want it you could opt to use defaults, not kaios > 0 to ignore all KaiOS versions, or defaults, not kaios < 3 to ignore older versions than 3.0)