| Summary: | HTMLOptionsCollection.namedItem should return a NodeList when there are multiple matching nodes | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
| Component: | Forms | Assignee: | Keith Rollin <krollin> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | cdumez, krollin, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Ryosuke Niwa
2015-09-04 20:33:46 PDT
This bug was found by the newly added test: LayoutTests/http/tests/w3c/html/semantics/forms/the-select-element/common-HTMLOptionsCollection-namedItem.html Where is this in the spec? The IDL says namedItem() returns an Element. And there is this comment: """ element = collection . namedItem(name) element = collection[name] Returns the item with ID or name name from the collection. If there are multiple matching items, then the first is returned. """ Therefore, the spec seems to indicate we should NOT return a NodeList. Maybe it is a bug in the test? I've filed a w3c-test bug: https://github.com/w3c/web-platform-tests/issues/2255 I've submitted a patch to the test and create a pull-request: https://github.com/w3c/web-platform-tests/pull/2302 Merged and closed (back in February). |