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 8792 - getElementsByName and getElementsByClassName allow returning the same NodeList repeatedly
Summary: getElementsByName and getElementsByClassName allow returning the same NodeLis...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-21 08:21 UTC by Maciej Stachowiak
Modified: 2010-10-04 13:55 UTC (History)
4 users (show)

See Also:


Attachments

Description Maciej Stachowiak 2010-01-21 08:21:45 UTC
DOM Level 3 Core requires returning a new NodeList every time from getElementsByTagName and getElementsByTagNameNS:

http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-A6C9094
http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-getElBTNNS

HTML5 does not have this requirement for getElementsByName and getElementsByClassName, which would in theory allow the same NodeList to be returned when called on the same Document or Element with the same parameters:

http://dev.w3.org/html5/spec/Overview.html#dom-document-getelementsbyname
http://dev.w3.org/html5/spec/Overview.html#dom-document-getelementsbyclassname

While I would like caching to be allowed, the divergence from DOM 3 Core seems unintentional.
Comment 1 Ian 'Hixie' Hickson 2010-02-13 11:25:58 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 tried to close up any such ambiguities where I could find them. I posted to public-webapps about the approach I took.
Comment 2 contributor 2010-02-13 11:26:36 UTC
Checked in as WHATWG revision r4702.
Check-in comment: Define whether these methods and attributes return the same object or a different object each time they are called.
http://html5.org/tools/web-apps-tracker?from=4701&to=4702