[csswg-drafts] [css-selectors-4] [css-pseudo-elements-4] ::placeholder and :placeholder-shown should explicitly apply to textarea elements (#6669)

astearns has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-selectors-4] [css-pseudo-elements-4] ::placeholder and :placeholder-shown should explicitly apply to textarea elements ==
The MDN documentation for ::placeholder and :placeholder-shown mention that they apply to textarea and input elements:

https://developer.mozilla.org/en-US/docs/Web/CSS/::placeholder
https://developer.mozilla.org/en-US/docs/Web/CSS/:placeholder-shown

The textarea element is not mentioned in either spec section for these:

https://drafts.csswg.org/css-pseudo/#placeholder-pseudo
https://drafts.csswg.org/selectors/#placeholder

As far as implementations go, ::placeholder appears to work with textareas, but :placeholder-shown has issues.

https://codepen.io/astearns/pen/zYzLaOL

In Mac Firefox, it looks like :placeholder-shown on textareas allows the same properties as ::placeholder (those limited to ::first-line), so you can’t do things like truncate the placeholder text with an ellipsis. In Chrome and Safari, it does not appear to work with textareas at all.

I suggest that we specify what MDN documents (both ::placeholder and :placeholder-shown should work with textarea). This would be specifying reality with regard to ::placeholder, and if that’s acceptable then :placeholder-shown should match.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6669 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 23 September 2021 00:15:49 UTC