RESOLVED INVALID 119465
htmlformcontrolscollection.namedItem(name) should be returned "Null", if there are no nodes in the collection.
https://bugs.webkit.org/show_bug.cgi?id=119465
Summary htmlformcontrolscollection.namedItem(name) should be returned "Null", if the...
Sanghyun Park
Reported 2013-08-03 01:21:21 PDT
According to below Algorithm, htmlformcontrolscollection.namedItem(name),htmloptionscollection.namedItem(name), htmlallcollection.namedItem(name) and htmlformcontrolscollection(name) should be returned "Null", if there are no nodes in the collection. [1][2][3][4]. But undefined is returned in WebKit in this case. ------------------------------------------------------------------------- The namedItem(name) method must act according to the following algorithm: If, at the time the method is called, there is exactly one node in the collection that has either an id attribute or a name attribute equal to name, then return that node and stop the algorithm. Otherwise, if there are no nodes in the collection that have either an id attribute or a name attribute equal to name, then return null and stop the algorithm. Otherwise, create a new RadioNodeList object representing a live view of the HTMLFormControlsCollection object, further filtered so that the only nodes in the RadioNodeList object are those that have either an id attribute or a name attribute equal to name. The nodes in the RadioNodeList object must be sorted in tree order. Return that RadioNodeList object. ------------------------------------------------------------------------- [1] http://www.w3.org/TR/html5/infrastructure.html#dom-htmlformcontrolscollection-nameditem [2] http://www.w3.org/TR/html5/infrastructure.html#dom-htmloptionscollection-nameditem [3] http://www.w3.org/TR/html5/infrastructure.html#dom-htmlallcollection-nameditem [4] http://www.w3.org/TR/html5/infrastructure.html#dom-htmlformcontrolscollection-nameditem
Attachments
Note You need to log in before you can comment on or make changes to this bug.