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 8037 - The form controls collection should just be an HTMLCollection instead of having an HTMLFormControlsCollection interface
Summary: The form controls collection should just be an HTMLCollection instead of havi...
Status: CLOSED 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: NE
Depends on:
Blocks:
 
Reported: 2009-10-23 22:45 UTC by Maciej Stachowiak
Modified: 2010-10-04 14:48 UTC (History)
4 users (show)

See Also:


Attachments

Description Maciej Stachowiak 2009-10-23 22:45:40 UTC
In browsers that expose global interface objects, the form control collections
either are or inherit from HTMLCollection, thus allowing changes to
HTMLCollection.prototype to affect them. In HTML5, it does not inherit, so it
will not be affected by HTMLCollection.prototype changes. This seems like a
needless change in behavior.

If HTMLCollection.namedItem is changed to return "object" instead of "Element" as suggested in related bugs, then having a special interface for form control collections will add very little value (just making the return type of the "item" method a little more specific). Thus, I don't think it's worthwhile having a special interface for it at all. But at the very least it should inherit.
Comment 1 Maciej Stachowiak 2009-10-23 22:45:57 UTC
See also bug 8035.
Comment 2 Ian 'Hixie' Hickson 2009-10-25 06:01:35 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: Done, except I made HTMLFormControlsCollection be its own interface and put namedItem() on both interfaces so HTMLFormControlsCollection's namedItem() overrides HTMLCollection's. I think we will probably need to add more members to HTMLFormControlsCollection in time, because IIRC IE implements form.elements as just an alias for form, and thus there are probably pages depending on form.elements.foo where foo is something on HTMLFormElement (the same problem we have with HTMLOptionsCollection).
Comment 3 Ian 'Hixie' Hickson 2009-10-25 06:04:00 UTC
Checked in as WHATWG revision r4323.
Check-in comment: Make collections inherit from HTMLCollection
http://html5.org/tools/web-apps-tracker?from=4322&to=4323