<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>4999</bug_id>
          
          <creation_ts>2007-09-01 03:40:15 +0000</creation_ts>
          <short_desc>Validator fails to detect and report id selector starting with hyphen followed by a digit</short_desc>
          <delta_ts>2009-02-10 14:20:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSSValidator</product>
          <component>CSS 2.1</component>
          <version>CSS Validator</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/HyphenFollowedByADigitInIdentifiers.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gérard Talbot">info</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          
          
          <qa_contact name="qa-dev tracking">www-validator-cvs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>16342</commentid>
    <comment_count>0</comment_count>
    <who name="Gérard Talbot">info</who>
    <bug_when>2007-09-01 03:40:15 +0000</bug_when>
    <thetext>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) :
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.gtalbot.org%2FBrowserBugsSection%2FMSIE7Bugs%2FHyphenFollowedByADigitInIdentifiers.html&amp;amp;warning=2&amp;amp;profile=css21&amp;amp;usermedium=all
or just click the CSS button in that page

Actual results
--------------
CSS validator reports 
Your stylesheet validated (French: &quot;Votre feuille de style CSS validée&quot;) :

#-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.

References
----------

CSS 2.1, Section 4.1.3 Characters and case (identifiers) says:
&quot;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.&quot;
http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier

CSS 2.1, Section 4.1.1 tokenization 
http://www.w3.org/TR/CSS21/syndata.html#tokenization
and 
CSS 2.1, G.2 Lexical scanner 
http://www.w3.org/TR/CSS21/grammar.html#scanner
both gives
ident -?{nmstart}{nmchar}*
nmstart [_a-z]|{nonascii}|{escape}

Please note that I reported this issue at bugzilla.mozilla.org 
https://bugzilla.mozilla.org/show_bug.cgi?id=12385
and at bugzilla.webkit.org
http://bugs.webkit.org/show_bug.cgi?id=14373</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16352</commentid>
    <comment_count>1</comment_count>
    <who name="Gérard Talbot">info</who>
    <bug_when>2007-09-03 21:42:56 +0000</bug_when>
    <thetext>Same findings with one testpage of the latest (August 4th 2007) CSS 2.1 testsuite:

URL: http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t040103-ident-03-c.htm

CSS validation: 
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.w3.org%2FStyle%2FCSS%2FTest%2FCSS2.1%2Fcurrent%2Fhtml4%2Ft040103-ident-03-c.htm&amp;warning=1&amp;profile=css21&amp;usermedium=all

Returned result from CSS validator reporting &quot;Valid CSS Information&quot;:

#-1ident, .four {
color : red;
}

(...)

.-1ident, .five {
color : green;
} 

In both cases, the selectors starting with hyphen followed with a digit should be detected, rejected and reported as parse errors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23510</commentid>
    <comment_count>2</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2009-02-06 16:57:43 +0000</bug_when>
    <thetext>In

#-1ident, .four {
color : red;
}

#-1ident matches the HASH production which is defined as # &lt;NAME&gt;
(see &quot;#&quot;{name}	{return HASH;} in http://www.w3.org/TR/CSS21/grammar.html )
or name is defined by {nmchar}+ containing [0-9], so it is correct according t the grammar. I will check with the CSS WG.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23623</commentid>
    <comment_count>3</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2009-02-10 14:20:29 +0000</bug_when>
    <thetext>Fixed on http://qa-dev.w3.org:8001/css-validator/</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>