Bug 119738

Summary: HTMLSelectElement.item() does not behave according to specification
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, commit-queue, ggaren, kling, laszlo.gombos, rniwa
Priority: P2 Keywords: BlinkMergeCandidate, WebExposed
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2013-08-13 03:21:14 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/33a9622c83dd9d85a7bd91b936bb2a31bd34f74b

HTMLSelectElement.item() does not behave according to specification

HTMLSelectElement.item() does not behave according to specification:
http://www.w3.org/TR/html51/forms.html#dom-select-item
http://dom.spec.whatwg.org/#dom-htmlcollection-item

Namely, we should not throw if the offset argument is negative. Also,
the argument should be mandatory.

IE10 and Firefox do not throw when HTMLSelectElement.item() is called
with a negative value (as per the specification).

The argument is mandatory in Firefox but optional in IE10 (it returns
null when called without argument). This looks like a bug in IE because
other item() getters' argument is usually mandatory in IE (e.g.
NodeList.item()).
Comment 1 Chris Dumez 2013-08-13 03:43:27 PDT
Created attachment 208615 [details]
Patch
Comment 2 WebKit Commit Bot 2013-08-13 09:17:36 PDT
Comment on attachment 208615 [details]
Patch

Clearing flags on attachment: 208615

Committed r154005: <http://trac.webkit.org/changeset/154005>
Comment 3 WebKit Commit Bot 2013-08-13 09:17:39 PDT
All reviewed patches have been landed.  Closing bug.