Skip to content

Commit bfebc13

Browse files
committed
[selectors] Define specificity of selector lists.
1 parent a8c487c commit bfebc13

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

selectors/Overview.bs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3086,6 +3086,10 @@ Calculating a selector's specificity</h2>
30863086
<li>ignore the universal selector
30873087
</ul>
30883088

3089+
If the selector is a <a>selector list</a>,
3090+
this number is calculated for each selector in the list,
3091+
and the specificity of the entire selector is the largest of any individual selector in the list.
3092+
30893093
In most cases, a selector has the same specificity for every element it applies to.
30903094
The specificity of a <a href="#matches">:matches()</a> pseudo-class, however,
30913095
is the specificity of the most specific complex selector that matched the given element.

selectors/Overview.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</p>
6060
<h1 class="p-name no-ref" id=title>Selectors Level 4</h1>
6161
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
62-
<span class=dt-updated><span class=value-title title=20140416>16 April 2014</span></span></span></h2>
62+
<span class=dt-updated><span class=value-title title=20140418>18 April 2014</span></span></span></h2>
6363
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/selectors>http://dev.w3.org/csswg/selectors</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/selectors/>http://www.w3.org/TR/selectors/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/selectors>http://dev.w3.org/csswg/selectors</a><dt>Previous Versions:<dd><a href=http://www.w3.org/TR/2013/WD-selectors4-20130502/ rel=previous>http://www.w3.org/TR/2013/WD-selectors4-20130502/</a><dd><a href=http://www.w3.org/TR/2012/WD-selectors4-20120823/ rel=previous>http://www.w3.org/TR/2012/WD-selectors4-20120823/</a><dd><a href=http://www.w3.org/TR/2011/WD-selectors4-20110929/ rel=previous>http://www.w3.org/TR/2011/WD-selectors4-20110929/</a>
6464
<dt>Feedback:</dt>
6565
<dd><a href="mailto:www-style@w3.org?subject=%5Bselectors%5D%20feedback">www-style@w3.org</a>
@@ -945,7 +945,7 @@ <h3 class="heading settled heading" data-level=3.4 id=scoping><span class=secno>
945945
to a particular subtree or fragment of the document.
946946
The root of the scoping subtree is called the <dfn data-dfn-type=dfn data-export="" id=scoping-root>scoping root<a class=self-link href=#scoping-root></a></dfn>,
947947
and may be either a true element (the <dfn data-dfn-type=dfn data-export="" id=scoping-element>scoping element<a class=self-link href=#scoping-element></a></dfn>)
948-
or a <dfn data-dfn-type=dfn data-export="" id=virtual-scoping-root title="virtual scoping root">virtual<a class=self-link href=#virtual-scoping-root></a></dfn> one (such as a <a class=idl-code data-link-type=interface title=documentfragment>DocumentFragment</a>).
948+
or a <dfn data-dfn-type=dfn data-export="" id=virtual-scoping-root title="virtual scoping root">virtual<a class=self-link href=#virtual-scoping-root></a></dfn> one (such as a <a class=idl-code data-link-type=interface href=http://dom.spec.whatwg.org/#documentfragment title=documentfragment>DocumentFragment</a>).
949949

950950
<p> There are two <dfn data-dfn-type=dfn data-export="" id=scoping-method- title="scoping method | selector scoping method">scoping methods<a class=self-link href=#scoping-method-></a></dfn> for selectors:
951951

@@ -2673,7 +2673,7 @@ <h3 class="heading settled heading" data-level=12.1 id=the-root-pseudo><span cla
26732673
the root of the document.
26742674

26752675
<p> For example, in a DOM document,
2676-
the <a class=css data-link-type=maybe href=#root-pseudo title=:root>:root</a> pseudo-class matches the root element of the <a class=idl-code data-link-type=interface href=http://www.w3.org/html/wg/drafts/html/CR/infrastructure.html#dom-document title=document>Document</a> object.
2676+
the <a class=css data-link-type=maybe href=#root-pseudo title=:root>:root</a> pseudo-class matches the root element of the <a class=idl-code data-link-type=interface href=http://dom.spec.whatwg.org/#document title=document>Document</a> object.
26772677
In HTML, this would be the <a data-link-type=element href=http://www.w3.org/html/wg/drafts/html/CR/semantics.html#the-html-element title=html>html</a> element
26782678
(unless scripting has been used to modify the document).
26792679

@@ -3196,6 +3196,10 @@ <h2 class="heading settled heading" data-level=15 id=specificity><span class=sec
31963196
<li>ignore the universal selector
31973197
</ul>
31983198

3199+
<p> If the selector is a <a data-link-type=dfn href=#selector-list title="selector list">selector list</a>,
3200+
this number is calculated for each selector in the list,
3201+
and the specificity of the entire selector is the largest of any individual selector in the list.
3202+
31993203
<p> In most cases, a selector has the same specificity for every element it applies to.
32003204
The specificity of a <a href=#matches>:matches()</a> pseudo-class, however,
32013205
is the specificity of the most specific complex selector that matched the given element.

0 commit comments

Comments
 (0)