[whatwg] Don't throw for HTMLInputElement.files

Hi All,

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.

/ Jonas

Received on Tuesday, 15 June 2010 11:25:21 UTC