While they're not supposed to appear in the DOM, the way we currently implement pseudo-elements is hacky and inconsistent. We have to insert an extra Optional<PseudoElement::Type>
and remember to check it and behave differently if it's set. I keep finding this makes the code more awkward, or we just forget about them entirely. (Specs tend to just say "Element" to mean both real and pseudo-elements.)
I've discussed this a bit previously, and it seemed worth exploring. Working on animations has made me notice more places where we are having to work around the awkwardness, or forgetting pseudo-elements entirely. So, here's an issue to give it a more permanent home. I've no idea what other browsers do, but that might be worth considering too.
Reasons for DOM pseudo-elements:
::before
and ::after
and others that only sometimes exist.)Element::use_pseudo_element()
already lets an element behave as if it's a specific pseudo-element of its parent.Issues:
::first-line
are trickier to define as they overlap with their originating element's content.Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too