<?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>3627</bug_id>
          
          <creation_ts>2006-08-26 00:18:58 +0000</creation_ts>
          <short_desc>Validator incorrectly reports failure when using CSS2 grammar - parses full-length numeric escapes incorrectly</short_desc>
          <delta_ts>2007-07-17 07:24:10 +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.0</component>
          <version>CSS Validator</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></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="CecilWard">cecil</reporter>
          <assigned_to name="Olivier Thereaux">ot</assigned_to>
          <cc>ylafon</cc>
          
          <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>11284</commentid>
    <comment_count>0</comment_count>
    <who name="CecilWard">cecil</who>
    <bug_when>2006-08-26 00:18:58 +0000</bug_when>
    <thetext>I believe that the following CSS2 fragment is legal CSS, if my reading of CSS 2 is correct, yet the validator incorrectly reports an error with grammar=CSS2 selected. Test case:

	selector { color: gr\000065en; }

Reasoning: in CSS2 no terminating space is required after a full-length numeric escape sequence, filled out to the maximum of six characters. So in CSS2 the property value is &quot;red&quot;. See the productions for &quot;escape&quot; in the CSS2 grammar.


[FYI, compare 
	selector { color: gre\000065n; }
	selector { color: r\000065 d; }
both of which is correctly reported as valid. It seems to be that the parser is reading characters after the sixth hex digit and parsing them as part of the number.]

Regards,

Cecil Ward.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14689</commentid>
    <comment_count>1</comment_count>
      <attachid>462</attachid>
    <who name="Peter Zhelezniakov">peter.zhelezniakov</who>
    <bug_when>2007-04-10 14:12:29 +0000</bug_when>
    <thetext>Created attachment 462
A patch

The idea of the patch is to terminate parsing of an escape sequence when either a non-digit is encountered, or six chars has been processed. In both cases whitespace following the escape sequence, if any, is skipped.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14690</commentid>
    <comment_count>2</comment_count>
      <attachid>462</attachid>
    <who name="Peter Zhelezniakov">peter.zhelezniakov</who>
    <bug_when>2007-04-10 14:14:00 +0000</bug_when>
    <thetext>Comment on attachment 462
A patch

The code in CssParser.convertStringIndex() fails to enforce the &quot;no more than 6 chars&quot; rule for escape sequences. In fact, it has a (count &lt; 6) check, but fails to increment the counter.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14700</commentid>
    <comment_count>3</comment_count>
      <attachid>463</attachid>
    <who name="Peter Zhelezniakov">peter.zhelezniakov</who>
    <bug_when>2007-04-12 13:35:52 +0000</bug_when>
    <thetext>Created attachment 463
CSS1 allows escape sequences 4 chars long maximum

CSS1 allows escape sequences to be 4 chars long maximum, while CSS2+ allows 6 chars. We need to conditionalize on CSS version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14867</commentid>
    <comment_count>4</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-04-24 10:27:59 +0000</bug_when>
    <thetext>Peter,

Your patch looks good to me. I commited it to CVS, so now we can test and move to prod if all looks good.

Yves, will you have a chance to double-check the patch?


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15822</commentid>
    <comment_count>5</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-07-17 07:24:10 +0000</bug_when>
    <thetext>CVS version now in production. Closing.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>462</attachid>
            <date>2007-04-10 14:12:29 +0000</date>
            <delta_ts>2007-04-10 14:12:29 +0000</delta_ts>
            <desc>A patch</desc>
            <filename>3627.patch</filename>
            <type>text/plain</type>
            <size>1403</size>
            <attacher name="Peter Zhelezniakov">peter.zhelezniakov</attacher>
            
              <data encoding="base64">SW5kZXg6IENzc1BhcnNlci5qYXZhCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9zb3VyY2VzL3B1Ymxp
