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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>23744</bug_id>
          
          <creation_ts>2009-02-04 14:45:50 -0800</creation_ts>
          <short_desc>stylesheet not applied because css file not parsed correctly if it contains comments and charset</short_desc>
          <delta_ts>2009-10-16 12:07:53 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>525.x (Safari 3.1)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>18265</dup_id>
          
          <bug_file_loc>http://csdraveurs.qc.ca/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="jasneet">jasneet</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>jasneet</cc>
    
    <cc>jeff</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>108335</commentid>
    <comment_count>0</comment_count>
    <who name="jasneet">jasneet</who>
    <bug_when>2009-02-04 14:45:50 -0800</bug_when>
    <thetext>I Steps:
Go to http://csdraveurs.qc.ca/

II Issue:
left navigation bar links have extra scroll bars

III Conclusion:
The issue is caused by the css file not being applied correctly because of the 
/*comment*/ and @charset in its contents. The css file looks like: 

/* Définition de règle */
@charset &quot;iso-8859-1&quot;;
.leftframe {color: 0067c6; font-family:  &quot;Times New Roman&quot;, Times, serif; font-size: 
10px; font-weight: bold; line-height: normal; text-align: center}

IV Other Browsers:
IE7: ok
FF3: ok

V Nightly tested: 40471

Bug in Chromium : http://code.google.com/p/chromium/issues/detail?id=5771</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108336</commentid>
    <comment_count>1</comment_count>
      <attachid>27330</attachid>
    <who name="jasneet">jasneet</who>
    <bug_when>2009-02-04 14:48:14 -0800</bug_when>
    <thetext>Created attachment 27330
testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109797</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-02-15 01:44:19 -0800</bug_when>
    <thetext>This is broken CSS - &quot;@charset&quot; should be the first bytes in file, except for BOM. But obviously, we should be more forgiving for compatibility with other browsers.

One thing we should test for is whether this charset is honored, or just ignored.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110384</commentid>
    <comment_count>3</comment_count>
    <who name="Taruchhaya">taruchhaya</who>
    <bug_when>2009-02-20 05:07:04 -0800</bug_when>
    <thetext>I have done some analysis on this bug.My observations are:

1) &quot;leftframe.css&quot; :: Issue is caused by the css file not being applied correctly because of the /*comment*/ and @charset in its contents. The css file looks like: 
/* Dfinition de rgle */
@charset &quot;iso-8859-1&quot;;
.leftframe {color: 0067c6; font-family: &quot;Times New Roman&quot;, Times, serif;
font-size: 10px; font-weight: bold; line-height: normal; text-lign: center}

Reason::The @charset At-Rule is allowed to occur only once in an external style sheet and it must be the very first statement in the style sheet. 

QUERIES:
1) &quot;/*comment*/&quot; is a valid CSS statement, which is escaped/ignored while executing the code. So shouldn&apos;t the same approach be followed in this case and @charset should be considered/honored.

While debugging the Grammar.y, I found that &quot;/*comment*/&quot; is not the issue. The issue is in &quot;/r&quot; &amp; &quot;/n&quot; after the comment, which is forcing the parser to consider the rest of the document as an invalid rule.

2) I also found another issue in this bug,i.e. in &quot;Link Tag&quot;.
Reason:: In Safari, Link Tag is not able to open/recognize the externally linked CSS file. 
As, HTML document contains the following snippet for link tag:
&lt;link href=&quot;leftframe.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
&lt;link href=&quot;../leftframe.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt; 

Here, In second link statement: &quot;../leftframe.css&quot; is invalid because it is trying to access the .css file from the root level, which is not available, webkit should check this condition and then resolve it by appending to the base URI just like how IE does.

Please provide me some suggestions on the above issues.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110386</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-02-20 05:19:08 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; 2) I also found another issue in this bug,i.e. in &quot;Link Tag&quot;.

