Bug 825732: Convert SVGAltGlyphElement to WebIDL r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Sun, 06 Jan 2013 09:14:44 -0500
changeset 117807 59ae61d1d05916c4e332867448c29df114cfee53
parent 117806 c4ba770505d9067d2f7705410ff868790d751159
child 117808 9968445e53438f2226a94ed3ee9258b1dd11f786
push id24113
push userphilringnalda@gmail.com
push dateMon, 07 Jan 2013 00:40:08 +0000
treeherdermozilla-central@579c679f24f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs825732
milestone20.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 825732: Convert SVGAltGlyphElement to WebIDL r=bz
content/svg/content/src/Makefile.in
content/svg/content/src/SVGAltGlyphElement.cpp
content/svg/content/src/SVGAltGlyphElement.h
content/svg/content/src/SVGTextPositioningElement.cpp
content/svg/content/src/SVGTextPositioningElement.h
content/svg/content/src/nsSVGAltGlyphElement.cpp
dom/bindings/Bindings.conf
dom/webidl/SVGAltGlyphElement.webidl
dom/webidl/WebIDL.mk
--- a/content/svg/content/src/Makefile.in
+++ b/content/svg/content/src/Makefile.in
@@ -32,17 +32,16 @@ CPPSRCS		= \
 		DOMSVGPointList.cpp \
 		DOMSVGStringList.cpp \
 		DOMSVGTests.cpp \
 		DOMSVGTransform.cpp \
 		DOMSVGTransformList.cpp \
 		nsDOMSVGZoomEvent.cpp \
 		nsDOMSVGEvent.cpp \
 		nsSVGAElement.cpp \
-		nsSVGAltGlyphElement.cpp \
 		nsSVGAngle.cpp \
 		nsSVGBoolean.cpp \
 		nsSVGClass.cpp \
 		nsSVGClipPathElement.cpp \
 		nsSVGDataParser.cpp \
 		nsSVGElement.cpp \
 		nsSVGElementFactory.cpp \
 		nsSVGEnum.cpp \
@@ -65,16 +64,17 @@ CPPSRCS		= \
 		nsSVGString.cpp \
 		nsSVGRect.cpp \
 		nsSVGSVGElement.cpp \
 		nsSVGSymbolElement.cpp \
 		nsSVGUnknownElement.cpp \
 		nsSVGUseElement.cpp \
 		nsSVGViewBox.cpp \
 		nsSVGViewElement.cpp \
+		SVGAltGlyphElement.cpp \
 		SVGAngle.cpp \
 		SVGAnimatedAngle.cpp \
 		SVGAnimatedBoolean.cpp \
 		SVGAnimatedLengthList.cpp \
 		SVGAnimatedNumberList.cpp \
 		SVGAnimatedPathSegList.cpp \
 		SVGAnimatedPointList.cpp \
 		SVGAnimatedPreserveAspectRatio.cpp \
@@ -148,16 +148,17 @@ EXPORTS =  			\
 	nsSVGFeatures.h            \
 	nsSVGRect.h                \
 	SVGAttrValueWrapper.h      \
 	$(NULL)
 
 EXPORTS_NAMESPACES = mozilla/dom
 
 EXPORTS_mozilla/dom = \
+	SVGAltGlyphElement.h \
 	SVGAngle.h \
 	SVGAnimatedAngle.h \
 	SVGAnimatedBoolean.h \
 	SVGAnimateElement.h \
 	SVGAnimateTransformElement.h \
 	SVGAnimateMotionElement.h \
 	SVGAnimationElement.h \
 	SVGCircleElement.h \
rename from content/svg/content/src/nsSVGAltGlyphElement.cpp
rename to content/svg/content/src/SVGAltGlyphElement.cpp
--- a/content/svg/content/src/nsSVGAltGlyphElement.cpp
+++ b/content/svg/content/src/SVGAltGlyphElement.cpp
@@ -1,174 +1,140 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#include "mozilla/Util.h"
-
-#include "nsGkAtoms.h"
-#include "nsIDOMSVGAltGlyphElement.h"
-#include "nsIDOMSVGURIReference.h"
-#include "nsSVGString.h"
-#include "SVGTextPositioningElement.h"
+#include "mozilla/dom/SVGAltGlyphElement.h"
+#include "mozilla/dom/SVGAltGlyphElementBinding.h"
 #include "nsContentUtils.h"
 
