<?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>5586</bug_id>
          
          <creation_ts>2008-03-23 06:59:34 +0000</creation_ts>
          <short_desc>Comment in selector before &gt; operator - [regression!] - in development snapshot only</short_desc>
          <delta_ts>2009-02-17 14:54:01 +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>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="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>ot</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>19600</commentid>
    <comment_count>0</comment_count>
    <who name="CecilWard">cecil</who>
    <bug_when>2008-03-23 06:59:34 +0000</bug_when>
    <thetext>See bug 4870, test case _#2_ (which was noted as being ok back then),

In the live development build http://qa-dev.w3.org:8001/css-validator/#validate_by_input this test case INCORRECTLY causes a parse error to be reported as of 2008-03-23, yet the public css validator behaves correctly. So there is a (potential) regression.

CSS fragment:
 a /**/&gt;  b { width:0}

I believe that this is valid CSS2.1. (At least, according to the new interpretation in the CSS2.1 errata http://www.w3.org/Style/css2-updates/CR-CSS21-20070719-errata.html )

Best,

Cecil Ward.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19616</commentid>
    <comment_count>1</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2008-03-26 21:00:37 +0000</bug_when>
    <thetext>The latest patch should resolve that issue, and consider in general SP followed by a comment as a SP (per CSS21 spec).

http://qa-dev.w3.org:8001/css-validator/  updated.
Thanks,</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23214</commentid>
    <comment_count>2</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2009-01-21 21:14:03 +0000</bug_when>
    <thetext>I have to reopen this one, as qa-dev.w3.org now gives:

Parse Error &gt; b
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23215</commentid>
    <comment_count>3</comment_count>
      <attachid>620</attachid>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2009-01-21 21:15:15 +0000</bug_when>
    <thetext>Created attachment 620
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23480</commentid>
    <comment_count>4</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2009-02-05 17:37:18 +0000</bug_when>
    <thetext>Hum... I see why.

COMMENT has been declared as a special token to be able to detect its presence in @charset and report it.

In the case of the combinators, it generates a match because of this:

    ( (   &lt;PLUS&gt; { connector = &apos;+&apos; ; }
        | &lt;GREATER&gt; { connector = &apos;&gt;&apos; ; }
        | &lt;TILDE&gt; { connector = &apos;~&apos; ; }
      ) ( &lt;S&gt; )* 
    | ( &lt;S&gt; )+ { connector = &apos; &apos; ; }
    )

Doing a/**/ &gt; b will work, as the special token is there before a &lt;S&gt; is parsed, however in the a /**/ &gt; b case, the special token forces the match
(&lt;S&gt;+) and exist form the combinator matching part.

More in this soon (I hope).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23490</commentid>
    <comment_count>5</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2009-02-05 22:11:44 +0000</bug_when>
    <thetext>One possible fix would be to replace
 &lt; #_S         : ( [ &quot; &quot;, &quot;\t&quot; , &quot;\n&quot; , &quot;\r&quot;, &quot;\f&quot; ]+ ) &gt;

by   
&lt; #_S         : ( [ &quot; &quot;, &quot;\t&quot; , &quot;\n&quot; , &quot;\r&quot;, &quot;\f&quot; ] ) ( &lt;COMMENT&gt; | [ &quot; &quot;, &quot;\t&quot; , &quot;\n&quot; , &quot;\r&quot;, &quot;\f&quot; ] )*  &gt;

@charset check will still work, comment is still detected when no space is before it, and it fixes this issue.
However, we should do more regression check to ensure that this workaround will work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23491</commentid>
    <comment_count>6</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2009-02-05 22:43:20 +0000</bug_when>
    <thetext>Also in the tests, we should add
a /**/ /**/&gt; b { color: green }
which should be reported as valid. (and incorrectly reported invalid by both the production and dev version of the validator).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23495</commentid>
    <comment_count>7</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2009-02-06 10:28:02 +0000</bug_when>
    <thetext>Fixed on qa-dev.w3.org (change to the grammar seems in sync with the scanner definition of comment handling)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23792</commentid>
    <comment_count>8</comment_count>
    <who name="CecilWard">cecil</who>
    <bug_when>2009-02-17 14:54:01 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; Fixed on qa-dev.w3.org (change to the grammar seems in sync with the scanner
&gt; definition of comment handling)

Agreed. Not only does it seem that this one issue is now fixed, but the grammar change mentioned earlier, which takes a brute-force approach to making comments go away when adjacent to whitespace, is a good thing everywhere surely.

It seems that the fix has been done without causing damage to the strict requirements of @charset, which is now appears to be parsed, as it needs to be, very much as a special case, more like an atomic unit, an approach which will make @charset safe from changes elsewhere in the grammar.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>620</attachid>
            <date>2009-01-21 21:15:15 +0000</date>
            <delta_ts>2009-01-21 21:15:15 +0000</delta_ts>
            <desc>test case</desc>
            <filename>5586.css</filename>
            <type>text/css</type>
            <size>22</size>
            <attacher name="Olivier Thereaux">ot</attacher>
            
              <data encoding="base64">YSAvKiovPiAgYiB7IHdpZHRoOjB9Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>