Please file a new bug for this new issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110528</commentid>
    <comment_count>5</comment_count>
    <who name="Taruchhaya">taruchhaya</who>
    <bug_when>2009-02-22 20:51:10 -0800</bug_when>
    <thetext> Raised the new Bug ID: 24084:: &quot;Link Tag&quot; issue</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116849</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-04-08 01:59:09 -0700</bug_when>
    <thetext>See also: bug 18265 (@charset in inline CSS).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116853</commentid>
    <comment_count>7</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-04-08 02:28:22 -0700</bug_when>
    <thetext>*** Bug 23947 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155163</commentid>
    <comment_count>8</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2009-10-16 12:07:53 -0700</bug_when>
    <thetext>This is the same a Bug 18265 because the comment get stripped out by the tokenizer.

*** This bug has been marked as a duplicate of bug 18265 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>27330</attachid>
            <date>2009-02-04 14:48:14 -0800</date>
            <delta_ts>2009-02-04 14:48:14 -0800</delta_ts>
            <desc>testcase</desc>
            <filename>testcase.zip</filename>
            <type>application/zip</type>
            <size>895</size>
            <attacher name="jasneet">jasneet</attacher>
            
              <data encoding="base64">UEsDBBQAAAAIAKeSKDrMEVJ5AAEAAG0BAAAJAHEAdGVzdC5odG1sU0RcAKQAAAAACABGylEQY2Rg
aRBhYGAwYIAAHyBmZAUzWUWBxAyhcKZHhgE6q9SqOBx7mHDKMTIxMDAxRDAwg6VVGP4zyuM1h4FB
BKKGEaJGCExJQMSYIGIKQEIByAYAVVQNAAeZtGZJbLVmSSC0ZklNkE9PwkAQxe8mfodx7nYk4AVa
Ei1NJAEhtMZ4XNsp27i0ze5I4dvbLZC4l7fz5/3yMuHDYhNnX9sE3rL1CrYfr6tlDPhI9DmOiRbZ
4jKYBE8jouQdAbVIOyXqui7oxkFj95TtSMvBTMiJrXIJCilwfn8X+uagrAqvpqp/QFsuIzRcSmnV
gYPcOQTLJkInZ8NOMwuCnFuOUPgk5Be8m26Y76Y499r/iuoIuVHO/QMiDJwImyPb0jTdFNSvNDPo
qkL0FEbPo/Y0A83VXosv+8rzAQacMtW+jjDnWthe+v6F6hoc56skhXizXi/T9GW5S9KQ1MVOvX8I
etNr0JCuh/gDUEsDBBQAAAAIAAGTKDrcKUWMoQAAAMkAAAANAHEAbGVmdGZyYW1lLmNzc1NEXACk
AAAAAAgARspREGNkYGkQYWBgMGCAAB8gZmQFM1lFgcQMoXCmR4YBOqvUqjgce5hwyjEyMTAwMUQw
MIOlVRj+M8rjNYeBQQSihhGiRghMSUDEmCBiCkBCAcgGAFVUDQAHQbVmSYC1ZkkXtGZJLcq7CsIw
FAbgXfAdfjKWxtbBquni4OwgvkBsT9oDuUgSqBd8X30LQbp+fFWB49ew58zBoyfEz2AJRbVcHLpR
x0QZglOQu91mL9eiXS5Wlkw2UTvCqws2RIW6brZd08IEn6XRju1DAeLCjhJONOEcnPaixF9KJIps
5p74SQrr+nafYSIexqxwDbZvYdmTHGfyITptW2S6Z6ktD16hI58pvn9QSwECFwsUAAAACACnkig6
zBFSeQABAABtAQAACQARAAAAAAABACAAtoEAAAAAdGVzdC5odG1sU0QEAKQAAABVVAUAB5m0ZklQ
SwECFwsUAAAACAABkyg63ClFjKEAAADJAAAADQARAAAAAAABACAAtoGYAQAAbGVmdGZyYW1lLmNz
c1NEBACkAAAAVVQFAAdBtWZJUEsFBgAAAAACAAIAlAAAANUCAAAAAA==
</data>

          </attachment>
      

    </bug>

</bugzilla>