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 12861 - HTMLOptionsCollection.add(wrongElementType) should throw
Summary: HTMLOptionsCollection.add(wrongElementType) should throw
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-02 22:13 UTC by Cameron McCormack
Modified: 2011-08-12 23:20 UTC (History)
5 users (show)

See Also:


Attachments

Description Cameron McCormack 2011-06-02 22:13:58 UTC
The spec currently says that if HTMLOptionsCollection.add() is passed something that isn't an HTMLOptionElement or HTMLOptGroupElement that the method does nothing.  All browsers seems to throw, instead:

http://people.mozilla.org/~cmccormack/tests/options-collection-add.html
Comment 1 brunoais 2011-06-17 07:57:28 UTC
And it seems like throwing an exception makes more sense...
That way, debugging javascript code will be easier.
Comment 2 Michael[tm] Smith 2011-08-04 05:12:32 UTC
mass-move component to LC1
Comment 3 Ian 'Hixie' Hickson 2011-08-12 23:19:55 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: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments. Fixed it with a WebIDL change.

Note: I didn't test the second argument to see if it is type-checked also.
Comment 4 contributor 2011-08-12 23:20:22 UTC
Checked in as WHATWG revision r6440.
Check-in comment: closer to existing implementations
http://html5.org/tools/web-apps-tracker?from=6439&to=6440