Closed
Bug 839105
Opened 11 years ago
Closed 11 years ago
Convert HTMLFieldSetElement 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
(2 files, 6 obsolete files)
17.18 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
7.37 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=bec9847c6097
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #711761 -
Flags: review?(Ms2ger)
Comment 3•11 years ago
|
||
Comment on attachment 711761 [details] [diff] [review] part 1 - renaming Review of attachment 711761 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/base/public/nsINode.h @@ +278,5 @@ > // - nsGenericHTMLElement: mForm, mFieldSet > // - nsGenericHTMLFrameElement: mFrameLoader (bug 672539), mTitleChangedListener > // - HTMLBodyElement: mContentStyleRule > // - HTMLDataListElement: mOptions > + // - HTMLFieldSetElement: mElements, mDependentElements, mFirstLegend Want to have a look which of these already lost their ns prefix? ::: content/html/content/src/nsHTMLFieldSetElement.h @@ +3,5 @@ > * License, v. 2.0. If a copy of the MPL was not distributed with this > * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > > +#ifndef mozilla_dom_HTMLOptGroupElement_h > +#define mozilla_dom_HTMLOptGroupElement_h mozilla_dom_HTMLOptGroupElement_h?
Attachment #711761 -
Flags: review?(Ms2ger) → review+
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #711761 -
Attachment is obsolete: true
Attachment #711764 -
Flags: review+
Assignee | ||
Comment 5•11 years ago
|
||
Attachment #711765 -
Flags: review?(Ms2ger)
Comment 6•11 years ago
|
||
Comment on attachment 711765 [details] [diff] [review] part 2 - webidl Review of attachment 711765 [details] [diff] [review]: ----------------------------------------------------------------- I'd like to see an updated version ::: content/html/content/src/HTMLFieldSetElement.cpp @@ +130,5 @@ > + } > + > + nsRefPtr<nsHTMLFormElement> ret = static_cast<nsHTMLFormElement*>(form.get()); > + return ret.forget(); > +} "using nsGenericHTMLFormElement::GetForm;" in the header @@ +167,5 @@ > + nsCOMPtr<nsIDOMHTMLCollection> elements; > + GetElements(getter_AddRefs(elements)); > + nsCOMPtr<nsIHTMLCollection> ret = do_QueryInterface(elements); > + return ret.forget(); > +} Please make this nsIHTMLCollection* HTMLFieldSetElement::Elements() { if (!mElements) { mElements = ...; } return mElements; } and NS_IMETHODIMP HTMLFieldSetElement::GetElements(nsIDOMHTMLCollection** aElements) { NS_ADDREF(*aElements = Elements()); return NS_OK; } @@ +270,5 @@ > + } > + > + nsRefPtr<ValidityState> ret = static_cast<ValidityState*>(state.get()); > + return ret.forget(); > +} You don't need this at all. ::: content/html/content/src/HTMLFieldSetElement.h @@ +106,5 @@ > + { > + bool ret; > + aError = CheckValidity(&ret); > + return ret; > + } "using nsIConstraintValidation::CheckValidity;"
Attachment #711765 -
Flags: review?(Ms2ger) → review-
Assignee | ||
Comment 7•11 years ago
|
||
> > + nsRefPtr<ValidityState> ret = static_cast<ValidityState*>(state.get());
> > + return ret.forget();
> > +}
>
> You don't need this at all.
I need a nsRefPtr<ValidityState> from a nsIDOMValidityState. I think I need this.
Comment 8•11 years ago
|
||
> I need a nsRefPtr<ValidityState> from a nsIDOMValidityState. I think I need this.
You can get away with:
return static_cast<ValidityState*>(state.forget().get());
That said, I think the point is that you don't need the function, period: nsIConstraintValidation has a Validity() function on it already that seems to do the right thing, so you can just inherit that, right?
Assignee | ||
Comment 9•11 years ago
|
||
Attachment #711765 -
Attachment is obsolete: true
Attachment #711783 -
Flags: review?(Ms2ger)
Comment 10•11 years ago
|
||
Comment on attachment 711783 [details] [diff] [review] part 2 - webidl (b) Review of attachment 711783 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/html/content/src/HTMLFieldSetElement.cpp @@ +153,5 @@ > HTMLFieldSetElement::GetElements(nsIDOMHTMLCollection** aElements) > { > + nsCOMPtr<nsIHTMLCollection> elements = Elements(); > + nsCOMPtr<nsIDOMHTMLCollection> e = do_QueryInterface(elements); > + NS_ADDREF(*aElements = e); nsIHTMLCollection inherits from nsIDOMHTMLCollection. Please use the code I gave you. @@ +166,5 @@ > true); > } > > + nsCOMPtr<nsIHTMLCollection> ret = do_QueryInterface((nsIDOMHTMLCollection*)mElements); > + return ret.forget(); nsContentList inherits from nsIHTMLCollection. Please just use "return mElements;" ::: content/html/content/src/HTMLFieldSetElement.h @@ +96,5 @@ > + } > + > + // XPCOM GetType is OK for us > + > + already_AddRefed<nsIHTMLCollection> Elements(); Should return a raw, non-addrefed pointer. @@ +109,5 @@ > + { > + bool ret; > + aError = CheckValidity(&ret); > + return ret; > + } Remove this.
Attachment #711783 -
Flags: review?(Ms2ger) → review-
Assignee | ||
Comment 11•11 years ago
|
||
Attachment #711783 -
Attachment is obsolete: true
Attachment #711794 -
Flags: review?(Ms2ger)
Comment 12•11 years ago
|
||
Comment on attachment 711794 [details] [diff] [review] part 2 - webidl (c) Review of attachment 711794 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/html/content/src/HTMLFieldSetElement.cpp @@ +120,5 @@ > return nsGenericHTMLFormElement::GetForm(aForm); > } > > +already_AddRefed<nsHTMLFormElement> > +HTMLFieldSetElement::GetForm() Remove this ::: content/html/content/src/HTMLFieldSetElement.h @@ +106,5 @@ > + // XPCOM GetValidationMessage is OK for us > + > + // XPCOM CheckValidity is OK for us > + > + bool CheckValidity(ErrorResult& aError) Remove this
Attachment #711794 -
Flags: review?(Ms2ger) → review-
Assignee | ||
Comment 13•11 years ago
|
||
Attachment #711794 -
Attachment is obsolete: true
Attachment #711808 -
Flags: review?(Ms2ger)
Comment 14•11 years ago
|
||
Comment on attachment 711808 [details] [diff] [review] part 2 - webidl (d) Review of attachment 711808 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! ::: dom/bindings/Bindings.conf @@ +402,5 @@ > ] > }, > > +'HTMLFieldSetElement': { > + 'hasInstanceInterface': 'nsIDOMHTMLFieldSetElement', Nit: four spaces
Attachment #711808 -
Flags: review?(Ms2ger) → review+
Assignee | ||
Comment 15•11 years ago
|
||
Attachment #711808 -
Attachment is obsolete: true
Attachment #711814 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 16•11 years ago
|
||
> + // XPCOM Validity is OK for us
It's actually a WebIDL signature, inherited from the nsIConstraintNavigation superclass, right?
Assignee | ||
Comment 17•11 years ago
|
||
Right. Comment removed.
Attachment #711814 -
Attachment is obsolete: true
Attachment #711829 -
Flags: review+
Comment 18•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/afeaf8f42c09 https://hg.mozilla.org/integration/mozilla-inbound/rev/f2ece1151f00
Flags: in-testsuite?
Keywords: checkin-needed
Comment 19•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/afeaf8f42c09 https://hg.mozilla.org/mozilla-central/rev/f2ece1151f00
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•