Yy8yMDAyL2Nzcy12YWxpZGF0b3Ivb3JnL3czYy9jc3MvcGFyc2VyL2FuYWx5emVyL0Nzc1BhcnNl
ci5qYXZhLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjIxCmRpZmYgLXUgLXIxLjIxIENzc1BhcnNl
ci5qYXZhCi0tLSBDc3NQYXJzZXIuamF2YQkyNiBBcHIgMjAwNiAxMjo0NDoxNSAtMDAwMAkxLjIx
CisrKyBDc3NQYXJzZXIuamF2YQkxMCBBcHIgMjAwNyAxNDowOTo0MyAtMDAwMApAQCAtMzI3Nywx
OCArMzI3NywxOCBAQAogICAgICAgICAgICAgICAgIGNhc2UgJ2EnOiBjYXNlICdiJzogY2FzZSAn
Yyc6IGNhc2UgJ2QnOiBjYXNlICdlJzogY2FzZSAnZic6CiAgICAgICAgICAgICAgICAgY2FzZSAn
QSc6IGNhc2UgJ0InOiBjYXNlICdDJzogY2FzZSAnRCc6IGNhc2UgJ0UnOiBjYXNlICdGJzoKICAg
ICAgICAgICAgICAgICAgICAgaW50IG51bVZhbHVlID0gQ2hhcmFjdGVyLmRpZ2l0KGMsIDE2KTsK
LSAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKKyAgICAgICAgICAgICAgICAgICAg
aW50IGNvdW50ID0gMTsKICAgICAgICAgICAgICAgICAgICAgaW50IHAgPSAxNjsKIAotICAgICAg
ICAgICAgICAgICAgICB3aGlsZSAoaW5kZXggKyAxIDwgbGVuICYmIGNvdW50IDwgNikgeworICAg
ICAgICAgICAgICAgICAgICB3aGlsZSAoaW5kZXggKyAxIDwgbGVuKSB7CiAgICAgICAgICAgICAg
ICAgICAgICAgICBjID0gcy5jaGFyQXQoaW5kZXgrMSk7CiAKLSAgICAgICAgICAgICAgICAgICAg
ICAgIGlmIChDaGFyYWN0ZXIuZGlnaXQoYywgMTYpICE9IC0xKSB7CisgICAgICAgICAgICAgICAg
ICAgICAgICBpZiAoQ2hhcmFjdGVyLmRpZ2l0KGMsIDE2KSAhPSAtMSAmJiBjb3VudCsrIDwgNikg
ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bVZhbHVlID0gKG51bVZhbHVlICogMTYp
ICsgQ2hhcmFjdGVyLmRpZ2l0KGMsIDE2KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBw
ICo9IDE2OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4Kys7CiAgICAgICAgICAg
ICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChj
ID09ICcgJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjID09ICcgJyB8fCBj
ID09ICdcdCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2tpcCB0aGUg
bGF0ZXN0IHdoaXRlIHNwYWNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4
Kys7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>463</attachid>
            <date>2007-04-12 13:35:52 +0000</date>
            <delta_ts>2007-04-12 13:35:52 +0000</delta_ts>
            <desc>CSS1 allows escape sequences 4 chars long maximum</desc>
            <filename>3627.patch</filename>
            <type>text/plain</type>
            <size>1517</size>
            <attacher name="Peter Zhelezniakov">peter.zhelezniakov</attacher>
            
              <data encoding="base64">SW5kZXg6IENzc1BhcnNlci5qYXZhCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9zb3VyY2VzL3B1Ymxp
Yy8yMDAyL2Nzcy12YWxpZGF0b3Ivb3JnL3czYy9jc3MvcGFyc2VyL2FuYWx5emVyL0Nzc1BhcnNl
ci5qYXZhLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjIxCmRpZmYgLXUgLXIxLjIxIENzc1BhcnNl
ci5qYXZhCi0tLSBDc3NQYXJzZXIuamF2YQkyNiBBcHIgMjAwNiAxMjo0NDoxNSAtMDAwMAkxLjIx
CisrKyBDc3NQYXJzZXIuamF2YQkxMiBBcHIgMjAwNyAxMzoyODowMiAtMDAwMApAQCAtMzI3Nywx
OCArMzI3NywxOSBAQAogICAgICAgICAgICAgICAgIGNhc2UgJ2EnOiBjYXNlICdiJzogY2FzZSAn
Yyc6IGNhc2UgJ2QnOiBjYXNlICdlJzogY2FzZSAnZic6CiAgICAgICAgICAgICAgICAgY2FzZSAn
QSc6IGNhc2UgJ0InOiBjYXNlICdDJzogY2FzZSAnRCc6IGNhc2UgJ0UnOiBjYXNlICdGJzoKICAg
ICAgICAgICAgICAgICAgICAgaW50IG51bVZhbHVlID0gQ2hhcmFjdGVyLmRpZ2l0KGMsIDE2KTsK
LSAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKKyAgICAgICAgICAgICAgICAgICAg
aW50IGNvdW50ID0gMTsKICAgICAgICAgICAgICAgICAgICAgaW50IHAgPSAxNjsKLQotICAgICAg
ICAgICAgICAgICAgICB3aGlsZSAoaW5kZXggKyAxIDwgbGVuICYmIGNvdW50IDwgNikgeworICAg
ICAgICAgICAgICAgICAgICBpbnQgbWF4Q291bnQgPSAoYWMuZ2V0Q3NzVmVyc2lvbigpLmVxdWFs
cygiY3NzMSIpID8gNCA6IDYpOworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAg
ICAgICAgICAgIHdoaWxlIChpbmRleCArIDEgPCBsZW4pIHsKICAgICAgICAgICAgICAgICAgICAg
ICAgIGMgPSBzLmNoYXJBdChpbmRleCsxKTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgaWYg
KENoYXJhY3Rlci5kaWdpdChjLCAxNikgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAg
IGlmIChDaGFyYWN0ZXIuZGlnaXQoYywgMTYpICE9IC0xICYmIGNvdW50KysgPCBtYXhDb3VudCkg
ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bVZhbHVlID0gKG51bVZhbHVlICogMTYp
ICsgQ2hhcmFjdGVyLmRpZ2l0KGMsIDE2KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBw
ICo9IDE2OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4Kys7CiAgICAgICAgICAg
ICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChj
ID09ICcgJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjID09ICcgJyB8fCBj
ID09ICdcdCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2tpcCB0aGUg
bGF0ZXN0IHdoaXRlIHNwYWNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4
Kys7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>