Closed Bug 1955628 Opened 7 months ago Closed 6 months ago

Add support for ::details-content::before|::after

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1954142

People

(Reporter: nchevobbe, Unassigned)

References

Details

Adding pseudo elements to element-backed pseudo elements should work, e.g.

details::details-content::after {
  content: "In ::details-content::after";
}

https://drafts.csswg.org/css-pseudo-4/#element-like:

All pseudo-classes and pseudo-elements are syntactically allowed after an element-backed pseudo-element (such as x-button::part(label):hover or x-button::part(label)::before), just as if the pseudo-element were a type selector; but some are disallowed from matching:

  • The structural pseudo-classes, :has() pseudo-class, :scope pseudo-class, and :host/:host()/:host-context() pseudo-classes never match.
  • ::part() never matches. (Other element-backed pseudo-elements can, however.)

FWIW, on Chrome, navigating to data:text/html,<meta charset=utf8><!DOCTYPE html><style>details::details-content::after { content: "::details-content::after"; }</style><details open><summary>Example summary</summary><p>Hello</p></details>, I do see the after pseudo element being rendered.


cc'ing Emilio and Luke to check this is not covered by another bug

Type: defect → enhancement
Status: NEW → RESOLVED
Closed: 6 months ago
Duplicate of bug: 1954142
Resolution: --- → DUPLICATE

Hey, the parsing aspect of this is addressed we just need to update the selector matching to accommodate it which I've marked this bug as a duplicate of.

No longer blocks: 1955202

(In reply to Luke Warlow from comment #2)

Hey, the parsing aspect of this is addressed we just need to update the selector matching to accommodate it which I've marked this bug as a duplicate of.

perfect, thanks!

You need to log in before you can comment on or make changes to this bug.