W3C home > Mailing lists > Public > public-html@w3.org > December 2009

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

From: Geoffrey Sneddon <gsneddon@opera.com>
Date: Tue, 15 Dec 2009 17:08:08 +0100
Message-ID: <4B27B468.7030402@opera.com>
To: HTML WG <public-html@w3.org>
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
Received on Tuesday, 15 December 2009 16:08:48 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:04 UTC