[selectors-4] Legacy :
pseudo-element cannot appear before type/subclass selectors
#8122
Labels
Closed Accepted as Editorial
Commenter Satisfied
Commenter has indicated satisfaction with the resolution / edits.
selectors-4
Current Work
Chrome/FF seems to parse
:before#id
or:before.class
as invalid (instead of valid and matching nothing) but I do not see on which part of the spec this is based.This does not make them invalid.
Legacy
:
pseudo-element syntax is defined in<subclass-selector>
as a<pseudo-class-selector>
.Subclass selectors can appear in any order while still selecting the same set of elements, but this is not true for a pseudo-element specified with the legacy single
:
syntax.Therefore I assume that
:before
must be handled as if it has been specified with::before
and matched<pseudo-element-selector>
. If so, it may be helpfull to define it in the spec.A similar confusion occurred to me when parsing a
<color-stop-list>
, whose syntax requires two color stops but its grammar accepts an implicit color stop defining two stops with the same color.The text was updated successfully, but these errors were encountered: