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 15224 - A class name can not be appended to a pseudo-element: p:first-line.some_class_name should be parsed (and reported) as INVALID CSS code
Summary: A class name can not be appended to a pseudo-element: p:first-line.some_class...
Status: RESOLVED DUPLICATE of bug 9107
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: CSS 2.1 (show other bugs)
Version: CSS Validator
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL: http://jigsaw.w3.org/css-validator/va...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-16 02:54 UTC by Gérard Talbot
Modified: 2012-09-21 14:42 UTC (History)
1 user (show)

See Also:


Attachments

Description Gérard Talbot 2011-12-16 02:54:17 UTC
URL of test
-----------

http://test.csswg.org/suites/css2.1/20110323/html4/c25-pseudo-elmnt-000.htm


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 selector"
section 5.10 Pseudo-elements and pseudo-classes
http://www.w3.org/TR/CSS21/selector.html#pseudo-elements


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 : http://test.csswg.org/suites/css2.1/20110323/html4/c25-pseudo-elmnt-000.htm
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
http://www.w3.org/TR/CSS1/#pseudo-elements-in-selectors


URL of CSS validation report
----------------------------

http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Ftest.csswg.org%2Fsuites%2Fcss2.1%2F20110323%2Fhtml4%2Fc25-pseudo-elmnt-000.htm&profile=css21&usermedium=all&warning=2&vextwarning=&lang=en

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
Comment 1 carine bournez 2012-09-21 14:42:47 UTC
this is indeed a bug, as already reported.

*** This bug has been marked as a duplicate of bug 9107 ***