Closed
Bug 839447
Opened 12 years ago
Closed 12 years ago
Convert HTMLOptionElement to WebIDL
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: baku, Assigned: baku)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
|
49.10 KB,
patch
|
Ms2ger
:
review+
|
Details | Diff | Splinter Review |
|
10.42 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
|
714 bytes,
patch
|
mounir
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•12 years ago
|
||
Attachment #711825 -
Flags: review?(Ms2ger)
| Assignee | ||
Comment 2•12 years ago
|
||
Attachment #711826 -
Flags: review?(Ms2ger)
Updated•12 years ago
|
Attachment #711825 -
Flags: review?(Ms2ger) → review+
Comment 3•12 years ago
|
||
Comment on attachment 711826 [details] [diff] [review]
part 2 - webidl
Review of attachment 711826 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, except for the constructor issue; I'd like Peter to check that.
::: content/html/content/src/HTMLOptionElement.h
@@ +9,5 @@
>
> #include "nsGenericHTMLElement.h"
> #include "nsIDOMHTMLOptionElement.h"
> #include "nsIJSNativeInitializer.h"
> +#include <nsHTMLFormElement.h>
"" instead of <>
@@ +90,5 @@
> + {
> + SetHTMLBoolAttr(nsGkAtoms::disabled, aValue, aRv);
> + }
> +
> + already_AddRefed<nsHTMLFormElement> GetForm()
You should be able to just remove this too, if you add "using nsGenericHTMLFormElement::GetForm;"
@@ +130,5 @@
> + }
> +
> + int32_t GetIndex(ErrorResult& aRv)
> + {
> + int32_t id;
Nit: please initialize this to zero, for safety
::: content/html/content/src/nsHTMLSelectElement.h
@@ +669,1 @@
> static_cast<nsGenericHTMLElement&>(*aElement.GetAsHTMLOptGroupElement());
Looks like you're getting a merge conflict with yourself in bug 839056?
::: dom/webidl/HTMLOptionElement.webidl
@@ +14,5 @@
> +[NamedConstructor=Option(),
> + NamedConstructor=Option(DOMString text),
> + NamedConstructor=Option(DOMString text, DOMString value),
> + NamedConstructor=Option(DOMString text, DOMString value, boolean defaultSelected),
> + NamedConstructor=Option(DOMString text, DOMString value, boolean defaultSelected, boolean selected)]
Uh, you don't seem to have added code for this... Peter?
Attachment #711826 -
Flags: review?(peterv)
Attachment #711826 -
Flags: review?(Ms2ger)
Attachment #711826 -
Flags: review+
Comment 4•12 years ago
|
||
Comment on attachment 711826 [details] [diff] [review]
part 2 - webidl
Review of attachment 711826 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/html/content/src/HTMLOptionElement.h
@@ +90,5 @@
> + {
> + SetHTMLBoolAttr(nsGkAtoms::disabled, aValue, aRv);
> + }
> +
> + already_AddRefed<nsHTMLFormElement> GetForm()
HTMLOptionElement is not a nsGenericHTMLFormElement, so we can't do |using ...|.
I wish we'd implement GetForm (marked as resultNotAddRefed) as
nsHTMLFormElement*
HTMLOptionElement::GetForm()
{
nsHTMLSelectElement* selectControl = GetSelect();
return selectControl ? selectControl->GetForm() : nullptr;
}
and make the XPCOM one forward to this.
::: dom/bindings/Bindings.conf
@@ +441,5 @@
> },
>
> +'HTMLOptionElement': {
> + 'hasInstanceInterface': 'nsIDOMHTMLOptionElement'
> +},
Obsolete.
::: dom/webidl/HTMLOptionElement.webidl
@@ +14,5 @@
> +[NamedConstructor=Option(),
> + NamedConstructor=Option(DOMString text),
> + NamedConstructor=Option(DOMString text, DOMString value),
> + NamedConstructor=Option(DOMString text, DOMString value, boolean defaultSelected),
> + NamedConstructor=Option(DOMString text, DOMString value, boolean defaultSelected, boolean selected)]
This is fine. We'll get NamedConstructor support soon, but in the meantime the old XPCOM constructors will keep working.
Attachment #711826 -
Flags: review?(peterv) → review+
Comment 5•12 years ago
|
||
(In reply to Peter Van der Beken [:peterv] from comment #4)
> ::: dom/webidl/HTMLOptionElement.webidl
> @@ +14,5 @@
> > +[NamedConstructor=Option(),
> > + NamedConstructor=Option(DOMString text),
> > + NamedConstructor=Option(DOMString text, DOMString value),
> > + NamedConstructor=Option(DOMString text, DOMString value, boolean defaultSelected),
> > + NamedConstructor=Option(DOMString text, DOMString value, boolean defaultSelected, boolean selected)]
>
> This is fine. We'll get NamedConstructor support soon, but in the meantime
> the old XPCOM constructors will keep working.
Let's comment them out for now, then, to avoid confusion.
| Assignee | ||
Comment 6•12 years ago
|
||
Attachment #711826 -
Attachment is obsolete: true
Attachment #715111 -
Flags: review+
| Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
| Assignee | ||
Comment 7•12 years ago
|
||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 8•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ea6e27e21be8
https://hg.mozilla.org/mozilla-central/rev/68cb1f5270a8
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Comment 9•12 years ago
|
||
Attachment #715430 -
Flags: review?(mounir)
Comment 10•12 years ago
|
||
Comment on attachment 715430 [details] [diff] [review]
Part 3: Add a missing addref
Review of attachment 715430 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/html/content/src/HTMLOptionElement.cpp
@@ +100,5 @@
> NS_IMETHODIMP
> HTMLOptionElement::GetForm(nsIDOMHTMLFormElement** aForm)
> {
> NS_ENSURE_ARG_POINTER(aForm);
> + NS_ADDREF(*aForm = GetForm());
Please, remove NS_ENSURE_ARG_POINTER() as long as you are here.
Attachment #715430 -
Flags: review?(mounir) → review+
Comment 11•12 years ago
|
||
Part 3 landed directly on m-c (pushed on top of orange, no less...)
https://hg.mozilla.org/mozilla-central/rev/b8b9100f6c41
Comment 12•12 years ago
|
||
> + NS_ADDREF(*aForm = GetForm());
Uh... NS_IF_ADDREF, no?
Comment 13•12 years ago
|
||
Comment 14•12 years ago
|
||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•