-using namespace mozilla;
-
-typedef dom::SVGTextPositioningElement nsSVGAltGlyphElementBase;
+DOMCI_NODE_DATA(SVGAltGlyphElement, mozilla::dom::SVGAltGlyphElement)
 
-class nsSVGAltGlyphElement : public nsSVGAltGlyphElementBase, // = nsIDOMSVGTextPositioningElement
-                             public nsIDOMSVGAltGlyphElement,
-                             public nsIDOMSVGURIReference
-{
-protected:
-  friend nsresult NS_NewSVGAltGlyphElement(nsIContent **aResult,
-                                           already_AddRefed<nsINodeInfo> aNodeInfo);
-  nsSVGAltGlyphElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  
-public:
-  // interfaces:
-  
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_NSIDOMSVGALTGLYPHELEMENT
-  NS_DECL_NSIDOMSVGURIREFERENCE
+NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(AltGlyph)
+
+namespace mozilla {
+namespace dom {
 
-  // xxx If xpcom allowed virtual inheritance we wouldn't need to
-  // forward here :-(
-  NS_FORWARD_NSIDOMNODE_TO_NSINODE
-  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-  NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAltGlyphElementBase::)
-  NS_FORWARD_NSIDOMSVGTEXTCONTENTELEMENT(nsSVGAltGlyphElementBase::)
-  NS_FORWARD_NSIDOMSVGTEXTPOSITIONINGELEMENT(nsSVGAltGlyphElementBase::)
-
-  // nsIContent interface
-  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
-
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-
-  virtual nsXPCClassInfo* GetClassInfo();
+JSObject*
+SVGAltGlyphElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
+{
+  return SVGAltGlyphElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
+}
 
-  virtual nsIDOMNode* AsDOMNode() { return this; }
-
-  virtual bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;
-
-protected:
-
-  // nsSVGElement overrides
-  virtual StringAttributesInfo GetStringInfo();
-
-
-  enum { HREF };
-  nsSVGString mStringAttributes[1];
-  static StringInfo sStringInfo[1];
-
-};
-
-nsSVGElement::StringInfo nsSVGAltGlyphElement::sStringInfo[1] =
+nsSVGElement::StringInfo SVGAltGlyphElement::sStringInfo[1] =
 {
   { &nsGkAtoms::href, kNameSpaceID_XLink, false }
 };
 
-NS_IMPL_NS_NEW_SVG_ELEMENT(AltGlyph)
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
-NS_IMPL_ADDREF_INHERITED(nsSVGAltGlyphElement,nsSVGAltGlyphElementBase)
-NS_IMPL_RELEASE_INHERITED(nsSVGAltGlyphElement,nsSVGAltGlyphElementBase)
+NS_IMPL_ADDREF_INHERITED(SVGAltGlyphElement,SVGAltGlyphElementBase)
+NS_IMPL_RELEASE_INHERITED(SVGAltGlyphElement,SVGAltGlyphElementBase)
 
-DOMCI_NODE_DATA(SVGAltGlyphElement, nsSVGAltGlyphElement)
-
-NS_INTERFACE_TABLE_HEAD(nsSVGAltGlyphElement)
-  NS_NODE_INTERFACE_TABLE7(nsSVGAltGlyphElement, nsIDOMNode, nsIDOMElement,
+NS_INTERFACE_TABLE_HEAD(SVGAltGlyphElement)
+  NS_NODE_INTERFACE_TABLE7(SVGAltGlyphElement, nsIDOMNode, nsIDOMElement,
                            nsIDOMSVGElement, nsIDOMSVGAltGlyphElement,
                            nsIDOMSVGTextPositioningElement, nsIDOMSVGTextContentElement,
                            nsIDOMSVGURIReference)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAltGlyphElement)
-NS_INTERFACE_MAP_END_INHERITING(nsSVGAltGlyphElementBase)
+NS_INTERFACE_MAP_END_INHERITING(SVGAltGlyphElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGAltGlyphElement::nsSVGAltGlyphElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsSVGAltGlyphElementBase(aNodeInfo)
+SVGAltGlyphElement::SVGAltGlyphElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+  : SVGAltGlyphElementBase(aNodeInfo)
 {
+  SetIsDOMBinding();
 }
 
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
-NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGAltGlyphElement)
+NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAltGlyphElement)
 
 //----------------------------------------------------------------------
 // nsIDOMSVGURIReference methods
 
 /* readonly attribute nsIDOMSVGAnimatedString href; */
