Bug 5715

Summary: document.charset, document.defaultCharset, and document.characterSet are not supported
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: DOMAssignee: Dave Hyatt <hyatt>
Status: VERIFIED FIXED    
Severity: Enhancement    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://gemal.dk/browserspy/document.html
Attachments:
Description Flags
test case
none
proposed patch
darin: review+
Patch using UTF8String() none

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 
document.defaultCharset.
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

Implements:
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
entity.inputEncoding.
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).