unprefix :placeholder-shown pseudo-class and ::placeholder pseudo-element

RESOLVED FIXED in Firefox 51

Status

()

Core
Layout: Form Controls
RESOLVED FIXED
3 years ago
a year ago

People

(Reporter: dbaron, Assigned: Thomas Wisniewski)

Tracking

(Blocks: 2 bugs, {dev-doc-complete, site-compat})

Trunk
mozilla51
dev-doc-complete, site-compat
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox51 fixed)

Details

(Whiteboard: [parity-webkit])

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

3 years ago
Maybe not yet, but at some point we should unprefix the :placeholder-shown pseudo-class and ::placeholder pseudo-element.

We had code for the pseudo-class, but it was removed in bug 737786, which added support for the pseudo-element, which we currently implement prefixed.

The names were agreed by the CSSWG in http://krijnhoetmer.nl/irc-logs/css/20130206#l-654 .  Only the pseudo-class is in a spec http://dev.w3.org/csswg/selectors/#placeholder partly because there doesn't appear to be an active spec approprite for the pseudo-element.

http://caniuse.com/#feat=css-placeholder is somewhat misleading.
(Reporter)

Updated

3 years ago
Depends on: 1069015
Keywords: dev-doc-needed

Comment 1

3 years ago
Why change the name?
(Reporter)

Comment 2

3 years ago
The CSS working group resolved on these names after a long discussion; I wouldn't reopen that discussion without a very good reason.

Comment 3

2 years ago
Chrome and WebKit supported.

Comment 4

2 years ago
@percyley, just checked, is not jet supported on Chrome, not even on Chrome canary 49.0.2593.0.

Comment 5

2 years ago
Released in Chrome 47 stable with tons of bugs https://code.google.com/p/chromium/issues/detail?id=451120#c13

Comment 6

a year ago
::placeholder has been unprefixed in Safari Tech Preview 7.
See https://webkit.org/blog/6640/release-notes-for-safari-technology-preview-release-7/
> * Added the unprefixed version of the pseudo element ::placeholder (r202066)
Whiteboard: [parity-webkit]

Comment 7

a year ago
(In reply to David Baron :dbaron: ⌚️UTC-7 from comment #0)
> Only the pseudo-class is in a spec [...] partly because
> there doesn't appear to be an active spec appropriate for the pseudo-element.

::placeholder is currently part of Pseudo-Elements Level 4:
https://www.w3.org/TR/css-pseudo-4/#placeholder-pseudo
(Assignee)

Comment 8

a year ago
Created attachment 8787829 [details] [diff] [review]
1069012-unprefix-placeholder-pseudoelement.diff

Since I'm not 100% sure if we'd need to keep both the prefixed and unprefixed versions for now (which is proving trickier), I figured I'd first offer a version which just removes the unprefixed version. A try run is fine: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1ba7eb550f0c&selectedJob=26870596

I'll work on a version that keeps the prefixed unprefixed versions though, since I'm guessing there is no telemetry on whether it's safe to just support the unprefixed version.
Assignee: nobody → wisniewskit
Status: NEW → ASSIGNED
Attachment #8787829 - Flags: review?(bzbarsky)
(Assignee)

Comment 9

a year ago
Created attachment 8787919 [details] [diff] [review]
1069012-unprefix-placeholder-pseudoelement.diff

And here's a patch with both the prefixed and unprefixing versions. A try run only shows unrelated stuff: https://treeherder.mozilla.org/#/jobs?repo=try&revision=07f7958d9c5a
Attachment #8787829 - Attachment is obsolete: true
Attachment #8787829 - Flags: review?(bzbarsky)
Attachment #8787919 - Flags: review?(bzbarsky)
Comment on attachment 8787919 [details] [diff] [review]
1069012-unprefix-placeholder-pseudoelement.diff

In devtools/shared/css-properties-db.js, should ":placeholder" really be sorted in with the moz-prefixed things?  I'd guess not.

In layout/inspector/tests/test_getCSSPseudoElementNames.html it almost certainly should _not_ be at the end, but rather before all the moz-prefixed bits.

>+++ b/layout/style/nsCSSParser.cpp
>+  // We currently allow :-moz-placeholder and ::-moz-placeholder and
>+  // ::placeholder. We have to // be a bit stricter regarding the

Stray "//" in there.

>+++ b/layout/style/test/test_selectors.html
>+    should_serialize_to("input::placeholder", "input::placeholder");

Should have a test for ::-moz-placeholder here too, to make sure it doesn't serialize as ::placeholder, right?

r=me, but please send an intent to ship and file a followup to remove ::-moz-placeholder.
Attachment #8787919 - Flags: review?(bzbarsky) → review+
Keywords: site-compat
(Assignee)

Comment 11

a year ago
Thanks, Boris. I just an intent-to-ship (https://groups.google.com/forum/?_escaped_fragment_=topic/mozilla.dev.platform/FkAJkVOJF74#!topic/mozilla.dev.platform/FkAJkVOJF74) and will address your review comments as soon as possible.
(Assignee)

Updated

a year ago
Blocks: 1300896
(Assignee)

Comment 12

a year ago
Created attachment 8789116 [details] [diff] [review]
1069012-unprefix-placeholder-pseudoelement.diff

Alright, here's a fresh version of the patch that addresses your comments. Note that there was already an existing test for ::-moz-placeholder serialization (a few lines beneath that one), so I didn't have to add that.

Since the changes were trivial and non-functional, and the patch still applies cleanly to inbound, I'm carrying over r+ and requesting checkin.
Attachment #8787919 - Attachment is obsolete: true
(Assignee)

Updated

a year ago
Keywords: checkin-needed
landed as http://hg.mozilla.org/integration/mozilla-inbound/rev/b31b1d10f122 but pulsebot failed to comment
Keywords: checkin-needed

Comment 14

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b31b1d10f122
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox51: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Posted the site compatibility doc: https://www.fxsitecompat.com/en-CA/docs/2016/placeholder-pseudo-element-and-placeholder-shown-pseudo-class-have-been-unprefixed/

Updated

a year ago
Blocks: 1301498

Updated

a year ago
Blocks: 1301499
Documented the changes:
https://developer.mozilla.org/en-US/docs/Web/CSS/:placeholder-shown
https://developer.mozilla.org/en-US/docs/Web/CSS/::placeholder
https://developer.mozilla.org/en-US/docs/Web/CSS/::-moz-placeholder
https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-placeholder
https://developer.mozilla.org/en-US/Firefox/Releases/51

Sebastian
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.