Closed Bug 405242 Opened 17 years ago Closed 14 years ago

Implement select.options.remove() method [HTML5 HTMLOptionsCollection.remove]

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a2

People

(Reporter: ddkilzer, Assigned: m_kato)

References

()

Details

(Keywords: html5, testcase)

Attachments

(2 files, 3 obsolete files)

Attached file Test case
Firefox should support the select.options.remove() method.

MSIE 6/7, Opera 9.24 and (soon) WebKit[1] support it.

[1] http://bugs.webkit.org/show_bug.cgi?id=9683

Firefox and the aforementioned browsers/engines already support the select.options.add() method.

This would apparently have helped to fix part of Bug 278380 when it was originally filed.
Per Microsoft's documentation (see URL field), the implementation should simply mirror the select.remove() method.  MSDN points to this definition:

http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-33404570

This is described in HTML5 spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#dom-htmloptionscollection-remove
linked from http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#dom-select-options
Component: DOM: Mozilla Extensions → DOM: Core & HTML
Keywords: html5
Summary: Implement select.options.remove() method → Implement select.options.remove() method [HTML5 HTMLOptionsCollection.remove]
Version: 1.8 Branch → Trunk
Attached patch patch v1 (obsolete) — Splinter Review
Makoto: did you forget to request a review here?
(In reply to comment #4)
> Makoto: did you forget to request a review here?

mochitest has typo comment, so I will review this after I fix it.
Attached patch patch v1.1 (obsolete) — Splinter Review
IE, WebKit and Opera already implements this method...
Attachment #414218 - Attachment is obsolete: true
Attachment #414218 - Flags: review?(jst)
Attachment #414218 - Flags: review?(jst)
Attachment #414806 - Flags: review?(jst)
Comment on attachment 414806 [details] [diff] [review]
patch v1.1


>+NS_IMETHODIMP
>+nsHTMLOptionCollection::Remove(PRInt32 aIndex)
>+{
>+  return mSelect->Remove(aIndex);
>+}
You should null check mSelect.
Attached patch patch v2 (obsolete) — Splinter Review
Attachment #414806 - Attachment is obsolete: true
Attachment #414806 - Flags: review?(jst)
Attachment #415069 - Flags: review?(jst)
Attached patch patch v3Splinter Review
Attachment #415069 - Attachment is obsolete: true
Attachment #415069 - Flags: review?(jst)
Attachment #425732 - Flags: review?(Olli.Pettay)
Attachment #425732 - Flags: review?(Olli.Pettay) → review+
Attachment #425732 - Flags: superreview?(jst)
Attachment #425732 - Flags: superreview?(jst) → superreview+
landed
http://hg.mozilla.org/mozilla-central/rev/6b7741d88c3b
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: