[Webkit-unassigned] [Bug 25191] HTMLSelectElement doesn't return named options

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 14 15:40:03 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25191





------- Comment #1 from davemoore at google.com  2009-04-14 15:40 PDT -------
A finger twitch committed early, so I'm restating:

According to the HTML5 spec named options should be accessible from both the
HTMLSelectElement and the HTMLOptionsCollection. If there is more than one
option with the same name, all should be returned as a collection. So if you
have:

<select id="sl1"><option value="Value" name="test" /></select>

and in JS code you do:
var test = document.getElementById("sl1").test

test should be a single HTMLOptionElement.

If instead you have:

<select id="sl2"><option value="Value1" name="test" /><option value="Value2"
name="test" /></select>

test should be a collection with 2 HTMLOptionElements. 

Neither chromium nor Safari handle both cases correctly. Safari returns both
singletons and collections but only for HTMLOptionsCollection
(document.getElementById("sl1").options.test). For HTMLSelectElement it always
returns null. chromium returns a singleton even when more than one element has
the same name for both HTMLSelectElement and HTMLOptionsCollection.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list