Skip to content

Commit ad45f9f

Browse files
committed
[selectors] Add complex-selector variants of :matches() and :not().
--HG-- extra : rebase_source : 3c1c30da67633e6449ab8c454763ec91cd38e78c
1 parent d343b64 commit ad45f9f

2 files changed

Lines changed: 59 additions & 52 deletions

File tree

selectors/Overview.html

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ <h2 class="no-num no-toc" id=contents>Table of Contents</h2>
182182
<li><a href="#overview"><span class=secno>2. </span> Selectors
183183
Overview</a>
184184
<ul class=toc>
185-
<li><a href="#profiles"><span class=secno>2.1. </span> "Fast" and
186-
"Complete" Profiles</a>
185+
<li><a href="#profiles"><span class=secno>2.1. </span> <i>Fast</i> vs
186+
<i>Complete</i> Selector Profiles</a>
187187
</ul>
188188

189189
<li><a href="#syntax"><span class=secno>3. </span> Selector Syntax and
@@ -1184,8 +1184,9 @@ <h2 id=overview><span class=secno>2. </span> Selectors Overview</h2>
11841184
introduced in <a href="#CSS3UI"
11851185
rel=biblioentry>[CSS3UI]<!--{{CSS3UI}}--></a>.
11861186

1187-
<h3 id=profiles><span class=secno>2.1. </span> "Fast" and "Complete"
1188-
Profiles</h3>
1187+
<h3 id=profiles><span class=secno>2.1. </span> <a
1188+
href="#fast-profile"><i>Fast</i></a> vs <a
1189+
href="#complete-profile"><i>Complete</i></a> Selector Profiles</h3>
11891190

11901191
<p> Selectors are used in many different contexts, with wildly varying
11911192
performance characteristics. Some powerful selectors are unfortunately too
@@ -1195,12 +1196,11 @@ <h3 id=profiles><span class=secno>2.1. </span> "Fast" and "Complete"
11951196
<dl>
11961197
<dt><dfn id=fast-profile>fast</dfn>
11971198

1198-
<dd> The ‘<a href="#fast-profile"><code class=css>fast</code></a>
1199-
profile is appropriate for use in any context, including dynamic browser
1200-
CSS selector matching. It includes every selector defined in this
1201-
document, except for:
1199+
<dd> The <a href="#fast-profile"><i>fast</i></a> profile is appropriate
1200+
for use in any context, including dynamic browser CSS selector matching.
1201+
It includes every selector defined in this document, except for:
12021202
<ul>
1203-
<li>The "complex selector" variants of<a
1203+
<li><a href="#combinator"><i>Combinators</i></a> within<a
12041204
href="#matches-pseudo"><code class=css>:matches()</code></a>’ and
12051205
<a href="#negation-pseudo"><code class=css>:not()</code></a>’.
12061206

@@ -1211,10 +1211,9 @@ <h3 id=profiles><span class=secno>2.1. </span> "Fast" and "Complete"
12111211

12121212
<dt><dfn id=complete-profile>complete</dfn>
12131213

1214-
<dd> The ‘<a href="#complete-profile"><code
1215-
class=css>complete</code></a>’ profile is appropriate for contexts
1216-
which aren't extremely performance sensitive. For example,
1217-
implementations of the Selectors API specification <a
1214+
<dd> The <a href="#complete-profile"><i>complete</i></a> profile is
1215+
appropriate for contexts which aren't extremely performance sensitive.
1216+
For example, implementations of the Selectors API specification <a
12181217
href="#SELECTORS-API"
12191218
rel=biblioentry>[SELECTORS-API]<!--{{SELECTORS-API}}--></a> should use
12201219
the ‘<a href="#complete-profile"><code class=css>complete</code></a>
@@ -1599,17 +1598,19 @@ <h3 id=matches><span class=secno>4.2. </span> The Matches-Any Pseudo-class:
15991598
list</a> as its argument. It represents an element that is represented by
16001599
its argument.
16011600

