Skip to content

Commit 53a057f

Browse files
committed
[selectors] Actually define the specificifity of :matches() properly.
1 parent 353bbef commit 53a057f

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

selectors/Overview.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3919,12 +3919,15 @@ <h2 id=specificity><span class=secno>15. </span> Calculating a selector's
39193919
</ul>
39203920

39213921
<p>The specificity of a <a href="#matches">:matches()</a> pseudo-class is
3922-
the specificity of its most specific argument. The specificity of a <a
3923-
href="#negation">:negation()</a> pseudo-class is the maximum specificity
3924-
of any of its component selectors. In either case, the pseudo-class itself
3925-
does not contribute any additional specificity. For example,
3926-
<code>:matches(em, strong)</code> has a specificity of (0,0,1), like a tag
3927-
selector.
3922+
the specificity of the most specific complex selector that matched. (The
3923+
full selector's specificity is equivalent to expanding out all the
3924+
combinations in full, without <a
3925+
href="#matches-pseudo"><code>:matches()</code></a>.) The specificity of a
3926+
<a href="#negation">:not()</a> pseudo-class is the specificity of the most
3927+
specifc complex selector in its selector list. In either case, the
3928+
pseudo-class itself does not contribute any additional specificity. For
3929+
example, <code>:matches(em, strong)</code> has a specificity of (0,0,1),
3930+
like a tag selector.
39283931

39293932
<p> Specificities are compared by comparing the three components in order:
39303933
the specificity with a larger <var>a</var> value is more specific; if the

selectors/Overview.src.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,9 +2842,10 @@ <h2 id="specificity">
28422842
</ul>
28432843

28442844
<p>The specificity of a <a href="#matches">:matches()</a> pseudo-class is
2845-
the specificity of its most specific argument.
2846-
The specificity of a <a href="#negation">:negation()</a> pseudo-class is
2847-
the maximum specificity of any of its component selectors.
2845+
the specificity of the most specific complex selector that matched.
2846+
(The full selector's specificity is equivalent to expanding out all the combinations in full, without <code>:matches()</code>.)
2847+
The specificity of a <a href="#negation">:not()</a> pseudo-class is
2848+
the specificity of the most specifc complex selector in its selector list.
28482849
In either case, the pseudo-class itself does not contribute any additional specificity.
28492850
For example, <code>:matches(em, strong)</code> has a specificity of (0,0,1), like a tag selector.
28502851

0 commit comments

Comments
 (0)