I was goofing around with the ::placeholder
pseudoelement on Codepen (Chrome 59.0.3071) when I noticed something odd. (please see my JSFiddle)
In brief, this CSS should not enable a transition of the ::placeholder
color over 2s:
input::placeholder {color:red;transition:2s;}
input:hover::placeholder {color:green}
Using Firefox, there is no color transition over a 2 second interval on hover (this appears to be correct according to this section of a W3C spec and this section of a different one - follow the thread to the ::first-line
pseudo-element), but instead there is an immediate color transition to green;
However, the same JSFiddle using Chrome does show a ::placeholder
color transition over a period of 2 seconds, which according to the specs, appears to be incorrect.
Is this a bug in this version of Chrome (and if so, is it being addressed?) or is this an indictment of my lack of understanding of CSS?
::
, so maybe the specs are wrong? – Mousseinput:hover[placeholder]
means "theinput
element that is hovered and has aplaceholder
attribute". So your example doesn't prove that the specs are wrong w.r.t. placeholder pseudo element (although they probably are:). – Crissman::placeholder
has all the properties of::first-line
, but when you do the same experiment on::first-line
, both FF and Chrome have no transition. See this fiddle and observe the difference. Reading the spec carefully, it is unclear to me whether the set of::placeholder
properties is a superset of the::first-line
properties or exactly equal. – Bellied