This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25817 - document.all.item(5) not handled correctly
Summary: document.all.item(5) not handled correctly
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-19 21:28 UTC by contributor
Modified: 2014-05-20 17:29 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2014-05-19 21:28:28 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html
Multipage: http://www.whatwg.org/C#htmlallcollection-0
Complete: http://www.whatwg.org/c#htmlallcollection-0
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
document.all.item(5) not handled correctly

Posted from: 81.242.199.134 by ms2ger@gmail.com
User agent: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0
Comment 1 Ms2ger 2014-05-19 21:29:40 UTC
HTMLAllCollection only has an item() with a DOMString argument, so the one that takes an integer is shadowed.
Comment 2 Ian 'Hixie' Hickson 2014-05-19 23:03:04 UTC
Oh overload resolution doesn't cross inheritance boundaries?
Comment 3 Boris Zbarsky 2014-05-20 03:34:09 UTC
That's correct.  There are two separate item() functions here in JS terms: one takes any input and coerces to integer, the other takes any input and coerces to string.  They live on different prototype objects, and one is shadowing the other.
Comment 4 Ian 'Hixie' Hickson 2014-05-20 16:57:10 UTC
Ok. Check the new prose, let me know if it's ok.

I still inherit the 'getter', right?

(The diff also contains fixes for editorial aspects of this section.)
Comment 5 contributor 2014-05-20 17:00:01 UTC
Checked in as WHATWG revision r8645.
Check-in comment: Various HTMLAllCollection fixes
http://html5.org/tools/web-apps-tracker?from=8644&to=8645
Comment 6 Boris Zbarsky 2014-05-20 17:29:45 UTC
I believe the indexed getter inherits, yes.  It's a bit hard to tell from the WebIDL spec.