Skip to content

Commit cdcadbc

Browse files
committed
[selectors-4] Move some paragraphs around. (No actual changes.)
1 parent 2be5827 commit cdcadbc

1 file changed

Lines changed: 39 additions & 39 deletions

File tree

selectors/Overview.bs

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -501,45 +501,9 @@ Selector Syntax and Structure</h2>
501501
<h3 id="structure">
502502
Structure and Terminology</h3>
503503

504-
The <dfn export local-lt="subject">subject of a selector</dfn> is
505-
the element(s) that selector is defined to be about:
506-
507-
<ul>
508-
<li>For a <a>simple selector</a>, it is any element represented by that selector.
509-
<li>For a <a>compound selector</a>, it is any element that matches all of its composite <a>simple selectors</a>.
510-
<li>For a <a>complex selector</a>, it is any element that matches the last <a>compound selector</a> in the selector.
511-
<li>For a <a>selector list</a>, it is any any element that matches the any of the <a>selectors</a> in the list.
512-
</ul>
513-
514-
An element is said to <dfn export>match</dfn> a selector
515-
if it is a <a>subject</a> of that selector.
516-
Thus a selector consisting of a single <a>compound selector</a>
517-
matches any element satisfying its requirements.
518-
Prepending another <a>compound selector</a> and a <a>combinator</a>
519-
to a sequence imposes additional matching constraints,
520-
so the <a>subjects</a> of a <a>complex selector</a> are always a subset of
521-
the elements represented by its last <a>compound selector</a>.
522-
523-
Issue: Can we make this less wishy-washy by saying that a complex selector “represents” its last compound selector?
524-
Or do we need to have ''a + b'' “represent” both an "a" and a "b" in a sibling relationship?
525-
526504
The term <a>selector</a> can refer to a <a>simple selector</a>,
527505
<a>compound selector</a>, <a>complex selector</a>, or <a>selector list</a>.
528506

529-
A <dfn export>selector list</dfn> is a comma-separated list of <a>selectors</a>;
530-
see <a href="#grouping">Selector Lists</a>.
531-
532-
A <dfn id="complex" export>complex selector</dfn> is a sequence of one or more <a>compound selectors</a>
533-
separated by <a>combinators</a>.
534-
535-
A <dfn id="compound" export>compound selector</dfn>
536-
is a sequence of <a>simple selectors</a>
537-
that are not separated by a <a>combinator</a>.
538-
It represents an element that matches all of the <a>simple selectors</a> it contains.
539-
If it contains a <a>type selector</a> or <a>universal selector</a>,
540-
that selector must come first in the sequence.
541-
Only one type selector or universal selector is allowed in the sequence.
542-
543507
A <dfn id="simple" export>simple selector</dfn>
544508
represents an element matched by a particular aspect.
545509
A <a>type selector</a>,
@@ -550,6 +514,21 @@ Structure and Terminology</h3>
550514
or <a>pseudo-class</a>
551515
is a <a>simple selector</a>.
552516

517+
A <dfn id="compound" export>compound selector</dfn>
518+
is a sequence of <a>simple selectors</a>
519+
that are not separated by a <a>combinator</a>.
520+
It represents an element that matches all of the <a>simple selectors</a> it contains.
521+
If it contains a <a>type selector</a> or <a>universal selector</a>,
522+
that selector must come first in the sequence.
523+
Only one type selector or universal selector is allowed in the sequence.
524+
525+
Note: As whitespace is a valid <a>combinator</a>,
526+
no whitespace is allowed between the <a>simple selectors</a>
527+
in a <a>compound selector</a>.
528+
529+
A <dfn id="complex" export>complex selector</dfn> is a sequence of one or more <a>compound selectors</a>
530+
separated by <a>combinators</a>.
531+
553532
A <dfn export>combinator</dfn> represents a particular kind of relationship
554533
between the elements matched by the <a>compound selectors</a> on either side.
555534
Combinators in Selectors level 4 include:
@@ -560,9 +539,30 @@ Structure and Terminology</h3>
560539

561540
Issue: Fill in more combinators, if necessary.
562541

563-
Note: As whitespace is a valid <a>combinator</a>,
564-
no whitespace is allowed between the <a>simple selectors</a>
565-
in a <a>compound selector</a>.
542+
A <dfn export>selector list</dfn> is a comma-separated list of <a>selectors</a>;
543+
see <a href="#grouping">Selector Lists</a>.
544+
545+
The <dfn export local-lt="subject">subject of a selector</dfn> is
546+
the element(s) that selector is defined to be about:
547+
548+
<ul>
549+
<li>For a <a>simple selector</a>, it is any element represented by that selector.
550+
<li>For a <a>compound selector</a>, it is any element that matches all of its composite <a>simple selectors</a>.
551+
<li>For a <a>complex selector</a>, it is any element that matches the last <a>compound selector</a> in the selector.
552+
<li>For a <a>selector list</a>, it is any any element that matches the any of the <a>selectors</a> in the list.
553+
</ul>
554+
555+
An element is said to <dfn export>match</dfn> a selector
556+
if it is a <a>subject</a> of that selector.
557+
Thus a selector consisting of a single <a>compound selector</a>
558+
matches any element satisfying its requirements.
559+
Prepending another <a>compound selector</a> and a <a>combinator</a>
560+
to a sequence imposes additional matching constraints,
561+
so the <a>subjects</a> of a <a>complex selector</a> are always a subset of
562+
the elements represented by its last <a>compound selector</a>.
563+
564+
Issue: Can we make this less wishy-washy by saying that a complex selector “represents” its last compound selector?
565+
Or do we need to have ''a + b'' “represent” both an "a" and a "b" in a sibling relationship?
566566

567567
Issue: Pseudo-elements aren't handled here, and should be.
568568

0 commit comments

Comments
 (0)