-NS_IMETHODIMP nsSVGAltGlyphElement::GetHref(nsIDOMSVGAnimatedString * *aHref)
+NS_IMETHODIMP SVGAltGlyphElement::GetHref(nsIDOMSVGAnimatedString * *aHref)
 {
-  return mStringAttributes[HREF].ToDOMAnimatedString(aHref, this);
+  *aHref = Href().get();
+  return NS_OK;
+}
+
+already_AddRefed<nsIDOMSVGAnimatedString>
+SVGAltGlyphElement::Href()
+{
+  nsCOMPtr<nsIDOMSVGAnimatedString> href;
+  mStringAttributes[HREF].ToDOMAnimatedString(getter_AddRefs(href), this);
+  return href.forget();
 }
 
 //----------------------------------------------------------------------
 // nsIDOMSVGAltGlyphElement methods
 
 /* attribute DOMString glyphRef; */
-NS_IMETHODIMP nsSVGAltGlyphElement::GetGlyphRef(nsAString & aGlyphRef)
+NS_IMETHODIMP SVGAltGlyphElement::GetGlyphRef(nsAString & aGlyphRef)
 {
   GetAttr(kNameSpaceID_None, nsGkAtoms::glyphRef, aGlyphRef);
 
   return NS_OK;
 }
 
-NS_IMETHODIMP nsSVGAltGlyphElement::SetGlyphRef(const nsAString & aGlyphRef)
+NS_IMETHODIMP SVGAltGlyphElement::SetGlyphRef(const nsAString & aGlyphRef)
 {
   return SetAttr(kNameSpaceID_None, nsGkAtoms::glyphRef, aGlyphRef, true);
 }
 
 /* attribute DOMString format; */
-NS_IMETHODIMP nsSVGAltGlyphElement::GetFormat(nsAString & aFormat)
+NS_IMETHODIMP SVGAltGlyphElement::GetFormat(nsAString & aFormat)
 {
   GetAttr(kNameSpaceID_None, nsGkAtoms::format, aFormat);
 
   return NS_OK;
 }
 
-NS_IMETHODIMP nsSVGAltGlyphElement::SetFormat(const nsAString & aFormat)
+NS_IMETHODIMP SVGAltGlyphElement::SetFormat(const nsAString & aFormat)
 {
   return SetAttr(kNameSpaceID_None, nsGkAtoms::format, aFormat, true);
 }
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
 NS_IMETHODIMP_(bool)
-nsSVGAltGlyphElement::IsAttributeMapped(const nsIAtom* name) const
+SVGAltGlyphElement::IsAttributeMapped(const nsIAtom* name) const
 {
   static const MappedAttributeEntry* const map[] = {
     sColorMap,
     sFillStrokeMap,
     sFontSpecificationMap,
     sGraphicsMap,
     sTextContentElementsMap
   };
-  
+
   return FindAttributeDependence(name, map) ||
-    nsSVGAltGlyphElementBase::IsAttributeMapped(name);
-}
-
-
-bool
-nsSVGAltGlyphElement::IsEventAttributeName(nsIAtom* aName)
-{
-  return nsContentUtils::IsEventAttributeName(aName, EventNameType_SVGGraphic);
+    SVGAltGlyphElementBase::IsAttributeMapped(name);
 }
 
 //----------------------------------------------------------------------
 // nsSVGElement overrides
 
+bool
+SVGAltGlyphElement::IsEventName(nsIAtom* aName)
+{
+  return nsContentUtils::IsEventAttributeName(aName, EventNameType_SVGGraphic);
+}
+
 nsSVGElement::StringAttributesInfo
