<?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>948</bug_id>
          
          <creation_ts>2004-11-18 05:58:44 +0000</creation_ts>
          <short_desc>Cannot parse some CSS comments when CSS file included in HTML</short_desc>
          <delta_ts>2005-08-26 14:29:22 +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>XHTML1.0</component>
          <version>CSS Validator</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.zap.org.au/documents/styles/sinorcaish/example/index.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="John Zaitseff">J.Zaitseff</reporter>
          <assigned_to name="Olivier Thereaux">ot</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>2640</commentid>
    <comment_count>0</comment_count>
    <who name="John Zaitseff">J.Zaitseff</who>
    <bug_when>2004-11-18 05:58:44 +0000</bug_when>
    <thetext>When I tried to validate the CSS of a sample page of mine, the validator 
complained that it could not parse certain items in the external print-only CSS 
file, even though that CSS file validated correctly by itself. 
 
In particular, if you try to validate 
http://www.zap.org.au/~john/web/sinorcaish/index.html, you will find that it 
complains about 
http://www.zap.org.au/~john/web/sinorcaish/sinorcaish-print.css.  The complaint 
is: 
 
    Line: 0 
    Parse Error - : none !important; } .notprinted 
 
    Line: 0 
    Parse Error - : 0 0 0.5em 0; } #main .highlight 
 
After much puzzling over this problem, I found that REMOVING the comments from 
inside the definitions made the Parse Error go away.  In other words, the 
following CSS (in that sinorcaish-print.css file) did not validate: 
 
    .hidden {   /* Used for content that should be displayed */ 
    /* by non-stylesheet-aware browsers          */ 
       display:         none !important; 
    } 
 
    .notprinted {  /* Used for content that should not be */ 
    /* printed to paper                    */ 
       display:         none !important; 
    } 
 
(and similarly for &quot;#main h1&quot; followed by &quot;#main .highlight&quot;), but the 
following version (ie, with comments removed) DID validate: 
 
    .hidden { 
       display:         none !important; 
    } 
 
    .notprinted { 
       display:         none !important; 
    } 
 
Not all such comments cause problems!  Removing the comments around &quot;#main 
h1&quot; / &quot;#main .highlight&quot; suddenly caused other definitions to be incorrectly 
parsed.  In other words, I cannot see the pattern behind it!  I can only 
suggest that comments that immediately follow a &quot;{&quot; are not handled correctly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2665</commentid>
    <comment_count>1</comment_count>
    <who name="John Zaitseff">J.Zaitseff</who>
    <bug_when>2004-12-01 06:39:34 +0000</bug_when>
    <thetext>The relevant page URL has been changed to: 
 
  http://www.zap.org.au/documents/styles/sinorcaish/example/index.html 
 
The relevant CSS is: 
 
  http://www.zap.org.au/documents/styles/sinorcaish/example/sinorcaish-print.css 
 </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5510</commentid>
    <comment_count>2</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2005-08-26 14:29:22 +0000</bug_when>
    <thetext>Fixed, see http://qa-dev.w3.org:8001/css-validator/</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>