[whatwg] [wf2] changing the size DOM attribute of <select>

On Sat, 11 Feb 2006, Anne van Kesteren wrote:
>
> Browsers disagree on what should be selected in such cases. Simple 
> testcase:
> 
>  <http://webforms2.testsuite.org/controls/select/009.htm>
> 
> Opera 9 passes that test and I heard Safari nightlies do too. Internet 
> Explorer and Firefox fail the testcase. Personally I would be in favor 
> of changing the specification to be compatible with Opera 9 and Safari 
> given that what they do is sensible.

Why should selectedIndex change when you change size?

Consider the opposite testcase:

   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%3Cp%3E%3Cselect%20size%3D1%3E%3Coption%3ETEST%3C/select%3E%0A%3Cscript%3Evar%20s%20%3D%20document.getElementsByTagName%28%27select%27%29%5B0%5D%3B%20s.selectedIndex%20%3D%20-1%3B%20s.size%20%3D%202%3B%3C/script%3E

Should TEST be selected? I'd say no. And here, should it be selected:

   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%3Cp%3E%3Cselect%20size%3D1%3E%3Coption%3ETEST%3C/select%3E%0A%3Cscript%3Evar%20s%20%3D%20document.getElementsByTagName%28%27select%27%29%5B0%5D%3B%20s.size%20%3D%202%3B%3C/script%3E

I'd say yes.

No?

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

Received on Monday, 14 August 2006 17:08:07 UTC