<?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>22952</bug_id>
          
          <creation_ts>2008-12-21 04:53:12 -0800</creation_ts>
          <short_desc>Cached CSS stylesheet reuses already-decoded form, even if it was decoded with the wrong charset</short_desc>
          <delta_ts>2010-05-24 15:24:30 -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>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>ian</cc>
    
    <cc>koivisto</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>103106</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-12-21 04:53:12 -0800</bug_when>
    <thetext>* SUMMARY
When a CSS stylesheet with no charset is first loaded, it gets the charset of the referring HTML document.  If a second HTML document includes the exact same CSS stylesheet, the stylesheet will continue using the charset of the first document instead of the second.

* STEPS TO REPRODUCE
1. Open the soon-to-be-attached test case on thie bug.
2. Open URL:  http://simon.html5.org/test/css/syndata/representation/001.htm

* RESULTS
No matter how many times the page is reloaded, &lt;http://simon.html5.org/test/css/syndata/representation/001.htm&gt; always fails until the WebCore cache is cleared.

* REGRESSION
On shipping Safari 3.2.1, subsequent reloads of &lt;http://simon.html5.org/test/css/syndata/representation/001.htm&gt; appear to fix the encoding.  On ToT WebKit, it doesn&apos;t change until the WebCore cache is cleared.

* NOTES
See Bug 11850 for the original analysis.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103107</commentid>
    <comment_count>1</comment_count>
      <attachid>26182</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-12-21 04:53:55 -0800</bug_when>
    <thetext>Created attachment 26182
Test case (Step 1)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103108</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-12-21 04:56:38 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; * RESULTS
&gt; No matter how many times the page is reloaded,
&gt; &lt;http://simon.html5.org/test/css/syndata/representation/001.htm&gt; always fails
&gt; until the WebCore cache is cleared.

Actually, clearing the WebCore cache doesn&apos;t seem to have an effect (nor does Cmd-Opt-E).  The only way to fix the charset is to restart the browser.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103110</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-12-21 04:59:10 -0800</bug_when>
    <thetext>When this bug is fixed, consider implementing (and thoroughly testing) this charset fallback mechanism:

http://www.w3.org/TR/CSS21/syndata.html#charset

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103116</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-12-21 09:18:35 -0800</bug_when>
    <thetext>A somewhat more practical manifestation of the same problem is tracked as: &lt;rdar://problem/5809774&gt; Safari doesn&apos;t reload scripts once Text Encoding is changed.

(In reply to comment #3)
&gt; When this bug is fixed, consider implementing (and thoroughly testing) this
&gt; charset fallback mechanism:
&gt; 
&gt; http://www.w3.org/TR/CSS21/syndata.html#charset

We have it implemented and tested already - are you aware of any bugs?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103122</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-12-21 10:19:21 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; When this bug is fixed, consider implementing (and thoroughly testing) this
&gt; &gt; charset fallback mechanism:
&gt; &gt; 
&gt; &gt; http://www.w3.org/TR/CSS21/syndata.html#charset
&gt; 
&gt; We have it implemented and tested already - are you aware of any bugs?

Great!  I guess I was looking for one method where the fallback logic was contained, but couldn&apos;t find it upon initial inspection.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103123</commentid>
    <comment_count>6</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2008-12-21 10:33:14 -0800</bug_when>
    <thetext>Using shift-reload fixes the problem in TOT. 

The bug here is that an existing cache entry should not be used if charset differs. The bug has been around for ever so it probably does not occur much in real world (though the recent reloading changes mean that it now needs shift-reload to fix instead of a regular reload).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103128</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-12-21 11:06:54 -0800</bug_when>
    <thetext>This seems like a minor issue since it only affects cases where the same stylesheet is used with different encodings. If this really was a common issue, we would want to detect cases where the stylesheet was entirely ASCII and so not affected by the encoding, because it would be a shame not to share the cached stylesheet in that case.

For testing and software development purposes, there could be some value to fixing this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>229941</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-05-24 15:24:30 -0700</bug_when>
    <thetext>See also: bug 27802.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>26182</attachid>
            <date>2008-12-21 04:53:55 -0800</date>
            <delta_ts>2008-12-21 04:53:55 -0800</delta_ts>
            <desc>Test case (Step 1)</desc>
            <filename>001.html</filename>
            <type>text/html;charset=shift-jis</type>
            <size>435</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxtZXRhIGh0dHAtZXF1aXY9IkNvbnRlbnQtVHlwZSIgY29udGVudD0i
dGV4dC9odG1sO2NoYXJzZXQ9c2hpZnQtamlzIj4KPHRpdGxlPnV0Zi04IGluIGV4dGVybmFsIHN0
eWxlc2hlZXQ8L3RpdGxlPgo8bGluayByZWw9InN0eWxlc2hlZXQiIGhyZWY9Imh0dHA6Ly9zaW1v
bi5odG1sNS5vcmcvdGVzdC9jc3Mvc3luZGF0YS9yZXByZXNlbnRhdGlvbi9zdXBwb3J0LzAwMS5j
c3MiPgo8bGluayByZWw9ImhlbHAiIGhyZWY9Imh0dHA6Ly93d3cudzMub3JnL1RSL0NTUzIxL3N5
bmRhdGEuaHRtbCNxMjMiPgo8IS0tIHdlYmtpdCAjMTEwMTEgLS0+CjxwPlRoZSBmb2xsb3dpbmcg
dHdvIGxpbmVzIHNob3VsZCBiZSBlcXVpdmFsZW50Ogo8ZGl2PknDsXTDq3Juw6J0acO0bsOgbGl6
w6Z0acO4bjwvZGl2Pgo8ZGl2IGlkPSJ0ZXN0Ij48L2Rpdj4K
</data>

          </attachment>
      

    </bug>

</bugzilla>