Bug 18692
Summary: | Incorrect charset declaration is not honored | ||
---|---|---|---|
Product: | WebKit | Reporter: | xijia <xijiay> |
Component: | Page Loading | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ap, mitz, xlyuan |
Priority: | P2 | ||
Version: | 525.x (Safari 3.1) | ||
Hardware: | PC | ||
OS: | All | ||
URL: | http://s.kuaiche.com/s/search?sid=1684&q=SnagIt%20V8.3.2%20Build%20014%20%E7%A0%B4%E8%A7%A3&stime=0.45721800%201208919835&srefer=http%3A%2F%2Fwww.tiansha.net%2Fdown%2Fsoft%2F708.htm&surl=a1804d9e8ffda43e721ecfa672f2a35c&r=99&s=0&t=0&f=0&p=0 |
xijia
[Steps]
1 Launch Safari 3.1.1
2 Navigate to http://s.kuaiche.com/s/search?sid=1684&q=SnagIt%20V8.3.2%20Build%20014%20%E7%A0%B4%E8%A7%A3&stime=0.45721800%201208919835&srefer=http%3A%2F%2Fwww.tiansha.net%2Fdown%2Fsoft%2F708.htm&surl=a1804d9e8ffda43e721ecfa672f2a35c&r=99&s=0&t=0&f=0&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'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
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
xijia
(In reply to comment #0)
> [Steps]
> 1 Launch Safari 3.1.1
> 2 Navigate to
> http://s.kuaiche.com/s/search?sid=1684&q=SnagIt%20V8.3.2%20Build%20014%20%E7%A0%B4%E8%A7%A3&stime=0.45721800%201208919835&srefer=http%3A%2F%2Fwww.tiansha.net%2Fdown%2Fsoft%2F708.htm&surl=a1804d9e8ffda43e721ecfa672f2a35c&r=99&s=0&t=0&f=0&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'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
>
If you look the meta charset declaration, it is <meta http-equiv="Content-Type" content="text/html; charset="gb2312" />, 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 ">", opening tag ends symbol, which is quoted.
part1 : http-equiv="Content-Type"
part2: content="text/html; charset="
part3: gb2312" />.......
So you see TextResourceDecoder::checkForHeadCharset can not find the end of meta tag, so it is failed to detect charset.
xijia
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
mitz
I think the context menu behavior is correct, but the incorrect decoding of the text might be a bug.
Alexey Proskuryakov
See also: bug 17740.
Alexey Proskuryakov
*** Bug 25107 has been marked as a duplicate of this bug. ***