[whatwg] the impact of <select>.value behavior clearing current selection prior to setting the new selection

Ian Hickson ian at hixie.ch
Wed Feb 1 17:38:37 PST 2012


On Tue, 3 Jan 2012, Jon Lee wrote:
> 
> A long while ago there was a clarification made to the html5 spec about 
> how setting selectedIndex and value clears out the selectedness of all 
> options prior to setting the selection. As of this writing, Safari, 
> Chrome, Opera, and Firefox leave the selection alone if the code sets 
> value to null or a string that does not match any of the existing 
> options. I was wondering if anyone had any insight on impact for 
> existing websites with this new behavior.

It's my understanding that what you describe as what browsers do is also 
what the specs require. The attribute is defined as being of type "long", 
so if I'm not misreading the Web IDL spec, the browser will try to convert 
the null or string value to a number (and fail) long before the HTML 
spec's prose is relevant.

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


More information about the whatwg mailing list