Skip to content

Commit 80e9be7

Browse files
committed
[selectors] Define pseudo-compounds, and that they are only present in complex selectors.
1 parent ae832ae commit 80e9be7

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

selectors-4/Overview.bs

+26-3
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,31 @@ Structure and Terminology</h3>
539539
no whitespace is allowed between the <a>simple selectors</a>
540540
in a <a>compound selector</a>.
541541

542+
A <dfn id=pseudo-compound>pseudo-compound selector</dfn>
543+
is a [=pseudo-element=] selector,
544+
optionally followed by additional [=pseudo-class=] selectors,
545+
without any [=combinators=].
546+
(A <a>pseudo-compound selector</a> is represented by <<pseudo-compound-selector>>
547+
in the selectors <a href="#grammar">grammar</a>.)
548+
A [=pseudo-element=] [=matches=] a [=pseudo-compound selector=]
549+
when it has the specified pseudo-element name,
550+
matches the additional conditions represented by any [=pseudo-classes=],
551+
and has an [=originating element=]
552+
represented by the adjacent preceding [=compound selector=].
553+
If there is no adjacent preceding [=compound selector=],
554+
the [=universal selector=] is assumed.
555+
(For example, ''.foo ::before''
556+
is equivalent to ''.foo *::before'',
557+
and distinct from ''.foo::before''.)
558+
559+
<div class=example>
560+
For example, in ''.foo::before:hover'',
561+
the ''.foo'' is a [=compound selector=],
562+
while the ''::before:hover'' is a [=pseudo-compound selector=].
563+
However, in ''.foo::before::marker'',
564+
''::before'' and ''::marker'' are separate [=pseudo-compound selectors=].
565+
</div>
566+
542567
A <dfn export for=selector>combinator</dfn>
543568
is a condition of relationship between two elements
544569
represented by the <a>compound selectors</a> on either side.
@@ -551,7 +576,7 @@ Structure and Terminology</h3>
551576
when the condition of relationship between these elements is true.
552577

553578
A <dfn id="complex" export>complex selector</dfn> is
554-
a sequence of one or more <a>compound selectors</a>
579+
a sequence of one or more <a>compound selectors</a> and/or [=pseudo-compound selectors=]
555580
separated by <a>combinators</a>.
556581
It represents a set of simultaneous conditions
557582
on a set of elements in the particular relationships
@@ -589,8 +614,6 @@ Structure and Terminology</h3>
589614
when it matches any (at least one) of the <a>selectors</a>
590615
in that <a>selector list</a>.
591616

592-
Issue: Pseudo-elements aren't handled here, and should be.
593-
594617
<h3 id='data-model'>
595618
Data Model</h3>
596619

0 commit comments

Comments
 (0)