W3C home > Mailing lists > Public > public-html@w3.org > May 2008

Re: Reflecting attributes: boolean (detailed review of the DOM)

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 12 May 2008 09:39:29 +0000 (UTC)
To: Simon Pieters <simonp@opera.com>
Cc: public-html <public-html@w3.org>
Message-ID: <Pine.LNX.4.62.0805120937060.22257@hixie.dreamhostps.com>

On Mon, 16 Jul 2007, Simon Pieters wrote:
> 
> The spec says in reflecting attributes:
> 
>    If a reflecting DOM attribute is a boolean attribute, then the DOM
>    attribute must return true if the attribute is set, and false if it is
>    absent. On setting, the content attribute must be removed if the DOM
>    attribute is set to false, and must be set to have the same value as its
>    name if the DOM attribute is set to true. (This corresponds to the rules
>    for boolean content attributes.)
> 
> On setting, IE uses the value "true", Firefox and Safari use the value 
> "", and Opera matches the spec, except it uses uppercase. I think the 
> spec should be changed to match Firefox and Safari, i.e. s/have the same 
> value as its name/the empty string/.
> 
> http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Cinput%3E.%3Cscript%3Edocument.body.firstChild.disabled%20%3D%20true%3C/script%3E

It's not that simple:

   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%3Cimg%3E%3Cscript%3E%3C%2Fscript%3E.%3Cscript%3Edocument.body.firstChild.isMap%20%3D%20true%3B%20document.body.firstChild.nextSibling.defer%20%3D%20true%3B%3C%2Fscript%3E

On that one, IE8b1 does what the spec says exactly, Opera9.5b sets them to 
"true", and Firefox and Safari set them to "".

I've left the spec as is, since it is what XHTML has always required. The 
utter lack of interop and consistency here suggests that it may not be 
critical to be compatible with legacy here, so...

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 12 May 2008 09:40:56 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:54 UTC