Bug 5715 - document.charset, document.defaultCharset, and document.characterSet are not supported
Summary: document.charset, document.defaultCharset, and document.characterSet are not ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Enhancement
Assignee: Dave Hyatt
URL: http://gemal.dk/browserspy/document.html
Depends on:
Reported: 2005-11-12 01:36 PST by Alexey Proskuryakov
Modified: 2005-12-26 14:08 PST (History)
0 users

See Also:

test case (563 bytes, text/html)
2005-11-12 01:37 PST, Alexey Proskuryakov
no flags Details
proposed patch (6.67 KB, patch)
2005-11-27 13:06 PST, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff
Patch using UTF8String() (6.68 KB, patch)
2005-11-27 21:27 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2005-11-12 01:36:46 PST
MSIE document.charset and document.defaultCharset are not supported in WebKit, see the bug URL.

Firefox document.characterSet is also not supported, see the attached test case.

document.charset and document.characterSet are apparently supposed to be read/write, not sure about 
Comment 1 Alexey Proskuryakov 2005-11-12 01:37:10 PST
Created attachment 4672 [details]
test case
Comment 2 Alexey Proskuryakov 2005-11-27 13:06:40 PST
Created attachment 4821 [details]
proposed patch

1) document.charset (MSIE, read-write)
2) document.defaultCharset (MSIE, read-only)
3) document.characterSet (Firefox, read-only)
4) document.actualEncoding (Firefox, old DOM3 drafts, read-only)
5) document.inputEncoding (actualEncoding was renamed so in DOM3; Firefox
doesn't support this yet).

Of related properties, doesn't implement xmlEncoding (also in DOM3) and
Comment 3 Darin Adler 2005-11-27 18:35:24 PST
Comment on attachment 4821 [details]
proposed patch

I think that the Charset setting code should use UTF8String() instead of
cstring(). The patch looks otherwise perfect, so I'm going to mark it review+
anyway, since cstring() seems OK.
Comment 4 Alexey Proskuryakov 2005-11-27 21:27:28 PST
Created attachment 4828 [details]
Patch using UTF8String()

Replaced cstring() with UTF8String()
Comment 5 Alexey Proskuryakov 2005-11-27 21:42:10 PST
Just noticed that dom/xhtml/level3/core/documentgetinputencoding01 now succeeds:-)
Comment 6 Alexey Proskuryakov 2005-11-29 01:54:43 PST
Verified (but the committed patch doesn't use UTF8String(), nor updates dom/xhtml/level3/core/
documentgetinputencoding01 results).