Skip to content

[css-scoping-1] ::placeholder selector inside ::slotted() not working #3150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jorenbroekema opened this issue Sep 25, 2018 · 9 comments
Closed
Labels
css-scoping-1 Current Work

Comments

@jorenbroekema
Copy link

Referencing this issue #1747

Working as intended:
::slotted(::hover){ color: red; }

Not working:
::slotted(::placeholder){ color: red; }

From the issue I am referencing, it seems like it is supposed to not work in both scenarios, as option 3 was chosen to be allowed and option 2 was not. So basically, ::slotted()::hover should work but ::slotted(::hover) should not. At least, this was my interpretation of that issue.

Could someone give some clarification on what should work and what should not, and perhaps why in my case the ::placeholder selector within ::slotted does not work?

@emilio
Copy link
Collaborator

emilio commented Sep 25, 2018

:hover is a pseudo-class, ::placeholder a pseudo-element. ::slotted(::placeholder) should not work, though arguably ::slotted(*)::placeholder should, per that issue.

@tabatkins
Copy link
Member

Yeah, the argument to ::slotted() is a selector that is matched against the elements that get slotted. By definition, none of these elements are pseudo-elements, so ::slotted(::placeholder) can never match anything.

But yeah, ::slotted()::placeholder should work, and if it doesn't, that's a browser bug.

(::slotted(::hover) definitely shouldn't be working, as there's no pseudo-element named ::hover. Are you sure you actually have that precise selector in your stylesheet, or do you have ::slotted(:hover) instead?)

@emilio
Copy link
Collaborator

emilio commented Oct 27, 2018

Actually I think this is a valid issue. The resolution in #1747 only referenced tree-abiding pseudos (::before / ::after).

I actually have an implementation that works for all pseudos, but I don't plant to land it without a resolution here.

@emilio emilio reopened this Oct 27, 2018
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 29, 2018
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 29, 2018
See w3c/csswg-drafts#3150 for the issue that would
expand this to all pseudos.

Differential Revision: https://phabricator.services.mozilla.com/D9994

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1502617
gecko-commit: b7ed6370bc7d11c486ca86f74ba7e4bc00b471af
gecko-integration-branch: mozilla-inbound
gecko-reviewers: heycam
xeonchen pushed a commit to xeonchen/gecko-cinnabar that referenced this issue Oct 30, 2018
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 31, 2018
See w3c/csswg-drafts#3150 for the issue that would
expand this to all pseudos.

Differential Revision: https://phabricator.services.mozilla.com/D9994

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1502617
gecko-commit: b7ed6370bc7d11c486ca86f74ba7e4bc00b471af
gecko-integration-branch: mozilla-inbound
gecko-reviewers: heycam
emilio added a commit to emilio/servo that referenced this issue Nov 5, 2018
emilio added a commit to emilio/servo that referenced this issue Nov 5, 2018
See w3c/csswg-drafts#3150 for the issue that would
expand this to all pseudos.

Differential Revision: https://phabricator.services.mozilla.com/D9994
@lilles
Copy link
Member

lilles commented Nov 6, 2018

According to css-pseudo-4, the tree-abiding pseudos are: ::before, ::after, ::marker, ::placeholder. So it currently follows from the specs that ::placeholder should be allowed after ::slotted().

There's no limitation in Blink that makes it hard to support any kind of pseudo elements after ::slotted(), but the previous CSSWG resolution was to limit this.

Reported Blink issue: https://crbug.com/902518

@emilio
Copy link
Collaborator

emilio commented Nov 6, 2018

Ah, alright, true that. I'll fixup firefox as well.

@emilio
Copy link
Collaborator

emilio commented Nov 6, 2018

(I agree this is invalid then, just a browser bug)

@emilio emilio closed this as completed Nov 6, 2018
@emilio
Copy link
Collaborator

emilio commented Nov 6, 2018

@emilio emilio removed the Agenda+ label Nov 7, 2018
@lilles
Copy link
Member

lilles commented Nov 7, 2018

Wasn't quite as simple in Blink: https://chromium-review.googlesource.com/c/chromium/src/+/1323049

gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
See w3c/csswg-drafts#3150 for the issue that would
expand this to all pseudos.

Differential Revision: https://phabricator.services.mozilla.com/D9994

UltraBlame original commit: b7ed6370bc7d11c486ca86f74ba7e4bc00b471af
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
See w3c/csswg-drafts#3150 for the issue that would
expand this to all pseudos.

Differential Revision: https://phabricator.services.mozilla.com/D9994

UltraBlame original commit: b7ed6370bc7d11c486ca86f74ba7e4bc00b471af
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
See w3c/csswg-drafts#3150 for the issue that would
expand this to all pseudos.

Differential Revision: https://phabricator.services.mozilla.com/D9994

UltraBlame original commit: b7ed6370bc7d11c486ca86f74ba7e4bc00b471af
@jholt1
Copy link

jholt1 commented Mar 8, 2022

Adding here in case others are searching for this:

Webkit has yet to fix the bug https://bugs.webkit.org/show_bug.cgi?id=223814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-scoping-1 Current Work
Projects
None yet
Development

No branches or pull requests

5 participants