New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 754081 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
NOT IN USE
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

::slotted() does not work with pseudo-element selector

Project Member Reported by tvanderlippe@google.com, Aug 10 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36

Steps to reproduce the problem:
1. Open https://jsbin.com/cesubirego/edit?html,output or see attached file
2. Check that the header does not have any content after it

The two selectors that I tried are:
`::slotted(h1::after)`
`::slotted(h1)::after`

What is the expected behavior?
The header should have a `/` after it.

What went wrong?
The header does not have a `/` after it.

Did this work before? No 

Does this work in other browsers? No
 Safari Technical Preview does not work with hover and focus and does not show the `/` after the header either.

Chrome version: 60.0.3112.90  Channel: stable
OS Version: 
Flash Version: 

According to the discussion in https://github.com/w3c/webcomponents/issues/331#issuecomment-210064594 the concensus seemed that `::after` should be placed after the `)`. However, reading the specification (https://drafts.csswg.org/css-scoping-1/#slotted-pseudo) the selector inside `::slotted()` is a `compound-selector-list` which boils down to a `simple-selector` which lists the `pseudo-element-selector` as one of its options.

Therefore I would expect that, despite the discussion on the GitHub issue, the first selector I tried should be the correct one.
 
slotted-after-bug.html
915 bytes View Download
Labels: -OS-Linux OS-All
Owner: r...@opera.com
Hi Rune - you're the expert here :) Can you confirm the expected behaviour?

Comment 2 by r...@opera.com, Aug 10 2017

Even though the issue was closed, the pseudo element on ::slotted() never reached a conclusion, I think. If you look at the specifications for :not() and :matches(), they both explicitly says pseudo elements are not allowed inside them. The CSS Scoping spec should probably say the same.

I've filed https://github.com/w3c/webcomponents/issues/655

Labels: Hotlist-Interop
Status: ExternalDependency (was: Unconfirmed)
Labels: Update-Monthly

Comment 6 by r...@opera.com, Aug 24 2017

Status: Started (was: ExternalDependency)
Resolved by CSSWG and specs edited.

CL for review.


Project Member

Comment 7 by bugdroid1@chromium.org, Aug 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/48d99fba8b1f52998570b163f51b114d87b08cdf

commit 48d99fba8b1f52998570b163f51b114d87b08cdf
Author: Rune Lillesveen <rune@opera.com>
Date: Mon Aug 28 12:58:47 2017

Support ::before and ::after pseudo elements after ::slotted.

Allow pseudo elements after ::slotted() pseudo elements to allow for
scopes to which an element has been slotted to generate ::before /
::after pseudo elements.

The scoping spec[1] allows tree-abiding[2] pseudo elements after
::slotted. This CL adds support for ::before and ::after.

[1] https://drafts.csswg.org/css-scoping/#slotted-pseudo
[2] https://drafts.csswg.org/css-pseudo-4/#treelike

Bug:  754081 
Change-Id: I95d91ea06d8fa75537cf8c845da477b2fb034a7d
Reviewed-on: https://chromium-review.googlesource.com/616042
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497742}
[add] https://crrev.com/48d99fba8b1f52998570b163f51b114d87b08cdf/third_party/WebKit/LayoutTests/external/wpt/css-scoping/slotted-parsing.html
[add] https://crrev.com/48d99fba8b1f52998570b163f51b114d87b08cdf/third_party/WebKit/LayoutTests/external/wpt/css-scoping/slotted-with-pseudo-element-ref.html
[add] https://crrev.com/48d99fba8b1f52998570b163f51b114d87b08cdf/third_party/WebKit/LayoutTests/external/wpt/css-scoping/slotted-with-pseudo-element.html
[modify] https://crrev.com/48d99fba8b1f52998570b163f51b114d87b08cdf/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
[modify] https://crrev.com/48d99fba8b1f52998570b163f51b114d87b08cdf/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp

Comment 8 by r...@opera.com, Aug 28 2017

Status: Fixed (was: Started)
Labels: allpublic

Sign in to add a comment