[whatwg] Don't throw for HTMLInputElement.files

On Tue, 15 Jun 2010, Jonas Sicking wrote:
> 
> Currently HTMLInputElement.files throws if accessed when type != "file". 
> I think it would be better to return null or an empty list. We generally 
> try to avoid throwing in general, and in particular things like 
> HTMLInputElement.checked doesn't throw even if the value doesn't apply. 
> So for consistency I don't think HTMLInputElement.files should throw 
> either.
> 
> Another reason not to throw is that people every so often enumerate all 
> the IDL attributes of element using |for each| constructs in javascript. 
> Such code tends to break if there are properties that throw upon access.

Changed.

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

Received on Monday, 9 August 2010 15:35:16 UTC