Intent to Implement and Ship: CSS ::placeholder pseudo element

38 views
Skip to first unread message

TAMURA, Kent

unread,
Nov 14, 2016, 8:28:35 PM11/14/16
to blink-de...@chromium.org
tk...@chromium.org https://drafts.csswg.org/css-pseudo-4/#placeholder-pseudo Unprefixed version of ::-webkit-input-placeholder.
Vendor-prefixes are harmful, and Firefox and Safari already shipped the unprefixed version.


Firefox: Shipped
Edge: No public signals
Safari: Shipped
Web developers: Positive



None.

None.
Yes.

http://crbug.com/623345 https://www.chromestatus.com/features/6715780926275584
Yes.


--
TAMURA Kent
Software Engineer, Google


Rick Byers

unread,
Nov 14, 2016, 8:53:11 PM11/14/16
to TAMURA, Kent, blink-de...@chromium.org
LGTM1

Chris Harrelson

unread,
Nov 14, 2016, 11:36:30 PM11/14/16
to Rick Byers, TAMURA, Kent, blink-de...@chromium.org
LGTM2

LGTM1
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Jochen Eisinger

unread,
Nov 14, 2016, 11:39:18 PM11/14/16
to Chris Harrelson, Rick Byers, TAMURA, Kent, blink-de...@chromium.org
lgtm3

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Rune Lillesveen

unread,
Nov 17, 2016, 5:23:54 AM11/17/16
to TAMURA, Kent, blink-de...@chromium.org
We encountered the question of aliasing or not during the code review:

* The CL does not implement this as an alias.
* I've created an issue for aliasing ::-webkit-input-placeholder for
the compat spec: https://github.com/whatwg/compat/issues/65
* It wasn't obvious to me if (simple) aliasing serializes the
unprefixed property/value/selector or not, so I created
https://github.com/whatwg/compat/issues/64
* We do serialize things like "-webkit-animation" as "animation".
* tkent@ thinks aliasing in this case is risky and pointed to
http://stackoverflow.com/questions/28592895/trying-to-get-style-of-placeholder-attribute-of-element#answer-28819417

Opinions?

--
Rune Lillesveen

Philip Jägenstedt

unread,
Nov 17, 2016, 5:52:13 AM11/17/16
to Rune Lillesveen, TAMURA, Kent, blink-de...@chromium.org
Simply from a compat risk perspective, if there's reason to suspect that any content depends on the serialization, which seems to be the case, then preserving the existing behavior seems best, to make any riskier changes in separate CLs for revertability.

Use counters would be nice, although for something like serialization (or the return values of attributes) it's impossible to tell how it is used and if pages break, so I'm afraid only httparchive analysis will really answer that. You might get clues already by checking whether Edge has implemented  ::-webkit-input-placeholder.

PhistucK

unread,
Nov 17, 2016, 4:33:47 PM11/17/16
to Philip Jägenstedt, Rune Lillesveen, TAMURA, Kent, blink-de...@chromium.org
Cool!

This comment might be outdated, but it suggests there are differences in the supported CSS properties between the browsers.
I understand that some browsers offered a pseudo class and some offered a pseudo element, which also affects rendering.

Is this feature interoperable now? Does Chrome support all of the properties that others do?
If not, can you file issues about the differences and ask around whether there is a plan for convergence?


PhistucK

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

TAMURA, Kent

unread,
Nov 17, 2016, 6:53:26 PM11/17/16
to Philip Jägenstedt, Rune Lillesveen, blink-de...@chromium.org
I confirmed both of Safari and Firefox didn't alias.  i.e. document.styleSheets[].cssRules[] returns prefixed selectors for ::-webkit-input-placeholder and ::-moz-placeholder if the CSS source uses a prefixed one. Of course ::placeholder remains as is.

On the other hand, it seems Edge treats ::-webkit-input-placheolder is an alias of ::-ms-input-placeholder.  cssText/selecttorText always shows ::-ms-input-placeholder even if ::-webkit-input-placeholder is specified in CSS source.

Following Safari/Firefox behavior would have lower risk, I think.

TAMURA, Kent

unread,
Nov 17, 2016, 6:58:09 PM11/17/16
to PhistucK, Philip Jägenstedt, Rune Lillesveen, blink-de...@chromium.org
Supported properties are defined by css-pseudo-4 specification.  I haven't checked interoperability of the supported properties, and I think it's low priority unless users file bugs.


Rune Lillesveen

unread,
Nov 18, 2016, 4:35:43 AM11/18/16
to TAMURA, Kent, Philip Jägenstedt, blink-de...@chromium.org
On Fri, Nov 18, 2016 at 12:53 AM, TAMURA, Kent <tk...@chromium.org> wrote:
> I confirmed both of Safari and Firefox didn't alias. i.e.
> document.styleSheets[].cssRules[] returns prefixed selectors for
> ::-webkit-input-placeholder and ::-moz-placeholder if the CSS source uses a
> prefixed one. Of course ::placeholder remains as is.

OK. Then I think you should proceed with keeping them separate as
observed from the outside for now.

--
Rune Lillesveen
Reply all
Reply to author
Forward
0 new messages