Skip to content

Commit 03e002b

Browse files
committed
[selectors] Also remove the nesting restriction from :matches().
1 parent cedf942 commit 03e002b

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

selectors/Overview.bs

+3-10
Original file line numberDiff line numberDiff line change
@@ -1197,24 +1197,17 @@ Selector Lists</h3>
11971197
The Matches-Any Pseudo-class: '':matches()''</h3>
11981198

11991199
The matches-any pseudo-class, <dfn id='matches-pseudo'>:matches()</dfn>,
1200-
is a functional pseudo-class taking a <a href="#grouping">selector list</a>
1200+
is a functional pseudo-class taking a <a>selector list</a>
12011201
as its argument. It represents an element that is represented by its argument.
12021202

1203-
The '':matches()'' pseudo-class may not be nested within itself
1204-
or within '':not()'':
1205-
'':matches(:matches(...))'' and '':not(:matches(...))'' are invalid.
1206-
Additionally, pseudo-elements cannot be represented by the matches-any pseudo-class;
1203+
Pseudo-elements cannot be represented by the matches-any pseudo-class;
12071204
they are not valid within '':matches()''.
12081205

1209-
Issue: This restriction probably isn't necessary.
1210-
If it is, it needs to be expanded,
1211-
since '':has()'' and '':nth-child()'' have the same functionality as '':matches()''.
1212-
12131206
Default namespace declarations do not affect any “implied” universal selectors
12141207
within a '':matches()'' pseudo-class.
12151208

12161209
<div class="example">
1217-
For example, following selector matches any element that is being
1210+
For example, the following selector matches any element that is being
12181211
hovered or focused, regardless of its namespace. In particular, it
12191212
is not limited to only matching elements in the default namespace
12201213
that are being hovered or focused.

selectors/Overview.html

+4-13
Original file line numberDiff line numberDiff line change
@@ -1439,24 +1439,17 @@ <h3 class="heading settled heading" data-level=4.2 id=matches><span class=secno>
14391439
The Matches-Any Pseudo-class: <a class=css data-link-type=maybe href=#matches-pseudo title=:matches()>:matches()</a></span><a class=self-link href=#matches></a></h3>
14401440

14411441
<p>The matches-any pseudo-class, <dfn class=css-code data-dfn-type=selector data-export="" id=matches-pseudo>:matches()<a class=self-link href=#matches-pseudo></a></dfn>,
1442-
is a functional pseudo-class taking a <a href=#grouping>selector list</a>
1442+
is a functional pseudo-class taking a <a data-link-type=dfn href=#selector-list title="selector list">selector list</a>
14431443
as its argument. It represents an element that is represented by its argument.</p>
14441444

1445-
<p>The <a class=css data-link-type=maybe href=#matches-pseudo title=:matches()>:matches()</a> pseudo-class may not be nested within itself
1446-
or within <a class=css data-link-type=maybe href=#negation-pseudo title=:not()>:not()</a>:
1447-
<span class=css data-link-type=maybe title=:matches(:matches(...))>:matches(:matches(...))</span> and <span class=css data-link-type=maybe title=:not(:matches(...))>:not(:matches(...))</span> are invalid.
1448-
Additionally, pseudo-elements cannot be represented by the matches-any pseudo-class;
1445+
<p>Pseudo-elements cannot be represented by the matches-any pseudo-class;
14491446
they are not valid within <a class=css data-link-type=maybe href=#matches-pseudo title=:matches()>:matches()</a>.</p>
14501447

1451-
<p class=issue id=issue-2adb46fb><a class=self-link href=#issue-2adb46fb></a>This restriction probably isn’t necessary.
1452-
If it is, it needs to be expanded,
1453-
since <a class=css data-link-type=maybe href=#has-pseudo title=:has()>:has()</a> and <a class=css data-link-type=maybe href=#nth-child-pseudo title=:nth-child()>:nth-child()</a> have the same functionality as <a class=css data-link-type=maybe href=#matches-pseudo title=:matches()>:matches()</a>.</p>
1454-
14551448
<p>Default namespace declarations do not affect any “implied” universal selectors
14561449
within a <a class=css data-link-type=maybe href=#matches-pseudo title=:matches()>:matches()</a> pseudo-class.</p>
14571450

14581451
<div class=example>
1459-
For example, following selector matches any element that is being
1452+
For example, the following selector matches any element that is being
14601453
hovered or focused, regardless of its namespace. In particular, it
14611454
is not limited to only matching elements in the default namespace
14621455
that are being hovered or focused.
@@ -3934,9 +3927,7 @@ <h2 class="no-num heading settled" id=issues-index><span class=content>Issues In
39343927
or should we stick with defaulting to *not* allowing,
39353928
and requiring individual pseudo-classes to specify that they work on pseudo-elements?
39363929

3937-
<a href=#issue-73b391d2></a></div><div class=issue>Explain this better.<a href=#issue-2422b936></a></div><div class=issue>This restriction probably isn’t necessary.
3938-
If it is, it needs to be expanded,
3939-
since <a class=css data-link-type=maybe href=#has-pseudo title=:has()>:has()</a> and <a class=css data-link-type=maybe href=#nth-child-pseudo title=:nth-child()>:nth-child()</a> have the same functionality as <a class=css data-link-type=maybe href=#matches-pseudo title=:matches()>:matches()</a>.<a href=#issue-2adb46fb></a></div><div class=issue>Add comma-separated syntax for
3930+
<a href=#issue-73b391d2></a></div><div class=issue>Explain this better.<a href=#issue-2422b936></a></div><div class=issue>Add comma-separated syntax for
39403931
<a href=http://lists.w3.org/Archives/Public/www-style/2011Mar/0215.html>multiple-value matching</a>?
39413932
e.g. [rel ~= next, prev, up, first, last]
39423933

0 commit comments

Comments
 (0)