W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2010

[whatwg] Clarification request for charset/characterSet/defaultCharset

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 10 Aug 2010 22:26:05 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1008102224310.11992@ps20323.dreamhostps.com>
On Tue, 6 Jul 2010, Nicholas Zakas wrote:
> 
> I was just reading through the spec and am having trouble understanding 
> the details of document.charset, document.characterSet, and 
> document.defaultCharset. It seems to me that document.characterSet is 
> simply a read-only equivalent of document.charset (I'm guessing these 
> are both here due to already-existing implementations), which is a 
> little confusing but not terribly so. I'm more interested in 
> document.defaultCharset and how it relates to the others.

All three are there for historical reasons.


> Some questions:
> 
> 1) Should document.charset/document.characterSet always start out 
> equivalent to document.defaultCharset?

What do you mean by "start out"?


> 2) What is the canonical source of truth for document.defaultCharset (is 
> this a system setting, a browser setting, or a document setting)?

There is no truth to speak of for defaultCharset. The browser can return 
any arbitrary value.


> 3) If document.charset is set to a new value, is there any change 
> reflected in document.defaultCharset? What about vice-versa?

Nope. defaultCharset is read-only, so cannot be set by the author. Its 
return value can vary arbitrarily.

HTH,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 10 August 2010 15:26:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:59 UTC