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 9107 - Incorrectly reports validity for various illegal pseudo-element usages
Summary: Incorrectly reports validity for various illegal pseudo-element usages
Status: NEW
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: CSS 2.1 (show other bugs)
Version: CSS Validator
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
: 15224 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-02-21 16:28 UTC by CecilWard
Modified: 2012-09-21 14:42 UTC (History)
2 users (show)

See Also:


Attachments

Description CecilWard 2010-02-21 16:28:54 UTC
The validator IMHO incorrectly reports validity for the following CSS 2.1 fragments (direct input entered)

Case #1 :
	a:first-line:first-line {}

Case #2 :
	a:first-line:lang(en) {}

Case #3 :
	a:first-line[attr] {}

Case #4 :
	a:first-line elem {}


According to the CSS2.1 grammar in appendix G, pretty much anything goes in respect of pseudo-element placement, so if the appendix G interpretation is accepted then the validator is correct in reporting each of the above as valid.

However, according to CSS2.1 section 5.2 (http://www.w3.org/TR/CSS2/selector.html#pattern-matching ) :
	"One pseudo-element may be appended to the last simple selector in a chain, .."

My interpretation of this is (a) I take the word "appended" to mean what it says, so a pseudo-element may only be in rightmost position. I assume that (b) zero or one pseudo elements may be present, and no more, and that (c) only the rightmost simple selector may have a pseudo-element.

So case #1 should fail because of my rules (a) and (b), case #2 and #3 should fail under (a), case #4 under (c).
Comment 1 carine bournez 2012-09-21 14:29:59 UTC
From http://www.w3.org/TR/CSS2/selector.html#pseudo-elements :

"Pseudo-classes are allowed anywhere in selectors while pseudo-elements may only be appended after the last simple selector of the selector." 

first-line is a pseudo-element, not a pseudo-class, so this is indeed a bug.
Comment 2 carine bournez 2012-09-21 14:42:47 UTC
*** Bug 15224 has been marked as a duplicate of this bug. ***