Last Comment Bug 707576 - Remove nsIDOMNSElement
: Remove nsIDOMNSElement
Status: RESOLVED FIXED
: addon-compat, dev-doc-needed
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla11
Assigned To: :Ms2ger
:
Mentors:
Depends on: 734019 734746 750002
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-04 15:21 PST by :Ms2ger
Modified: 2012-04-29 07:17 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (62.82 KB, patch)
2011-12-11 07:45 PST, :Ms2ger
bugs: review+
Details | Diff | Review

Description :Ms2ger 2011-12-04 15:21:00 PST
Got a patch, still need to check if it's ready for review.
Comment 1 :Ms2ger 2011-12-11 07:45:15 PST
Created attachment 580741 [details] [diff] [review]
Patch v1
Comment 2 Olli Pettay [:smaug] 2011-12-14 04:50:39 PST
Comment on attachment 580741 [details] [diff] [review]
Patch v1


>-nsNSElementTearoff::GetFirstElementChild(nsIDOMElement** aResult)
>+nsGenericElement::GetChildElementCount(PRUint32* aResult)
>+{
>+  nsContentList* list = GetChildrenList();
>+  if (!list) {
>+    *aResult = 0;
>+    return NS_ERROR_OUT_OF_MEMORY;
>+  }
>+
>+  *aResult = list->Length(true);
>+  return NS_OK;
>+}
Why OOM check?
Maybe
  *aResult = GetChildrenList()->Length(true);
  return NS_OK;



>+NS_IMETHODIMP
>+nsGenericElement::GetChildElements(nsIDOMNodeList** aResult)
>+{
>+  nsContentList* list = GetChildrenList();
>+  if (!list) {
>+    *aResult = nsnull;
>+    return NS_ERROR_OUT_OF_MEMORY;
>+  }
>+
>+  NS_ADDREF(*aResult = list);
>+  return NS_OK;
>+}
Maybe
  NS_ADDREF(*aResult = GetChildrenList());
  return NS_OK;



> 
>+NS_IMETHODIMP
>+nsGenericElement::GetOnmouseenter(JSContext* cx, JS::Value* vp)
>+{
>+  return nsINode::GetOnmouseenter(cx, vp);
>+}
>+
>+NS_IMETHODIMP
>+nsGenericElement::SetOnmouseenter(JSContext* cx, const JS::Value& v)
>+{
>+  return nsINode::SetOnmouseenter(cx, v);
>+}
>+
>+NS_IMETHODIMP
>+nsGenericElement::GetOnmouseleave(JSContext* cx, JS::Value* vp)
>+{
>+  return nsINode::GetOnmouseleave(cx, vp);
>+}
>+
>+NS_IMETHODIMP
>+nsGenericElement::SetOnmouseleave(JSContext* cx, const JS::Value& v)
>+{
>+  return nsINode::SetOnmouseleave(cx, v);
>+}
Waiting to get answer why this change is needed.
Comment 3 :Ms2ger 2011-12-14 04:58:23 PST
(In reply to Olli Pettay [:smaug] from comment #2)
> Comment on attachment 580741 [details] [diff] [review]
> Patch v1
>
> GetChildrenList

OK, didn't realize this was infallible.

> > 
> >+NS_IMETHODIMP
> >+nsGenericElement::GetOnmouseenter(JSContext* cx, JS::Value* vp)
> >+{
> >+  return nsINode::GetOnmouseenter(cx, vp);
> >+}
> >+
> >+NS_IMETHODIMP
> >+nsGenericElement::SetOnmouseenter(JSContext* cx, const JS::Value& v)
> >+{
> >+  return nsINode::SetOnmouseenter(cx, v);
> >+}
> >+
> >+NS_IMETHODIMP
> >+nsGenericElement::GetOnmouseleave(JSContext* cx, JS::Value* vp)
> >+{
> >+  return nsINode::GetOnmouseleave(cx, vp);
> >+}
> >+
> >+NS_IMETHODIMP
> >+nsGenericElement::SetOnmouseleave(JSContext* cx, const JS::Value& v)
> >+{
> >+  return nsINode::SetOnmouseleave(cx, v);
> >+}
> Waiting to get answer why this change is needed.

Because I used NS_DECL_NSIDOMELEMENT in nsGenericElement.h, I get linking errors if these aren't defined.
Comment 4 Olli Pettay [:smaug] 2011-12-14 05:00:05 PST
Comment on attachment 580741 [details] [diff] [review]
Patch v1

Ok.

Fix the OOM cases, r+

Note You need to log in before you can comment on or make changes to this bug.