This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5841 - The validator accepts invalid notation for most pseudo-class selectors and 1 pseudo-element selector
Summary: The validator accepts invalid notation for most pseudo-class selectors and 1 ...
Status: ASSIGNED
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: CSS 3 (show other bugs)
Version: CSS Validator
Hardware: Macintosh Mac System 9.x
: P2 major
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL: http://malform.no/CSS-test/pseudo-sel...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-08 12:29 UTC by Leif Halvard Silli
Modified: 2009-02-26 14:00 UTC (History)
0 users

See Also:


Attachments
Test case. Same content as the URL I am pointing to. (1.71 KB, text/css)
2008-07-08 12:34 UTC, Leif Halvard Silli
Details

Description Leif Halvard Silli 2008-07-08 12:29:26 UTC
(1) Pseudo-element notation requires **double** colon notation. For example: FOO::selection{}. The only exception is that single colon is permitted for the 4 pseudo-elements from CSS 2.1, namely :first-line, :first-letter, :before and :after.

Therefore, because ::selection is a new (and seemling the *only* new ) CSS 3 pseudo-element, the double colon notation is therefore required for the ::selection{} selector. And it is therefore incorrect when the Validator accepts as valid the following: 

       FOO:selection{background:lime} 

(2) LIKEWISE, pseudo-class notation always  requires a **single** colon, for example:  FOO:link{}.  

Therefore, it is incorrect when the CSS Validator stamps the following selectors as valid:

    ::link,::visited,::active,::focus,::hover,::target, ::root,::first-child,::last-child,::checked, ::enabled,::disabled,::indeterminate,:not(::link)  {}

(3) For reference: The only times the CSS validiator correctly rejects double colon notation for pseudo-class selectors, is for the following (note that all these selectors include a paranthesis):

    ::not(*),::nth-child(1),::nth-last-child(2),::nth-of-type(2),::nth-last-of-type(2){color:red;}

(4) Note that :not(::link) currently gets accepted, whereas ::not(::link) does not.

See CSS 3 about pseudo-elements: http://www.w3.org/TR/css3-selectors/#pseudo-elements
Comment 1 Leif Halvard Silli 2008-07-08 12:34:37 UTC
Created attachment 560 [details]
Test case. Same content as the URL I am pointing to.
Comment 2 Yves Lafon 2009-02-26 08:16:27 UTC
Although I am not entirely happy yet with the function parsing part, the validator is at least reporting the right errors, the handling of : and :: pseudo selectors was indeed wrong.
Fixed on http://qa-dev.w3.org:8001/css-validator/