W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2007

[Bug 4999] Validator fails to detect and report id selector starting with hyphen followed by a digit

From: <bugzilla@wiggum.w3.org>
Date: Sat, 01 Sep 2007 03:40:15 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1IRJqJ-0001kb-FS@wiggum.w3.org>


           Summary: Validator fails to detect and report id selector
                    starting with hyphen followed by a digit
           Product: CSSValidator
           Version: CSS Validator
          Platform: PC
               URL: http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/Hyph
        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

CSS validator, profile 2.1, incorrectly reports validity for case of id
selector starting with hyphen followed by a digit.

Steps to reproduce
1. Load provided URL
2. Submit to CSS validator (profile CSS 2.1) :
or just click the CSS button in that page

Actual results
CSS validator reports 
Your stylesheet validated (French: "Votre feuille de style CSS validée") :

#-2bar, .two {
color : red;
background-color : white;

Expected results
The CSS validator should detect the id selector starting with an hyphen
followed by a digit and then reject the css rule based on known parsing rules
and report a parse error for that css rule.


CSS 2.1, Section 4.1.3 Characters and case (identifiers) says:
"in CSS, identifiers (including element names, classes, and IDs in selectors)
can contain only the characters [a-z0-9] and ISO 10646 characters U+00A1 and
higher, plus the hyphen (-) and the underscore (_); they cannot start with a
digit, or a hyphen followed by a digit."

CSS 2.1, Section 4.1.1 tokenization 
CSS 2.1, G.2 Lexical scanner 
both gives
ident -?{nmstart}{nmchar}*
nmstart [_a-z]|{nonascii}|{escape}

Please note that I reported this issue at bugzilla.mozilla.org 
and at bugzilla.webkit.org
Received on Saturday, 1 September 2007 03:40:18 UTC

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