Skip to content

Commit f2035cb

Browse files
committed
[css2] Removed "calculation of specificity is object-language
dependent". Renamed "Cascading Order in HTML" to "Calculating a selector's specificity". Added that pseudo-classes are counted as classes and pseudo-element are not counted. --HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401049
1 parent 7845b6d commit f2035cb

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

css2/cascade.src

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22
<html lang="en">
3-
<!-- $Id: cascade.src,v 2.5 1998-02-21 00:04:43 ijacobs Exp $ -->
3+
<!-- $Id: cascade.src,v 2.6 1998-02-21 02:36:41 bbos Exp $ -->
44
<HEAD>
55
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66
<TITLE>Assigning property values, Cascading, and Inheritance</TITLE>
@@ -291,8 +291,9 @@ must apply the following algorithm:</p>
291291

292292
<LI>
293293
Sort by specificity of selector: more specific selectors will
294-
override more general ones. The definition and calculation of
295-
specificity is object-language dependent. Pseudo-elements and
294+
override more general ones. <!-- The definition and calculation of
295+
specificity is object-language dependent. [I don't think so. BB]-->
296+
(see <a href="#specificity">below</a>) Pseudo-elements and
296297
pseudo-classes are counted as normal elements and classes,
297298
respectively.
298299

@@ -356,16 +357,20 @@ since the author's "!important" rule takes precedence.</p>
356357
</div>
357358

358359

359-
<H3>Cascading order in HTML</H3>
360-
<P>In HTML, a selector's specificity is calculated as follows:</p>
360+
<H3><a name="specificity">Calculating a selector's specificity</a></H3>
361+
<P>A selector's specificity is calculated as follows:</p>
361362

362363
<ul>
363364
<li>(a) count the number of "id" attributes in the selector
364365
<li>(b) count the number of other attributes in the selector
365-
(including class attributes)
366366
<li>(c) count the number of element names in the selector
367367
</ul>
368368

369+
<p>Classes (only in selectors for HTML) and <a
370+
href="selector#pseudo-classes">pseudo-classes</a> are counted as
371+
attributes. <a href="selector#pseudo-elements">Pseudo-elements</a> are
372+
not counted.
373+
369374
<P>Concatenating the three numbers (in a number system with a large
370375
base) gives the specificity.
371376

0 commit comments

Comments
 (0)