Bug 119465
Summary: | htmlformcontrolscollection.namedItem(name) should be returned "Null", if there are no nodes in the collection. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Sanghyun Park <sh919.park> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | ||
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Sanghyun Park
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |