Bug 836822. Convert MathML elements to WebIDL. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 06 Feb 2013 09:42:16 +0000
changeset 120995 85e3ebb56fb32bfb1470c3602bd07e6ba3bf8847
parent 120994 cd0fca4f35d00542fdc01183c6ac382b6eef45a3
child 120996 a8bfa0b091b5efce7825a8dab3129bd048844719
push id24271
push userryanvm@gmail.com
push dateWed, 06 Feb 2013 21:55:32 +0000
treeherdermozilla-central@325397090d12 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs836822
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 836822. Convert MathML elements to WebIDL. r=peterv
content/mathml/content/src/nsMathMLElement.cpp
content/mathml/content/src/nsMathMLElement.h
--- a/content/mathml/content/src/nsMathMLElement.cpp
+++ b/content/mathml/content/src/nsMathMLElement.cpp
@@ -16,16 +16,18 @@
 #include "nsIDocument.h"
 #include "nsEventStates.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "mozAutoDocUpdate.h"
 #include "nsIScriptError.h"
 #include "nsContentUtils.h"
 
+#include "mozilla/dom/ElementBinding.h"
+
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 // nsISupports methods:
 
 DOMCI_NODE_DATA(MathMLElement, nsMathMLElement)
 
@@ -936,8 +938,14 @@ nsMathMLElement::UnsetAttr(int32_t aName
        aNameSpaceID == kNameSpaceID_XLink)) {
     // Note: just because we removed a single href attr doesn't mean there's no href,
     // since there are 2 possible namespaces.
     Link::ResetLinkState(!!aNotify, Link::ElementHasHref());
   }
 
   return rv;
 }
+
+JSObject*
+nsMathMLElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
+{
+  return ElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
+}
--- a/content/mathml/content/src/nsMathMLElement.h
+++ b/content/mathml/content/src/nsMathMLElement.h
@@ -22,17 +22,19 @@ class nsMathMLElement : public nsMathMLE
                         public nsIDOMElement,
                         public nsILink,
                         public mozilla::dom::Link
 {
 public:
   nsMathMLElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsMathMLElementBase(aNodeInfo), Link(this),
       mIncrementScriptLevel(false)
-  {}
+  {
+    SetIsDOMBinding();
+  }
 
   // Implementation of nsISupports is inherited from nsMathMLElementBase
   NS_DECL_ISUPPORTS_INHERITED
 
   // Forward implementations of parent interfaces of nsMathMLElement to 
   // our base class
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
@@ -99,13 +101,18 @@ public:
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
   virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
+
+protected:
+  virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
+                             bool *aTriedToWrap) MOZ_OVERRIDE;
+
 private:
   bool mIncrementScriptLevel;
 };
 
 #endif // nsMathMLElement_h