-nsSVGAltGlyphElement::GetStringInfo()
+SVGAltGlyphElement::GetStringInfo()
 {
   return StringAttributesInfo(mStringAttributes, sStringInfo,
                               ArrayLength(sStringInfo));
 }
+
+} // namespace dom
+} // namespace mozilla
copy from content/svg/content/src/nsSVGAltGlyphElement.cpp
copy to content/svg/content/src/SVGAltGlyphElement.h
--- a/content/svg/content/src/nsSVGAltGlyphElement.cpp
+++ b/content/svg/content/src/SVGAltGlyphElement.h
@@ -1,174 +1,75 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#include "mozilla/Util.h"
+#ifndef mozilla_dom_SVGAltGlyphElement_h
+#define mozilla_dom_SVGAltGlyphElement_h
 
-#include "nsGkAtoms.h"
 #include "nsIDOMSVGAltGlyphElement.h"
 #include "nsIDOMSVGURIReference.h"
+#include "mozilla/dom/SVGTextPositioningElement.h"
 #include "nsSVGString.h"
-#include "SVGTextPositioningElement.h"
-#include "nsContentUtils.h"
 
-using namespace mozilla;
+nsresult NS_NewSVGAltGlyphElement(nsIContent **aResult,
+                                  already_AddRefed<nsINodeInfo> aNodeInfo);
 