1602-
<p>In Selectors Level 4, only <a href="#compound">compound selectors</a>
1603-
are allowed within <a href="#matches-pseudo"><code>:matches()</code></a>:
1604-
<a href="#combinator">combinators</a> are not allowed. Additionally, <a
1605-
href="#matches-pseudo"><code>:matches()</code></a> may not be nested
1606-
within itself or within <a
1601+
<p>In the <a href="#fast-profile"><i>fast</i></a> Selectors profile, only
1602+
<a href="#compound"><i>compound selectors</i></a> are allowed within <a
1603+
href="#matches-pseudo"><code>:matches()</code></a>: <a
1604+
href="#combinator"><i>combinators</i></a> are not allowed. In the <a
1605+
href="#complete-profile"><i>complete</i></a> profile, full <a
1606+
href="#complex"><i>complex selectors</i></a> are allowed.
1607+
1608+
<p>The <a href="#matches-pseudo"><code>:matches()</code></a> pseudo-class
1609+
may not be nested within itself or within <a
16071610
href="#negation-pseudo"><code>:not()</code></a>:
16081611
<code>:matches(:matches(...))</code> and <code>:not(:matches(...))</code>
1609-
are invalid.
1610-
1611-
<p>Pseudo-elements cannot be represented by the matches-any pseudo-class;
1612-
they are not valid within <a
1612+
are invalid. Additionally, pseudo-elements cannot be represented by the
1613+
matches-any pseudo-class; they are not valid within <a
16131614
href="#matches-pseudo"><code>:matches()</code></a>.
16141615

16151616
<p>Default namespace declarations do not affect the subject of any selector
@@ -1640,21 +1641,24 @@ <h3 id=negation><span class=secno>4.3. </span> The Negation Pseudo-class:
16401641
an argument. It represents an element that is not represented by its
16411642
argument.
16421643

1643-
<p>In Selectors Level 4, only <a href="#compound">compound selectors</a>
1644-
are allowed within <a href="#negation-pseudo"><code>:not()</code></a>: <a
1645-
href="#combinator">combinators</a> are not allowed. Additionally, a
1646-
negation may not be nested within itself or within <a
1644+
<p>In the <a href="#fast-profile"><i>fast</i></a> Selectors profile, only
1645+
<a href="#compound"><i>compound selectors</i></a> are allowed within <a
1646+
href="#negation-pseudo"><code>:not()</code></a>: <a
1647+
href="#combinator"><i>combinators</i></a> are not allowed. In the <a
1648+
href="#complete-profile"><i>complete</i></a> profile, full <a
1649+
href="#complex"><i>complex selectors</i></a> are allowed.
1650+
1651+
<p class=note>In Selectors Level 3, only a single <a
1652+
href="#simple"><i>simple selector</i></a> was allowed as the argument to
1653+
<a href="#negation-pseudo"><code>:not()</code></a>.
1654+
1655+
<p>A negation may not be nested within itself or within <a
16471656
href="#matches-pseudo"><code>:matches()</code></a>:
16481657
<code>:not(:not(...))</code> and <code>:matches(:not(...))</code> are
1649-
invalid.
1650-
1651-
<p class=note>In Selectors Level 3, only a single <a href="#simple">simple
1652-
selector</a> was allowed as the argument to <a
1658+
invalid. Additionally, pseudo-elements cannot be represented by the
1659+
negation pseudo-class; they are not valid within <a
16531660
href="#negation-pseudo"><code>:not()</code></a>.
16541661

1655-
<p>Pseudo-elements cannot be represented by the negation pseudo-class; they
1656-
are not valid within <a href="#negation-pseudo"><code>:not()</code></a>.
1657-
16581662
<div class=example>
16591663
<p>For example, the following selector matches all <code>button</code>
16601664
elements in an HTML document that are not disabled.

selectors/Overview.src.html

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ <h2 id="overview">
520520
introduced in [[CSS3UI]].
521521

522522
<h3 id="profiles">
523-
"Fast" and "Complete" Profiles</h3>
523+
<i>Fast</i> vs <i>Complete</i> Selector Profiles</h3>
524524

