Closed Bug 1502617 Opened 6 years ago Closed 6 years ago

CSS ::slotted(*) selector does not recognize psuedo-elements

Categories

(Core :: CSS Parsing and Computation, defect)

63 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: git, Assigned: emilio)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0

Steps to reproduce:

<!doctype html>
<div id="host">
  <div>div1</div>
  <div>div2</div>
</div>
<script>
  host.attachShadow({ mode: "open" }).innerHTML = `
    <style>
      ::slotted(div)::before {
        content: '::before ';
      }
    </style>
    <slot></slot>
  `;
</script>


Actual results:

Two lines are displayed: "div1" and "div2".


Expected results:

Two lines should be displayed: "::before div1" and "::before div2".

The spec linked by MDN suggests that this should work and I've verified Chromium applies the ::slotted(div)::before rule.

https://developer.mozilla.org/en-US/docs/Web/CSS/::slotted
https://drafts.csswg.org/css-scoping/#slotted-pseudo
Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
Yeah... It should only work with ::before and ::after though, at least for now, see https://github.com/w3c/csswg-drafts/issues/3150.

This is easy enough to fix.
Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7ed6370bc7d
Support ::before / ::after on ::slotted pseudos. r=heycam
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/13768 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
https://hg.mozilla.org/mozilla-central/rev/b7ed6370bc7d
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
this still doesn't work.

::slotted(div)::after and ::slotted(div)::before are ignored.
Whoops, just found out that v65 wasn't released yet. Guess I'll have to wait till the end of January.
QA Whiteboard: [good first verify]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: