W3C home > Mailing lists > Public > www-validator-cvs@w3.org > December 2011

[Bug 15224] New: A class name can not be appended to a pseudo-element: p:first-line.some_class_name should be parsed as INVALID

From: <bugzilla@jessica.w3.org>
Date: Fri, 16 Dec 2011 02:54:19 +0000
To: www-validator-cvs@w3.org
Message-ID: <bug-15224-169@http.www.w3.org/Bugs/Public/>

           Summary: A class name can not be appended to a pseudo-element:
                    p:first-line.some_class_name should be parsed as
           Product: CSSValidator
           Version: CSS Validator
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: CSS 2.1
        AssignedTo: dave.null@w3.org
        ReportedBy: info@gtalbot.org
         QAContact: www-validator-cvs@w3.org

URL of test


Relevant chunk of CSS code

p:first-line.some_class_name { ... set of css declarations ...}

should be parsed as INVALID selector by the CSS validator because

CSS 2.1 section 5.10

CSS 2.1 states 
"pseudo-elements may only be appended after the last simple selector of the
section 5.10 Pseudo-elements and pseudo-classes

Additional info

Firefox 8.0 Error console reports this as a parsing error:
Warning : A token was found following a pseudo-element, which must be the last
part of a selector : « . ».  Set of rules ignored due to a bad selector.
File Source :
Line : 12

Opera 11.60 Error console reports this as a parsing error:
Inlined stylesheet
A pseudo element must be the last part of the selector.
Line 14:
     p:first-line.two { color: yellow; background: red; }

Even CSS 1 states
When combined with classes or pseudo-classes, pseudo-elements must be specified
at the end of the selector.
CSS 1, section 2.5 Pseudo-elements in selectors

URL of CSS validation report


Expected result

p:first-line.two should be reported as INVALID CSS code and rejected CSS code.

Actual result
p:first-line.two { ... } is reported as Valid CSS information

regards, Gérard Talbot

Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Friday, 16 December 2011 02:54:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:47 UTC