@@ -1821,7 +1821,7 @@ <h4 id=nth-child-pseudo><span class=secno>7.4.2. </span> :nth-child()
18211821 tr:nth-child(odd) /* same */
18221822 tr:nth-child(2n+0) /* represents every even row of an HTML table */
18231823 tr:nth-child(even) /* same */
1824-
1824+
18251825 /* Alternate paragraph colours in CSS */
18261826 p:nth-child(4n+1) { color: navy; }
18271827 p:nth-child(4n+2) { color: green; }
@@ -1934,7 +1934,7 @@ <h4 id=nth-last-child-pseudo><span class=secno>7.4.3. </span>
19341934 < p > Examples:</ p >
19351935
19361936 < pre > tr:nth-last-child(-n+2) /* represents the two last rows of an HTML table */
1937-
1937+
19381938 foo:nth-last-child(odd) /* represents all odd foo elements in their parent element,
19391939 counting from the last one */</ pre >
19401940 </ div >
@@ -2399,42 +2399,42 @@ <h3 id=grammar><span class=secno>10.1. </span> Grammar</h3>
23992399 < pre > selectors_group
24002400 : selector [ COMMA S* selector ]*
24012401 ;
2402-
2402+
24032403 selector
24042404 : compound_selector [ combinator simple_selector_sequence ]*
24052405 ;
2406-
2406+
24072407 combinator
24082408 /* combinators can be surrounded by whitespace */
24092409 : PLUS S* | GREATER S* | TILDE S* | S+
24102410 ;
2411-
2411+
24122412 simple_selector_sequence
24132413 : [ type_selector | universal ]
24142414 [ HASH | class | attrib | pseudo | negation ]*
24152415 | [ HASH | class | attrib | pseudo | negation ]+
24162416 ;
2417-
2417+
24182418 type_selector
24192419 : [ namespace_prefix ]? element_name
24202420 ;
2421-
2421+
24222422 namespace_prefix
24232423 : [ IDENT | '*' ]? '|'
24242424 ;
2425-
2425+
24262426 element_name
24272427 : IDENT
24282428 ;
2429-
2429+
24302430 universal
24312431 : [ namespace_prefix ]? '*'
24322432 ;
2433-
2433+
24342434 class
24352435 : '.' IDENT
24362436 ;
2437-
2437+
24382438 attrib
24392439 : '[' S* [ namespace_prefix ]? IDENT S*
24402440 [ [ PREFIXMATCH |
@@ -2445,29 +2445,29 @@ <h3 id=grammar><span class=secno>10.1. </span> Grammar</h3>
24452445 DASHMATCH ] S* [ IDENT | STRING ] S*
24462446 ]? ']'
24472447 ;
2448-
2448+
24492449 pseudo
24502450 /* '::' starts a pseudo-element, ':' a pseudo-class */
24512451 /* Exceptions: :first-line, :first-letter, :before and :after. */
24522452 /* Note that pseudo-elements are restricted to one per selector and */
24532453 /* occur only in the last compound_selector. */
24542454 : ':' ':'? [ IDENT | functional_pseudo ]
24552455 ;
2456-
2456+
24572457 functional_pseudo
24582458 : FUNCTION S* expression ')'
24592459 ;
2460-
2460+
24612461 expression
24622462 /* In CSS3, the expressions are identifiers, strings, */
24632463 /* or of the form "an+b" */
24642464 : [ [ PLUS | '-' | DIMENSION | NUMBER | STRING | IDENT ] S* ]+
24652465 ;
2466-
2466+
24672467 negation
24682468 : NOT S* negation_arg S* ')'
24692469 ;
2470-
2470+
24712471 negation_arg
24722472 : type_selector | universal | HASH | class | attrib | pseudo
24732473 ;</ pre >
@@ -2485,7 +2485,7 @@ <h3 id=lex><span class=secno>10.2. </span> Lexical scanner</h3>
24852485 rel =biblioentry > [UNICODE]<!--{{!UNICODE}}--> </ a >
24862486
24872487 < pre > %option case-insensitive
2488-
2488+
24892489 ident [-]?{nmstart}{nmchar}*
24902490 name {nmchar}+
24912491 nmstart [_a-z]|{nonascii}|{escape}
@@ -2502,18 +2502,18 @@ <h3 id=lex><span class=secno>10.2. </span> Lexical scanner</h3>
25022502 invalid2 \'([^\n\r\f\\']|\\{nl}|{nonascii}|{escape})*
25032503 nl \n|\r\n|\r|\f
25042504 w [ \t\r\n\f]*
2505-
2505+
25062506 D d|\\0{0,4}(44|64)(\r\n|[ \t\r\n\f])?
25072507 E e|\\0{0,4}(45|65)(\r\n|[ \t\r\n\f])?
25082508 N n|\\0{0,4}(4e|6e)(\r\n|[ \t\r\n\f])?|\\n
25092509 O o|\\0{0,4}(4f|6f)(\r\n|[ \t\r\n\f])?|\\o
25102510 T t|\\0{0,4}(54|74)(\r\n|[ \t\r\n\f])?|\\t
25112511 V v|\\0{0,4}(58|78)(\r\n|[ \t\r\n\f])?|\\v
2512-
2512+
25132513 %%
2514-
2514+
25152515 [ \t\r\n\f]+ return S;
2516-
2516+
25172517 "~=" return INCLUDES;
25182518 "|=" return DASHMATCH;
25192519 "^=" return PREFIXMATCH;
@@ -2535,9 +2535,9 @@ <h3 id=lex><span class=secno>10.2. </span> Lexical scanner</h3>
25352535 {num}{ident} return DIMENSION;
25362536 "<!--" return CDO;
25372537 "-->" return CDC;
2538-
2538+
25392539 \/\*[^*]*\*+([^/*][^*]*\*+)*\/ /* ignore comments */
2540-
2540+
25412541 . return *yytext;</ pre >
25422542
25432543 < h2 id =profiling > < span class =secno > 11. </ span > Profiles</ h2 >
@@ -2773,7 +2773,7 @@ <h3 id=experimental><span class=secno>12.3. </span> Experimental
27732773 be correctly implemented according to spec.</ p >
27742774 <!--
27752775 <h2 id=Tests>Tests</h2>
2776-
2776+
27772777 <p>This specification has <a
27782778 href="http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/">a test
27792779 suite</a> allowing user agents to verify their basic conformance to
0 commit comments