Selectedness when adding options (was: Re: Setting selectedIndex before adding option with that index)

Geoffrey Sneddon wrote:
> It appears I didn't look at this close enough. As far as I can tell, the 
> spec is currently correct for selectedIndex. What is wrong is that 
> adding an option to a select element should set its selectedness to true 
> if there are no options that are already selected.

And I'm still wrong. (That's actually untrue, I was right with what I 
thought… I just wrote the wrong thing.)

When adding an option element to a select, Firefox sets the selectedness 
to the first non-disabled element, WebKit sets the selectedness to the 
zeroith element, and Opera doesn't select anything. Either the Firefox 
or WebKit behaviour is needed for web compat.

Also, I can't see anywhere that the spec requires the first non-disabled 
(Fx, Opera)/any (WebKit) option to be selected initially. (Though I 
guess this can be fixed at the same time as the above.)

-- 
Geoffrey Sneddon — Opera Software
<http://gsnedders.com/>
<http://www.opera.com/>

Received on Tuesday, 15 December 2009 16:08:48 UTC