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

On Mon, 16 Jul 2007, Simon Pieters wrote:
> 
> (This is part of my detailed review of the Document Object Model section.)
> 
> The spec says about setting a reflecting attribute of type HTMLElement (or an
> descendant thereof):
> 
>   On setting, if the given element has an id attribute, then the content
>   attribute must be set to the value of that id attribute. Otherwise, the
>   DOM attribute must be set to the empty string.
> 
> Shouldn't it raise an exception if the value isn't type-compatible with the
> DOM attribute? (e.g., .contextMenu would only accept HTMLMenuElement.)

Yes, but presumably this happens at a higher layer (e.g. the DOM Bindings 
for ES4 specification).

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 1 August 2007 05:00:53 UTC