<?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>18692</bug_id>
          
          <creation_ts>2008-04-22 23:20:59 -0700</creation_ts>
          <short_desc>Incorrect charset declaration is not honored</short_desc>
          <delta_ts>2009-04-10 01:28:22 -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>525.x (Safari 3.1)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://s.kuaiche.com/s/search?sid=1684&amp;q=SnagIt%20V8.3.2%20Build%20014%20%E7%A0%B4%E8%A7%A3&amp;stime=0.45721800%201208919835&amp;srefer=http%3A%2F%2Fwww.tiansha.net%2Fdown%2Fsoft%2F708.htm&amp;surl=a1804d9e8ffda43e721ecfa672f2a35c&amp;r=99&amp;s=0&amp;t=0&amp;f=0&amp;p=0</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="xijia">xijiay</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>mitz</cc>
    
    <cc>xlyuan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>78622</commentid>
    <comment_count>0</comment_count>
    <who name="xijia">xijiay</who>
    <bug_when>2008-04-22 23:20:59 -0700</bug_when>
    <thetext>[Steps]
1 Launch Safari 3.1.1
2 Navigate to http://s.kuaiche.com/s/search?sid=1684&amp;q=SnagIt%20V8.3.2%20Build%20014%20%E7%A0%B4%E8%A7%A3&amp;stime=0.45721800%201208919835&amp;srefer=http%3A%2F%2Fwww.tiansha.net%2Fdown%2Fsoft%2F708.htm&amp;surl=a1804d9e8ffda43e721ecfa672f2a35c&amp;r=99&amp;s=0&amp;t=0&amp;f=0&amp;p=0
3 Click the first download link in this page (The green down arrow)
4 Observe

[Result]
1 The popped up page displayed as garbage
2 Right click on this page, the context menu doesn&apos;t show up

[Expected]
1 The page should be decoded correctly and no garbage
2 The context menu should pop up

[Notes]
View source of the popped up page from FF, you can see actually this page has meta charset declared</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78641</commentid>
    <comment_count>1</comment_count>
    <who name="xijia">xijiay</who>
    <bug_when>2008-04-23 04:40:36 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; [Steps]
&gt; 1 Launch Safari 3.1.1
&gt; 2 Navigate to
&gt; http://s.kuaiche.com/s/search?sid=1684&amp;q=SnagIt%20V8.3.2%20Build%20014%20%E7%A0%B4%E8%A7%A3&amp;stime=0.45721800%201208919835&amp;srefer=http%3A%2F%2Fwww.tiansha.net%2Fdown%2Fsoft%2F708.htm&amp;surl=a1804d9e8ffda43e721ecfa672f2a35c&amp;r=99&amp;s=0&amp;t=0&amp;f=0&amp;p=0
&gt; 3 Click the first download link in this page (The green down arrow)
&gt; 4 Observe
&gt; 
&gt; [Result]
&gt; 1 The popped up page displayed as garbage
&gt; 2 Right click on this page, the context menu doesn&apos;t show up
&gt; 
&gt; [Expected]
&gt; 1 The page should be decoded correctly and no garbage
&gt; 2 The context menu should pop up
&gt; 
&gt; [Notes]
&gt; View source of the popped up page from FF, you can see actually this page has
&gt; meta charset declared
&gt; 

If you look the meta charset declaration, it is &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=&quot;gb2312&quot; /&gt;, you will find there is a extra double quotation mark before the literal gb2312.
So the method TextResourceDecoder::checkForHeadCharset (WebKit code) will treat the attribute declaration part of the meta tag as more than three parts because it ignore &quot;&gt;&quot;, opening tag ends symbol,  which is quoted.
part1 : http-equiv=&quot;Content-Type&quot;
part2: content=&quot;text/html; charset=&quot;
part3: gb2312&quot; /&gt;.......
So you see TextResourceDecoder::checkForHeadCharset can not find the end of meta tag, so it is failed to detect charset.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78642</commentid>
    <comment_count>2</comment_count>
    <who name="xijia">xijiay</who>
    <bug_when>2008-04-23 04:42:15 -0700</bug_when>
    <thetext>The context menu could not be popped up because the author of this web page disabled it.   See the following script snippet from the page
document.oncontextmenu=function(event){event.returnValue=false;};

So it works as intended for second problem, however, when right click on IE and FF, the context menu can pop up</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78658</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-04-23 08:37:35 -0700</bug_when>
    <thetext>I think the context menu behavior is correct, but the incorrect decoding of the text might be a bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79153</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-04-28 11:17:16 -0700</bug_when>
    <thetext>See also: bug 17740.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117136</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-04-10 01:28:22 -0700</bug_when>
    <thetext>*** Bug 25107 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>