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 11963 - The namedItem(key) method must return the first node in the collection that matches the following requirements: •It is an a, applet, area, embed, form, frame, frameset, iframe, img, or object element with a name attribute equal to key, or, •It is an e
Summary: The namedItem(key) method must return the first node in the collection that m...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-02 15:52 UTC by contributor
Modified: 2011-08-04 05:06 UTC (History)
7 users (show)

See Also:


Attachments

Description contributor 2011-02-02 15:52:42 UTC
Specification: http://dev.w3.org/html5/spec/Overview.html
Section: http://www.whatwg.org/specs/web-apps/current-work/#top

Comment:
The namedItem(key) method must return the first node in the collection that
matches the following requirements:
•It is an a, applet, area, embed, form, frame, frameset, iframe, img, or
object element with a name attribute equal to key, or,
•It is an element with an ID equal to key.

This could be a potential problem. All elements can have an ID attribute. What
if you have an element with an ID attribute with the value "foo" which is part
of a collection and you have another element (from the list of applicable
elements) that has a name attribute with a value "foo" which is also a member
of the same collection. Which element is returned? Or is an array or another
collection of elements returned that contains all elements that have a name
attribute with the value "foo" and the element with the attribute ID with the
value "foo"?

Posted from: 71.224.184.28
Comment 1 Craig S 2011-02-02 16:00:59 UTC
The specification clearly says "return the first node in the collection that mathches the following requirements".
Comment 2 Boris Zbarsky 2011-02-02 16:34:22 UTC
Though the spec should make it clear that the node returned matches _either_ of the following requirements.  The "or" is really hard to notice; the up-front either would work better.
Comment 3 Simon Pieters 2011-02-03 09:29:47 UTC
Reopening on behalf of bz
Comment 4 Ian 'Hixie' Hickson 2011-03-03 23:56:06 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Partially Accepted
Change Description: see diff given below
Rationale: I've fixed comment 2, but I don't understand comment 1.
Comment 5 contributor 2011-03-03 23:56:27 UTC
Checked in as WHATWG revision r5930.
Check-in comment: clarify that this is an 'or' list.
http://html5.org/tools/web-apps-tracker?from=5929&to=5930
Comment 6 Michael[tm] Smith 2011-08-04 05:06:45 UTC
mass-moved component to LC1