[whatwg] DOMTokenList feedback

Sylvain Pasche sylvain.pasche at gmail.com
Mon Jul 6 13:30:29 PDT 2009

On 7/6/2009 9:08 AM, Kristof Zelechovski wrote:
> Regarding DOMTokenList, why not:
> 	contains(""): true
> 	add,remove,toggle(""): no effect?

That could be an option. There is already a INVALID_CHARACTER_ERR 
exception thrown if the token contains spaces. So I think it would be 
consistent to throw an exception if the token is empty, following the 
rule "invalid tokens raise exception" (and considering empty tokens as 

> Are there situations that would require an exception to be thrown, or else
> the page would go out in a blast?

Hard to say, but calling these functions with empty tokens certainly 
means there is a bug somewhere and throwing an exception in that case 
could help authors identify the issue when it happens.


More information about the whatwg mailing list