Bug 5710 - item(i) should return the same result as [i]
Summary: item(i) should return the same result as [i]
Status: VERIFIED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Dave Hyatt
URL: http://airnewzealand.co.nz/
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-11 09:20 PST by mitz
Modified: 2005-11-27 11:40 PST (History)
0 users

See Also:


Attachments
testcase (412 bytes, text/html)
2005-11-11 09:26 PST, mitz
no flags Details
Naive patch (682 bytes, patch)
2005-11-11 10:04 PST, mitz
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2005-11-11 09:20:13 PST
Summary: For certain HTML DOM nodes, node[i] runs through a special collection, e.g. for an 
HTMLSelectElement, it runs through its options, ignoring other child nodes. On the other hand, node.item
(i) always returns the ith child. It should behave like node[i].

The attached testcase checks whether item(0) returns the first option for the select or the anonymous text 
child.
Comment 1 mitz 2005-11-11 09:26:54 PST
Created attachment 4665 [details]
testcase
Comment 2 mitz 2005-11-11 10:04:15 PST
Created attachment 4666 [details]
Naive patch
Comment 3 Eric Seidel (no email) 2005-11-26 18:15:39 PST
Better if test cases dump as text.  Even better if they're attached as patches (for easy landing).

Thanks for the patch!