Summary: | Charset declared with document.write in an external Javascript is not honored | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jungshik Shin <jshin> |
Component: | Page Loading | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | abarth, ap, ian, playmobil |
Priority: | P3 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://i18nl10n.com/webkit/enc_extjs.html |
Description
Jungshik Shin
2008-02-05 11:41:02 PST
I believe that this is legal according to HTML5, so I'd like to track this as a bug. On the other hand, fixing it is not easy, and we match IE, so we probably won't fix it very soon.
> (For Naver, I'll talk to my contact there to FIX this).
That would be great - thank you very much!
In http://i18nl10n.com/webkit/enc_js2.html , charset is declared in an embedded javascript with document.write() and it's honored by webkit. (MS IE still does not honor it.). So, I'm removing parentheses around 'external javascript' in the summary. The root cause is that WebKit doesn't look at charset declarations when parsing HTML - we only check for those in a quick pre-parsing phase. It's a deficiency in this pre-parsing phase that it picks meta declarations even inside scripts. event.naver.com fixed itself a while ago (at least they added meta charset declaration at the beginning of an html file). I'm leaving this open because it's not filed as an evangelism bug for Naver but as a generic issue to deal with a meta charset declaration in an external JS file. http://www.yellowurl.cn/1549919.html has same problem. (In reply to comment #3) > The root cause is that WebKit doesn't look at charset declarations when parsing HTML - we only check for those in a quick pre-parsing phase. It's a deficiency in this pre-parsing phase that it picks meta declarations even inside scripts. This should be fixed now, right? No, this still happens - and I now think that this is a WONTFIX. Switching encodings after DOM has been partially constructed is nonsense. Ok. We should keep track of how often we run into compat problems from not making this change and re-evaluate if that happens too often. In comment #1, ap wrote that he thinks that it's legal in HTML 5. Is it still the case? If so, should we ask HTML5 WG to reconsider HTML5 spec regarding this practice in light of this decision (WONTFIX)? |