525525
<p>
526526
Selectors are used in many different contexts,
@@ -532,20 +532,20 @@ <h3 id="profiles">
532532
<dl>
533533
<dt><dfn id='fast-profile'>fast</dfn>
534534
<dd>
535-
The ''fast'' profile is appropriate for use in any context,
535+
The <i>fast</i> profile is appropriate for use in any context,
536536
including dynamic browser CSS selector matching.
537537
It includes every selector defined in this document,
538538
except for:
539539

540540
<ul>
541-
<li>The "complex selector" variants of '':matches()'' and '':not()''.
541+
<li><i>Combinators</i> within '':matches()'' and '':not()''.
542542
<li>The <a href="idref-combinators">reference combinator</a>
543543
<li>The <a href="#subject">subject indicator</a>
544544
</ul>
545545

546546
<dt><dfn id='complete-profile'>complete</dfn>
547547
<dd>
548-
The ''complete'' profile is appropriate for contexts which aren't extremely performance sensitive.
548+
The <i>complete</i> profile is appropriate for contexts which aren't extremely performance sensitive.
549549
For example, implementations of the Selectors API specification [[SELECTORS-API]] should use the ''complete'' profile.
550550
It includes all of the selectors defined in this document.
551551
</dl>
@@ -876,14 +876,16 @@ <h3 id="matches">
876876
is a functional pseudo-class taking a <a href="#grouping">selector list</a>
877877
as its argument. It represents an element that is represented by its argument.
878878

879-
<p>In Selectors Level 4, only <a href="#compound">compound selectors</a>
879+
<p>In the <i>fast</i> Selectors profile, only <i>compound selectors</i>
880880
are allowed within <code>:matches()</code>:
881-
<a href="#combinator">combinators</a> are not allowed. Additionally,
882-
<code>:matches()</code> may not be nested within itself or within
883-
<code>:not()</code>: <code>:matches(:matches(...))</code> and
884-
<code>:not(:matches(...))</code> are invalid.
885-
886-
<p>Pseudo-elements cannot be represented by the matches-any pseudo-class;
881+
<i>combinators</i> are not allowed.
882+
In the <i>complete</i> profile,
883+
full <i>complex selectors</i> are allowed.
884+
885+
<p>The <code>:matches()</code> pseudo-class may not be nested within itself
886+
or within <code>:not()</code>:
887+
<code>:matches(:matches(...))</code> and <code>:not(:matches(...))</code> are invalid.
888+
Additionally, pseudo-elements cannot be represented by the matches-any pseudo-class;
887889
they are not valid within <code>:matches()</code>.
888890

889891
<p>Default namespace declarations do not affect the subject of any selector
@@ -910,17 +912,18 @@ <h3 id="negation">
910912
as an argument. It represents an element that is not represented
911913
by its argument.
912914

913-
<p>In Selectors Level 4, only <a href="#compound">compound selectors</a>
915+
<p>In the <i>fast</i> Selectors profile, only <i>compound selectors</i>
914916
are allowed within <code>:not()</code>:
915-
<a href="#combinator">combinators</a> are not allowed. Additionally,
916-
a negation may not be nested within itself or within <code>:matches()</code>:
917-
<code>:not(:not(...))</code> and <code>:matches(:not(...))</code> are invalid.
917+
<i>combinators</i> are not allowed.
918+
In the <i>complete</i> profile,
919+
full <i>complex selectors</i> are allowed.
918920

919-
<p class="note">In Selectors Level 3, only a single
920-
<a href="#simple">simple selector</a> was allowed as the argument to
921-
<code>:not()</code>.
921+
<p class="note">In Selectors Level 3,
922+
only a single <i>simple selector</i> was allowed as the argument to <code>:not()</code>.
922923

923-
<p>Pseudo-elements cannot be represented by the negation pseudo-class;
924+
<p>A negation may not be nested within itself or within <code>:matches()</code>:
925+
<code>:not(:not(...))</code> and <code>:matches(:not(...))</code> are invalid.
926+
Additionally, pseudo-elements cannot be represented by the negation pseudo-class;
924927
they are not valid within <code>:not()</code>.
925928

926929
<div class="example">

0 commit comments

Comments
 (0)