-typedef dom::SVGTextPositioningElement nsSVGAltGlyphElementBase;
+namespace mozilla {
+namespace dom {
 
-class nsSVGAltGlyphElement : public nsSVGAltGlyphElementBase, // = nsIDOMSVGTextPositioningElement
-                             public nsIDOMSVGAltGlyphElement,
-                             public nsIDOMSVGURIReference
+typedef SVGTextPositioningElement SVGAltGlyphElementBase;
+
+class SVGAltGlyphElement MOZ_FINAL : public SVGAltGlyphElementBase, // = nsIDOMSVGTextPositioningElement
+                                     public nsIDOMSVGAltGlyphElement,
+                                     public nsIDOMSVGURIReference
 {
 protected:
-  friend nsresult NS_NewSVGAltGlyphElement(nsIContent **aResult,
-                                           already_AddRefed<nsINodeInfo> aNodeInfo);
-  nsSVGAltGlyphElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  
+  friend nsresult (::NS_NewSVGAltGlyphElement(nsIContent **aResult,
+                                              already_AddRefed<nsINodeInfo> aNodeInfo));
+  SVGAltGlyphElement(already_AddRefed<nsINodeInfo> aNodeInfo);
+  virtual JSObject* WrapNode(JSContext *cx, JSObject *scope, bool *triedToWrap) MOZ_OVERRIDE;
+
 public:
   // interfaces:
-  
+
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGALTGLYPHELEMENT
   NS_DECL_NSIDOMSVGURIREFERENCE
 
   // xxx If xpcom allowed virtual inheritance we wouldn't need to
   // forward here :-(
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-  NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAltGlyphElementBase::)
-  NS_FORWARD_NSIDOMSVGTEXTCONTENTELEMENT(nsSVGAltGlyphElementBase::)
-  NS_FORWARD_NSIDOMSVGTEXTPOSITIONINGELEMENT(nsSVGAltGlyphElementBase::)
+  NS_FORWARD_NSIDOMSVGELEMENT(SVGAltGlyphElementBase::)
+  NS_FORWARD_NSIDOMSVGTEXTCONTENTELEMENT(SVGAltGlyphElementBase::)
+  NS_FORWARD_NSIDOMSVGTEXTPOSITIONINGELEMENT(SVGAltGlyphElementBase::)
 
   // nsIContent interface
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
-  virtual bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;
+  // WebIDL
+  already_AddRefed<nsIDOMSVGAnimatedString> Href();
 
 protected:
 
   // nsSVGElement overrides
   virtual StringAttributesInfo GetStringInfo();
 
+  virtual bool IsEventName(nsIAtom* aName);
 
   enum { HREF };
   nsSVGString mStringAttributes[1];
   static StringInfo sStringInfo[1];
 
 };
 
-nsSVGElement::StringInfo nsSVGAltGlyphElement::sStringInfo[1] =
-{
-  { &nsGkAtoms::href, kNameSpaceID_XLink, false }
-};
-
-NS_IMPL_NS_NEW_SVG_ELEMENT(AltGlyph)
-
-//----------------------------------------------------------------------
-// nsISupports methods
-
-NS_IMPL_ADDREF_INHERITED(nsSVGAltGlyphElement,nsSVGAltGlyphElementBase)
-NS_IMPL_RELEASE_INHERITED(nsSVGAltGlyphElement,nsSVGAltGlyphElementBase)
-
-DOMCI_NODE_DATA(SVGAltGlyphElement, nsSVGAltGlyphElement)
-
-NS_INTERFACE_TABLE_HEAD(nsSVGAltGlyphElement)
-  NS_NODE_INTERFACE_TABLE7(nsSVGAltGlyphElement, nsIDOMNode, nsIDOMElement,
-                           nsIDOMSVGElement, nsIDOMSVGAltGlyphElement,
-                           nsIDOMSVGTextPositioningElement, nsIDOMSVGTextContentElement,
-                           nsIDOMSVGURIReference)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAltGlyphElement)
-NS_INTERFACE_MAP_END_INHERITING(nsSVGAltGlyphElementBase)
-
-//----------------------------------------------------------------------
-// Implementation
-
-nsSVGAltGlyphElement::nsSVGAltGlyphElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsSVGAltGlyphElementBase(aNodeInfo)
-{
-}
-
-
-//----------------------------------------------------------------------
-// nsIDOMNode methods
-
-NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGAltGlyphElement)
-
-//----------------------------------------------------------------------
-// nsIDOMSVGURIReference methods
-
-/* readonly attribute nsIDOMSVGAnimatedString href; */
-NS_IMETHODIMP nsSVGAltGlyphElement::GetHref(nsIDOMSVGAnimatedString * *aHref)
-{
-  return mStringAttributes[HREF].ToDOMAnimatedString(aHref, this);
-}
-
-//----------------------------------------------------------------------
-// nsIDOMSVGAltGlyphElement methods
-
-/* attribute DOMString glyphRef; */
-NS_IMETHODIMP nsSVGAltGlyphElement::GetGlyphRef(nsAString & aGlyphRef)
-{
-  GetAttr(kNameSpaceID_None, nsGkAtoms::glyphRef, aGlyphRef);
+} // namespace dom
+} // namespace mozilla
 
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsSVGAltGlyphElement::SetGlyphRef(const nsAString & aGlyphRef)
-{
-  return SetAttr(kNameSpaceID_None, nsGkAtoms::glyphRef, aGlyphRef, true);
-}
-
-/* attribute DOMString format; */
-NS_IMETHODIMP nsSVGAltGlyphElement::GetFormat(nsAString & aFormat)
-{
-  GetAttr(kNameSpaceID_None, nsGkAtoms::format, aFormat);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsSVGAltGlyphElement::SetFormat(const nsAString & aFormat)
-{
-  return SetAttr(kNameSpaceID_None, nsGkAtoms::format, aFormat, true);
-}
-
-//----------------------------------------------------------------------
-// nsIContent methods
-
-NS_IMETHODIMP_(bool)
-nsSVGAltGlyphElement::IsAttributeMapped(const nsIAtom* name) const
-{
-  static const MappedAttributeEntry* const map[] = {
-    sColorMap,
-    sFillStrokeMap,
-    sFontSpecificationMap,
-    sGraphicsMap,
-    sTextContentElementsMap
-  };
-  
-  return FindAttributeDependence(name, map) ||
-    nsSVGAltGlyphElementBase::IsAttributeMapped(name);
-}
-
-
-bool
-nsSVGAltGlyphElement::IsEventAttributeName(nsIAtom* aName)
-{
-  return nsContentUtils::IsEventAttributeName(aName, EventNameType_SVGGraphic);
-}
-
-//----------------------------------------------------------------------
-// nsSVGElement overrides
-
-nsSVGElement::StringAttributesInfo
-nsSVGAltGlyphElement::GetStringInfo()
-{
-  return StringAttributesInfo(mStringAttributes, sStringInfo,
-                              ArrayLength(sStringInfo));
-}
+#endif // mozilla_dom_SVGAltGlyphElement_h
--- a/content/svg/content/src/SVGTextPositioningElement.cpp
+++ b/content/svg/content/src/SVGTextPositioningElement.cpp
@@ -1,32 +1,25 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #include "mozilla/Util.h"
 
 #include "mozilla/dom/SVGTextPositioningElement.h"
-#include "mozilla/dom/SVGTextPositioningElementBinding.h"
 #include "SVGAnimatedLengthList.h"
 #include "DOMSVGAnimatedLengthList.h"
 #include "DOMSVGAnimatedNumberList.h"
 #include "SVGContentUtils.h"
 #include "SVGLengthList.h"
 
 namespace mozilla {
 namespace dom {
 
-JSObject*
-SVGTextPositioningElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
-{
-  return SVGTextPositioningElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
-}
-
 nsSVGElement::LengthListInfo SVGTextPositioningElement::sLengthListInfo[4] =
 {
   { &nsGkAtoms::x,  SVGContentUtils::X, false },
   { &nsGkAtoms::y,  SVGContentUtils::Y, false },
   { &nsGkAtoms::dx, SVGContentUtils::X, true },
   { &nsGkAtoms::dy, SVGContentUtils::Y, true }
 };
 
--- a/content/svg/content/src/SVGTextPositioningElement.h
+++ b/content/svg/content/src/SVGTextPositioningElement.h
@@ -33,17 +33,16 @@ public:
   already_AddRefed<DOMSVGAnimatedLengthList> Dy();
   already_AddRefed<DOMSVGAnimatedNumberList> Rotate();
 
 protected:
 
   SVGTextPositioningElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : SVGTextPositioningElementBase(aNodeInfo)
   {}
-  virtual JSObject* WrapNode(JSContext *cx, JSObject *scope, bool *triedToWrap) MOZ_OVERRIDE;
 
   virtual LengthListAttributesInfo GetLengthListInfo();
   virtual NumberListAttributesInfo GetNumberListInfo();
 
   // nsIDOMSVGTextPositioning properties:
 
   enum { ATTR_X, ATTR_Y, ATTR_DX, ATTR_DY };
   SVGAnimatedLengthList mLengthListAttributes[4];
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -767,16 +767,20 @@ DOMInterfaces = {
     'nativeType': 'mozilla::dom::DOMSVGPreserveAspectRatio',
     'headerFile': 'SVGPreserveAspectRatio.h'
 },
 
 'SVGTextContentElement': {
     'concrete': False
 },
 
+'SVGTextPositioningElement': {
+    'concrete': False
+},
+
 'SVGTitleElement': {
   'hasInstanceInterface': 'nsIDOMSVGTitleElement',
 },
 
 'SVGTransform': {
     'nativeType': 'mozilla::DOMSVGTransform',
     'headerFile': 'DOMSVGTransform.h'
 },
new file mode 100644
--- /dev/null
+++ b/dom/webidl/SVGAltGlyphElement.webidl
@@ -0,0 +1,19 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/.
+ *
+ * The origin of this IDL file is
+ * http://www.w3.org/TR/SVG2/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface SVGAltGlyphElement : SVGTextPositioningElement {
+  attribute DOMString glyphRef;
+  attribute DOMString format;
+};
+
+SVGAltGlyphElement implements SVGURIReference;
+
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -91,16 +91,17 @@ webidl_files = \
   PaintRequestList.webidl \
   PannerNode.webidl \
   Performance.webidl \
   PerformanceNavigation.webidl \
   PerformanceTiming.webidl \
   Rect.webidl \
   RGBColor.webidl \
   Screen.webidl \
+  SVGAltGlyphElement.webidl \
   SVGAngle.webidl \
   SVGAnimatedAngle.webidl \
   SVGAnimatedBoolean.webidl \
   SVGAnimatedLengthList.webidl \
   SVGAnimatedNumberList.webidl \
   SVGAnimatedPoints.webidl \
   SVGAnimatedPreserveAspectRatio.webidl \
   SVGAnimatedTransformList.webidl \