Bug 816778 Part 10: Convert SVGPathSeg and subclasses to WebIDL and remove XPIDL r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Sat, 22 Dec 2012 23:54:22 -0500
changeset 116924 71dba2dc956c81e8fbc14f49b7a9c5360a894bc2
parent 116923 b6dc8ce6295ac07fad23661aa3b50ff1251580ea
child 116925 8b53a620ef9e34ef9fbd215a9a51670ae9d89cee
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-esr52@5bb309998e70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs816778
milestone20.0a1
Bug 816778 Part 10: Convert SVGPathSeg and subclasses to WebIDL and remove XPIDL r=bz
content/svg/content/src/DOMSVGPathSeg.cpp
content/svg/content/src/DOMSVGPathSeg.h
content/svg/content/src/DOMSVGPathSegList.cpp
content/svg/content/src/DOMSVGPathSegList.h
content/svg/content/src/SVGMotionSMILType.cpp
content/svg/content/src/SVGPathData.cpp
content/svg/content/src/SVGPathSegListSMILType.cpp
content/svg/content/src/SVGPathSegUtils.cpp
content/svg/content/src/SVGPathSegUtils.h
content/svg/content/src/nsSVGPathDataParser.cpp
content/svg/content/src/nsSVGPathDataParser.h
content/svg/content/src/nsSVGPathElement.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfo.h
dom/base/nsDOMClassInfoClasses.h
dom/bindings/Bindings.conf
dom/interfaces/svg/Makefile.in
dom/interfaces/svg/nsIDOMSVGPathElement.idl
dom/interfaces/svg/nsIDOMSVGPathSeg.idl
dom/webidl/SVGPathSeg.webidl
dom/webidl/SVGPathSegList.webidl
dom/webidl/WebIDL.mk
--- a/content/svg/content/src/DOMSVGPathSeg.cpp
+++ b/content/svg/content/src/DOMSVGPathSeg.cpp
@@ -2,20 +2,18 @@
 /* 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 "DOMSVGPathSeg.h"
 #include "DOMSVGPathSegList.h"
-#include "SVGPathSegUtils.h"
 #include "SVGAnimatedPathSegList.h"
 #include "nsSVGElement.h"
-#include "nsIDOMSVGPathSeg.h"
 #include "nsError.h"
 #include "nsContentUtils.h"
 
 // See the architecture comment in DOMSVGPathSegList.h.
 
 using namespace mozilla;
 
 // We could use NS_IMPL_CYCLE_COLLECTION_1, except that in Unlink() we need to
@@ -24,66 +22,58 @@ using namespace mozilla;
 // NS_SVG_VAL_IMPL_CYCLE_COLLECTION does.)
 NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGPathSeg)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGPathSeg)
   // We may not belong to a list, so we must null check tmp->mList.
   if (tmp->mList) {
     tmp->mList->ItemAt(tmp->mListIndex) = nullptr;
   }
 NS_IMPL_CYCLE_COLLECTION_UNLINK(mList)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGPathSeg)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mList)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
+NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGPathSeg)
+NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
+NS_IMPL_CYCLE_COLLECTION_TRACE_END
+
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGPathSeg)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGPathSeg)
 
-DOMCI_DATA(SVGPathSeg, DOMSVGPathSeg)
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGPathSeg)
-  NS_INTERFACE_MAP_ENTRY(DOMSVGPathSeg) // pseudo-interface
-  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPathSeg)
+  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 
 DOMSVGPathSeg::DOMSVGPathSeg(DOMSVGPathSegList *aList,
                              uint32_t aListIndex,
                              bool aIsAnimValItem)
   : mList(aList)
   , mListIndex(aListIndex)
   , mIsAnimValItem(aIsAnimValItem)
 {
+  SetIsDOMBinding();
   // These shifts are in sync with the members in the header.
   NS_ABORT_IF_FALSE(aList &&
                     aListIndex <= MaxListIndex(), "bad arg");
 
   NS_ABORT_IF_FALSE(IndexIsValid(), "Bad index for DOMSVGPathSeg!");
 }
 
 DOMSVGPathSeg::DOMSVGPathSeg()
   : mList(nullptr)
   , mListIndex(0)
   , mIsAnimValItem(false)
 {
-}
-
-NS_IMETHODIMP
-DOMSVGPathSeg::GetPathSegType(uint16_t *aPathSegType)
-{
-  *aPathSegType = uint16_t(Type());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-DOMSVGPathSeg::GetPathSegTypeAsLetter(nsAString &aPathSegTypeAsLetter)
-{
-  aPathSegTypeAsLetter = SVGPathSegUtils::GetPathSegTypeAsLetter(Type());
-  return NS_OK;
+  SetIsDOMBinding();
 }
 
 void
 DOMSVGPathSeg::InsertingIntoList(DOMSVGPathSegList *aList,
                                  uint32_t aListIndex,
                                  bool aIsAnimValItem)
 {
   NS_ABORT_IF_FALSE(!HasOwner(), "Inserting item that is already in a list");
@@ -138,694 +128,185 @@ DOMSVGPathSeg::IndexIsValid()
           mListIndex < alist->GetBaseValue().CountItems());
 }
 #endif
 
 
 ////////////////////////////////////////////////////////////////////////
 // Implementation of DOMSVGPathSeg sub-classes below this point
 
-#define CHECK_ARG_COUNT_IN_SYNC(segType)                                      \
-          NS_ABORT_IF_FALSE(ArrayLength(mArgs) ==                         \
-            SVGPathSegUtils::ArgCountForType(uint32_t(segType)) ||            \
-            uint32_t(segType) == nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH,         \
-            "Arg count/array size out of sync")
-
-#define IMPL_SVGPATHSEG_SUBCLASS_COMMON(segName, segType)                     \
-  DOMSVGPathSeg##segName(const float *aArgs)                                  \
-    : DOMSVGPathSeg()                                                         \
-  {                                                                           \
-    CHECK_ARG_COUNT_IN_SYNC(segType);                                         \
-    memcpy(mArgs, aArgs,                                                      \
-        SVGPathSegUtils::ArgCountForType(uint32_t(segType)) * sizeof(float)); \
-  }                                                                           \
-  DOMSVGPathSeg##segName(DOMSVGPathSegList *aList,                            \
-                         uint32_t aListIndex,                                 \
-                         bool aIsAnimValItem)                               \
-    : DOMSVGPathSeg(aList, aListIndex, aIsAnimValItem)                        \
-  {                                                                           \
-    CHECK_ARG_COUNT_IN_SYNC(segType);                                         \
-  }                                                                           \
-  /* From DOMSVGPathSeg: */                                                   \
-  virtual uint32_t                                                            \
-  Type() const                                                                \
-  {                                                                           \
-    return segType;                                                           \
-  }                                                                           \
-  virtual DOMSVGPathSeg*                                                      \
-  Clone()                                                                     \
-  {                                                                           \
-    /* InternalItem() + 1, because we're skipping the encoded seg type */     \
-    float *args = IsInList() ? InternalItem() + 1 : mArgs;                    \
-    return new DOMSVGPathSeg##segName(args);                                  \
-  }                                                                           \
-  virtual float*                                                              \
-  PtrToMemberArgs()                                                           \
-  {                                                                           \
-    return mArgs;                                                             \
-  }
-
-#define IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(segName)                         \
-  /* Forward to the CYCLE_COLLECTING_ADDREF on our base class */              \
-  NS_IMPL_ADDREF_INHERITED(DOMSVGPathSeg##segName, DOMSVGPathSeg)             \
-  NS_IMPL_RELEASE_INHERITED(DOMSVGPathSeg##segName, DOMSVGPathSeg)            \
-                                                                              \
-  DOMCI_DATA(SVGPathSeg##segName, DOMSVGPathSeg##segName)                     \
-                                                                              \
-  NS_INTERFACE_MAP_BEGIN(DOMSVGPathSeg##segName)                              \
-    NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPathSeg##segName)                         \
-    NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGPathSeg##segName)                 \
-  NS_INTERFACE_MAP_END_INHERITING(DOMSVGPathSeg)
-
 #define IMPL_PROP_WITH_TYPE(segName, propName, index, type)                   \
   /* attribute type propName; */                                              \
-  NS_IMETHODIMP                                                               \
-  DOMSVGPathSeg##segName::Get##propName(type *a##propName)                    \
+  type                                                                        \
+  DOMSVGPathSeg##segName::propName()                                          \
   {                                                                           \
     if (mIsAnimValItem && HasOwner()) {                                       \
-      Element()->FlushAnimations(); /* May make HasOwner() == false */     \
+      Element()->FlushAnimations(); /* May make HasOwner() == false */        \
     }                                                                         \
-    *a##propName = type(HasOwner() ? InternalItem()[1+index] : mArgs[index]); \
-    return NS_OK;                                                             \
+    return type(HasOwner() ? InternalItem()[1+index] : mArgs[index]);         \
   }                                                                           \
-  NS_IMETHODIMP                                                               \
-  DOMSVGPathSeg##segName::Set##propName(type a##propName)                     \
+  void                                                                        \
+  DOMSVGPathSeg##segName::Set##propName(type a##propName, ErrorResult& rv)    \
   {                                                                           \
     if (mIsAnimValItem) {                                                     \
-      return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;                        \
+      rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);                     \
+      return;                                                                 \
     }                                                                         \
-    NS_ENSURE_FINITE(float(a##propName), NS_ERROR_ILLEGAL_VALUE);             \
     if (HasOwner()) {                                                         \
       if (InternalItem()[1+index] == float(a##propName)) {                    \
-        return NS_OK;                                                         \
+        return;                                                               \
       }                                                                       \
       NS_ABORT_IF_FALSE(IsInList(), "Will/DidChangePathSegList() is wrong");  \
       nsAttrValue emptyOrOldValue = Element()->WillChangePathSegList();       \
       InternalItem()[1+index] = float(a##propName);                           \
       Element()->DidChangePathSegList(emptyOrOldValue);                       \
       if (mList->AttrIsAnimating()) {                                         \
         Element()->AnimationNeedsResample();                                  \
       }                                                                       \
     } else {                                                                  \
       mArgs[index] = float(a##propName);                                      \
     }                                                                         \
-    return NS_OK;                                                             \
   }
 
 // For float, the normal type of arguments
 #define IMPL_FLOAT_PROP(segName, propName, index) \
   IMPL_PROP_WITH_TYPE(segName, propName, index, float)
 
 // For the boolean flags in arc commands
 #define IMPL_BOOL_PROP(segName, propName, index) \
   IMPL_PROP_WITH_TYPE(segName, propName, index, bool)
 
 
-////////////////////////////////////////////////////////////////////////
-
-class DOMSVGPathSegClosePath
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegClosePath
-{
-public:
-  DOMSVGPathSegClosePath()
-    : DOMSVGPathSeg()
-  {
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGCLOSEPATH
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(ClosePath, PATHSEG_CLOSEPATH)
-
-protected:
-  // To allow IMPL_SVGPATHSEG_SUBCLASS_COMMON above to compile we need an
-  // mArgs, but since C++ doesn't allow zero-sized arrays we need to give it
-  // one (unused) element.
-  float mArgs[1];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(ClosePath)
-
-
-////////////////////////////////////////////////////////////////////////
-
-class DOMSVGPathSegMovetoAbs
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegMovetoAbs
-{
-public:
-  DOMSVGPathSegMovetoAbs(float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x;
-    mArgs[1] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGMOVETOABS
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(MovetoAbs, PATHSEG_MOVETO_ABS)
-
-protected:
-  float mArgs[2];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(MovetoAbs)
+///////////////////////////////////////////////////////////////////////
 
 IMPL_FLOAT_PROP(MovetoAbs, X, 0)
 IMPL_FLOAT_PROP(MovetoAbs, Y, 1)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegMovetoRel
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegMovetoRel
-{
-public:
-  DOMSVGPathSegMovetoRel(float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x;
-    mArgs[1] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGMOVETOREL
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(MovetoRel, PATHSEG_MOVETO_REL)
-
-protected:
-  float mArgs[2];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(MovetoRel)
-
 IMPL_FLOAT_PROP(MovetoRel, X, 0)
 IMPL_FLOAT_PROP(MovetoRel, Y, 1)
 
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegLinetoAbs
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegLinetoAbs
-{
-public:
-  DOMSVGPathSegLinetoAbs(float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x;
-    mArgs[1] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGLINETOABS
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoAbs, PATHSEG_LINETO_ABS)
-
-protected:
-  float mArgs[2];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(LinetoAbs)
-
 IMPL_FLOAT_PROP(LinetoAbs, X, 0)
 IMPL_FLOAT_PROP(LinetoAbs, Y, 1)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegLinetoRel
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegLinetoRel
-{
-public:
-  DOMSVGPathSegLinetoRel(float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x;
-    mArgs[1] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGLINETOREL
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoRel, PATHSEG_LINETO_REL)
-
-protected:
-  float mArgs[2];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(LinetoRel)
-
 IMPL_FLOAT_PROP(LinetoRel, X, 0)
 IMPL_FLOAT_PROP(LinetoRel, Y, 1)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegCurvetoCubicAbs
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegCurvetoCubicAbs
-{
-public:
-  DOMSVGPathSegCurvetoCubicAbs(float x1, float y1,
-                               float x2, float y2,
-                               float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x1;
-    mArgs[1] = y1;
-    mArgs[2] = x2;
-    mArgs[3] = y2;
-    mArgs[4] = x;
-    mArgs[5] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGCURVETOCUBICABS
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoCubicAbs, PATHSEG_CURVETO_CUBIC_ABS)
-
-protected:
-  float mArgs[6];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(CurvetoCubicAbs)
-
 IMPL_FLOAT_PROP(CurvetoCubicAbs, X1, 0)
 IMPL_FLOAT_PROP(CurvetoCubicAbs, Y1, 1)
 IMPL_FLOAT_PROP(CurvetoCubicAbs, X2, 2)
 IMPL_FLOAT_PROP(CurvetoCubicAbs, Y2, 3)
 IMPL_FLOAT_PROP(CurvetoCubicAbs, X, 4)
 IMPL_FLOAT_PROP(CurvetoCubicAbs, Y, 5)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegCurvetoCubicRel
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegCurvetoCubicRel
-{
-public:
-  DOMSVGPathSegCurvetoCubicRel(float x1, float y1,
-                               float x2, float y2,
-                               float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x1;
-    mArgs[1] = y1;
-    mArgs[2] = x2;
-    mArgs[3] = y2;
-    mArgs[4] = x;
-    mArgs[5] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGCURVETOCUBICREL
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoCubicRel, PATHSEG_CURVETO_CUBIC_REL)
-
-protected:
-  float mArgs[6];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(CurvetoCubicRel)
-
 IMPL_FLOAT_PROP(CurvetoCubicRel, X1, 0)
 IMPL_FLOAT_PROP(CurvetoCubicRel, Y1, 1)
 IMPL_FLOAT_PROP(CurvetoCubicRel, X2, 2)
 IMPL_FLOAT_PROP(CurvetoCubicRel, Y2, 3)
 IMPL_FLOAT_PROP(CurvetoCubicRel, X, 4)
 IMPL_FLOAT_PROP(CurvetoCubicRel, Y, 5)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegCurvetoQuadraticAbs
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegCurvetoQuadraticAbs
-{
-public:
-  DOMSVGPathSegCurvetoQuadraticAbs(float x1, float y1,
-                                   float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x1;
-    mArgs[1] = y1;
-    mArgs[2] = x;
-    mArgs[3] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGCURVETOQUADRATICABS
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoQuadraticAbs, PATHSEG_CURVETO_QUADRATIC_ABS)
-
-protected:
-  float mArgs[4];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(CurvetoQuadraticAbs)
-
 IMPL_FLOAT_PROP(CurvetoQuadraticAbs, X1, 0)
 IMPL_FLOAT_PROP(CurvetoQuadraticAbs, Y1, 1)
 IMPL_FLOAT_PROP(CurvetoQuadraticAbs, X, 2)
 IMPL_FLOAT_PROP(CurvetoQuadraticAbs, Y, 3)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegCurvetoQuadraticRel
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegCurvetoQuadraticRel
-{
-public:
-  DOMSVGPathSegCurvetoQuadraticRel(float x1, float y1,
-                                   float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x1;
-    mArgs[1] = y1;
-    mArgs[2] = x;
-    mArgs[3] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGCURVETOQUADRATICREL
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoQuadraticRel, PATHSEG_CURVETO_QUADRATIC_REL)
-
-protected:
-  float mArgs[4];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(CurvetoQuadraticRel)
-
 IMPL_FLOAT_PROP(CurvetoQuadraticRel, X1, 0)
 IMPL_FLOAT_PROP(CurvetoQuadraticRel, Y1, 1)
 IMPL_FLOAT_PROP(CurvetoQuadraticRel, X, 2)
 IMPL_FLOAT_PROP(CurvetoQuadraticRel, Y, 3)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegArcAbs
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegArcAbs
-{
-public:
-  DOMSVGPathSegArcAbs(float r1, float r2, float angle,
-                      bool largeArcFlag, bool sweepFlag,
-                      float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = r1;
-    mArgs[1] = r2;
-    mArgs[2] = angle;
-    mArgs[3] = largeArcFlag;
-    mArgs[4] = sweepFlag;
-    mArgs[5] = x;
-    mArgs[6] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGARCABS
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(ArcAbs, PATHSEG_ARC_ABS)
-
-protected:
-  float mArgs[7];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(ArcAbs)
-
 IMPL_FLOAT_PROP(ArcAbs, R1, 0)
 IMPL_FLOAT_PROP(ArcAbs, R2, 1)
 IMPL_FLOAT_PROP(ArcAbs, Angle, 2)
 IMPL_BOOL_PROP(ArcAbs, LargeArcFlag, 3)
 IMPL_BOOL_PROP(ArcAbs, SweepFlag, 4)
 IMPL_FLOAT_PROP(ArcAbs, X, 5)
 IMPL_FLOAT_PROP(ArcAbs, Y, 6)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegArcRel
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegArcRel
-{
-public:
-  DOMSVGPathSegArcRel(float r1, float r2, float angle,
-                      bool largeArcFlag, bool sweepFlag,
-                      float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = r1;
-    mArgs[1] = r2;
-    mArgs[2] = angle;
-    mArgs[3] = largeArcFlag;
-    mArgs[4] = sweepFlag;
-    mArgs[5] = x;
-    mArgs[6] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGARCREL
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(ArcRel, PATHSEG_ARC_REL)
-
-protected:
-  float mArgs[7];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(ArcRel)
-
 IMPL_FLOAT_PROP(ArcRel, R1, 0)
 IMPL_FLOAT_PROP(ArcRel, R2, 1)
 IMPL_FLOAT_PROP(ArcRel, Angle, 2)
 IMPL_BOOL_PROP(ArcRel, LargeArcFlag, 3)
 IMPL_BOOL_PROP(ArcRel, SweepFlag, 4)
 IMPL_FLOAT_PROP(ArcRel, X, 5)
 IMPL_FLOAT_PROP(ArcRel, Y, 6)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegLinetoHorizontalAbs
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegLinetoHorizontalAbs
-{
-public:
-  DOMSVGPathSegLinetoHorizontalAbs(float x)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGLINETOHORIZONTALABS
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoHorizontalAbs, PATHSEG_LINETO_HORIZONTAL_ABS)
-
-protected:
-  float mArgs[1];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(LinetoHorizontalAbs)
-
 IMPL_FLOAT_PROP(LinetoHorizontalAbs, X, 0)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegLinetoHorizontalRel
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegLinetoHorizontalRel
-{
-public:
-  DOMSVGPathSegLinetoHorizontalRel(float x)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGLINETOHORIZONTALREL
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoHorizontalRel, PATHSEG_LINETO_HORIZONTAL_REL)
-
-protected:
-  float mArgs[1];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(LinetoHorizontalRel)
-
 IMPL_FLOAT_PROP(LinetoHorizontalRel, X, 0)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegLinetoVerticalAbs
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegLinetoVerticalAbs
-{
-public:
-  DOMSVGPathSegLinetoVerticalAbs(float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGLINETOVERTICALABS
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoVerticalAbs, PATHSEG_LINETO_VERTICAL_ABS)
-
-protected:
-  float mArgs[1];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(LinetoVerticalAbs)
-
 IMPL_FLOAT_PROP(LinetoVerticalAbs, Y, 0)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegLinetoVerticalRel
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegLinetoVerticalRel
-{
-public:
-  DOMSVGPathSegLinetoVerticalRel(float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGLINETOVERTICALREL
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoVerticalRel, PATHSEG_LINETO_VERTICAL_REL)
-
-protected:
-  float mArgs[1];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(LinetoVerticalRel)
-
 IMPL_FLOAT_PROP(LinetoVerticalRel, Y, 0)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegCurvetoCubicSmoothAbs
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegCurvetoCubicSmoothAbs
-{
-public:
-  DOMSVGPathSegCurvetoCubicSmoothAbs(float x2, float y2,
-                                     float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x2;
-    mArgs[1] = y2;
-    mArgs[2] = x;
-    mArgs[3] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGCURVETOCUBICSMOOTHABS
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoCubicSmoothAbs, PATHSEG_CURVETO_CUBIC_SMOOTH_ABS)
-
-protected:
-  float mArgs[4];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(CurvetoCubicSmoothAbs)
-
 IMPL_FLOAT_PROP(CurvetoCubicSmoothAbs, X2, 0)
 IMPL_FLOAT_PROP(CurvetoCubicSmoothAbs, Y2, 1)
 IMPL_FLOAT_PROP(CurvetoCubicSmoothAbs, X, 2)
 IMPL_FLOAT_PROP(CurvetoCubicSmoothAbs, Y, 3)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegCurvetoCubicSmoothRel
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegCurvetoCubicSmoothRel
-{
-public:
-  DOMSVGPathSegCurvetoCubicSmoothRel(float x2, float y2,
-                                     float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x2;
-    mArgs[1] = y2;
-    mArgs[2] = x;
-    mArgs[3] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGCURVETOCUBICSMOOTHREL
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoCubicSmoothRel, PATHSEG_CURVETO_CUBIC_SMOOTH_REL)
-
-protected:
-  float mArgs[4];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(CurvetoCubicSmoothRel)
-
 IMPL_FLOAT_PROP(CurvetoCubicSmoothRel, X2, 0)
 IMPL_FLOAT_PROP(CurvetoCubicSmoothRel, Y2, 1)
 IMPL_FLOAT_PROP(CurvetoCubicSmoothRel, X, 2)
 IMPL_FLOAT_PROP(CurvetoCubicSmoothRel, Y, 3)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegCurvetoQuadraticSmoothAbs
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs
-{
-public:
-  DOMSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x;
-    mArgs[1] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGCURVETOQUADRATICSMOOTHABS
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoQuadraticSmoothAbs, PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS)
-
-protected:
-  float mArgs[2];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(CurvetoQuadraticSmoothAbs)
-
 IMPL_FLOAT_PROP(CurvetoQuadraticSmoothAbs, X, 0)
 IMPL_FLOAT_PROP(CurvetoQuadraticSmoothAbs, Y, 1)
 
 
 ////////////////////////////////////////////////////////////////////////
 
-class DOMSVGPathSegCurvetoQuadraticSmoothRel
-  : public DOMSVGPathSeg
-  , public nsIDOMSVGPathSegCurvetoQuadraticSmoothRel
-{
-public:
-  DOMSVGPathSegCurvetoQuadraticSmoothRel(float x, float y)
-    : DOMSVGPathSeg()
-  {
-    mArgs[0] = x;
-    mArgs[1] = y;
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMSVGPATHSEGCURVETOQUADRATICSMOOTHREL
-  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoQuadraticSmoothRel, PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL)
-
-protected:
-  float mArgs[2];
-};
-
-IMPL_NSISUPPORTS_SVGPATHSEG_SUBCLASS(CurvetoQuadraticSmoothRel)
 
 IMPL_FLOAT_PROP(CurvetoQuadraticSmoothRel, X, 0)
 IMPL_FLOAT_PROP(CurvetoQuadraticSmoothRel, Y, 1)
 
 
 
 // This must come after DOMSVGPathSegClosePath et. al. have been declared.
 /* static */ DOMSVGPathSeg*
@@ -834,199 +315,199 @@ DOMSVGPathSeg::CreateFor(DOMSVGPathSegLi
                          bool aIsAnimValItem)
 {
   uint32_t dataIndex = aList->mItems[aListIndex].mInternalDataIndex;
   float *data = &aList->InternalList().mData[dataIndex];
   uint32_t type = SVGPathSegUtils::DecodeType(data[0]);
 
   switch (type)
   {
-  case nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH:
+  case PATHSEG_CLOSEPATH:
     return new DOMSVGPathSegClosePath(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_MOVETO_ABS:
+  case PATHSEG_MOVETO_ABS:
     return new DOMSVGPathSegMovetoAbs(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_MOVETO_REL:
+  case PATHSEG_MOVETO_REL:
     return new DOMSVGPathSegMovetoRel(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_LINETO_ABS:
+  case PATHSEG_LINETO_ABS:
     return new DOMSVGPathSegLinetoAbs(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_LINETO_REL:
+  case PATHSEG_LINETO_REL:
     return new DOMSVGPathSegLinetoRel(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS:
+  case PATHSEG_CURVETO_CUBIC_ABS:
     return new DOMSVGPathSegCurvetoCubicAbs(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_REL:
+  case PATHSEG_CURVETO_CUBIC_REL:
     return new DOMSVGPathSegCurvetoCubicRel(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS:
+  case PATHSEG_CURVETO_QUADRATIC_ABS:
     return new DOMSVGPathSegCurvetoQuadraticAbs(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL:
+  case PATHSEG_CURVETO_QUADRATIC_REL:
     return new DOMSVGPathSegCurvetoQuadraticRel(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_ARC_ABS:
+  case PATHSEG_ARC_ABS:
     return new DOMSVGPathSegArcAbs(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_ARC_REL:
+  case PATHSEG_ARC_REL:
     return new DOMSVGPathSegArcRel(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS:
+  case PATHSEG_LINETO_HORIZONTAL_ABS:
     return new DOMSVGPathSegLinetoHorizontalAbs(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL:
+  case PATHSEG_LINETO_HORIZONTAL_REL:
     return new DOMSVGPathSegLinetoHorizontalRel(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS:
+  case PATHSEG_LINETO_VERTICAL_ABS:
     return new DOMSVGPathSegLinetoVerticalAbs(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_REL:
+  case PATHSEG_LINETO_VERTICAL_REL:
     return new DOMSVGPathSegLinetoVerticalRel(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
+  case PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
     return new DOMSVGPathSegCurvetoCubicSmoothAbs(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
+  case PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
     return new DOMSVGPathSegCurvetoCubicSmoothRel(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
+  case PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
     return new DOMSVGPathSegCurvetoQuadraticSmoothAbs(aList, aListIndex, aIsAnimValItem);
-  case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
+  case PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
     return new DOMSVGPathSegCurvetoQuadraticSmoothRel(aList, aListIndex, aIsAnimValItem);
   default:
     NS_NOTREACHED("Invalid path segment type");
     return nullptr;
   }
 }
 
 
 
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegClosePath()
 {
   return new DOMSVGPathSegClosePath();
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegMovetoAbs(float x, float y)
 {
   return new DOMSVGPathSegMovetoAbs(x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegMovetoRel(float x, float y)
 {
   return new DOMSVGPathSegMovetoRel(x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoAbs(float x, float y)
 {
   return new DOMSVGPathSegLinetoAbs(x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoRel(float x, float y)
 {
   return new DOMSVGPathSegLinetoRel(x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoCubicAbs(float x, float y,
                                 float x1, float y1,
                                 float x2, float y2)
 {
   // Note that we swap from DOM API argument order to the argument order used
   // in the <path> element's 'd' attribute (i.e. we put the arguments for the
   // end point of the segment last instead of first).
 
   return new DOMSVGPathSegCurvetoCubicAbs(x1, y1, x2, y2, x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoCubicRel(float x, float y,
                                 float x1, float y1,
                                 float x2, float y2)
 {
   // See comment in NS_NewSVGPathSegCurvetoCubicAbs!
 
   return new DOMSVGPathSegCurvetoCubicRel(x1, y1, x2, y2, x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoQuadraticAbs(float x, float y,
                                     float x1, float y1)
 {
   // See comment in NS_NewSVGPathSegCurvetoCubicAbs!
 
   return new DOMSVGPathSegCurvetoQuadraticAbs(x1, y1, x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoQuadraticRel(float x, float y,
                                     float x1, float y1)
 {
   // See comment in NS_NewSVGPathSegCurvetoCubicAbs!
 
   return new DOMSVGPathSegCurvetoQuadraticRel(x1, y1, x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegArcAbs(float x, float y,
                        float r1, float r2, float angle,
                        bool largeArcFlag, bool sweepFlag)
 {
   // See comment in NS_NewSVGPathSegCurvetoCubicAbs!
 
   return new DOMSVGPathSegArcAbs(r1, r2, angle, largeArcFlag, sweepFlag, x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegArcRel(float x, float y,
                        float r1, float r2, float angle,
                        bool largeArcFlag, bool sweepFlag)
 {
   // See comment in NS_NewSVGPathSegCurvetoCubicAbs!
 
   return new DOMSVGPathSegArcRel(r1, r2, angle, largeArcFlag, sweepFlag, x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoHorizontalAbs(float x)
 {
   return new DOMSVGPathSegLinetoHorizontalAbs(x);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoHorizontalRel(float x)
 {
   return new DOMSVGPathSegLinetoHorizontalRel(x);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoVerticalAbs(float y)
 {
   return new DOMSVGPathSegLinetoVerticalAbs(y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoVerticalRel(float y)
 {
   return new DOMSVGPathSegLinetoVerticalRel(y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoCubicSmoothAbs(float x, float y,
                                       float x2, float y2)
 {
   // See comment in NS_NewSVGPathSegCurvetoCubicAbs!
 
   return new DOMSVGPathSegCurvetoCubicSmoothAbs(x2, y2, x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoCubicSmoothRel(float x, float y,
                                       float x2, float y2)
 {
   // See comment in NS_NewSVGPathSegCurvetoCubicAbs!
 
   return new DOMSVGPathSegCurvetoCubicSmoothRel(x2, y2, x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y)
 {
   return new DOMSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoQuadraticSmoothRel(float x, float y)
 {
   return new DOMSVGPathSegCurvetoQuadraticSmoothRel(x, y);
 }
 
--- a/content/svg/content/src/DOMSVGPathSeg.h
+++ b/content/svg/content/src/DOMSVGPathSeg.h
@@ -4,32 +4,81 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_DOMSVGPATHSEG_H__
 #define MOZILLA_DOMSVGPATHSEG_H__
 
 #include "DOMSVGPathSegList.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
-#include "nsIDOMSVGPathSeg.h"
+#include "nsWrapperCache.h"
+#include "SVGPathSegUtils.h"
+#include "mozilla/dom/SVGPathSegBinding.h"
 
 class nsSVGElement;
 
 // We make DOMSVGPathSeg a pseudo-interface to allow us to QI to it in order to
 // check that the objects that scripts pass to DOMSVGPathSegList methods are
 // our *native* path seg objects.
 //
 // {494A7566-DC26-40C8-9122-52ABD76870C4}
 #define MOZILLA_DOMSVGPATHSEG_IID \
   { 0x494A7566, 0xDC26, 0x40C8, { 0x91, 0x22, 0x52, 0xAB, 0xD7, 0x68, 0x70, 0xC4 } }
 
 #define MOZ_SVG_LIST_INDEX_BIT_COUNT 31
 
 namespace mozilla {
 
+#define CHECK_ARG_COUNT_IN_SYNC(segType)                                      \
+          NS_ABORT_IF_FALSE(ArrayLength(mArgs) ==                             \
+            SVGPathSegUtils::ArgCountForType(uint32_t(segType)) ||            \
+            uint32_t(segType) == PATHSEG_CLOSEPATH,                           \
+            "Arg count/array size out of sync")
+
+#define IMPL_SVGPATHSEG_SUBCLASS_COMMON(segName, segType)                     \
+  DOMSVGPathSeg##segName(const float *aArgs)                                  \
+    : DOMSVGPathSeg()                                                         \
+  {                                                                           \
+    CHECK_ARG_COUNT_IN_SYNC(segType);                                         \
+    memcpy(mArgs, aArgs,                                                      \
+        SVGPathSegUtils::ArgCountForType(uint32_t(segType)) * sizeof(float)); \
+  }                                                                           \
+  DOMSVGPathSeg##segName(DOMSVGPathSegList *aList,                            \
+                         uint32_t aListIndex,                                 \
+                         bool aIsAnimValItem)                                 \
+    : DOMSVGPathSeg(aList, aListIndex, aIsAnimValItem)                        \
+  {                                                                           \
+    CHECK_ARG_COUNT_IN_SYNC(segType);                                         \
+  }                                                                           \
+  /* From DOMSVGPathSeg: */                                                   \
+  virtual uint32_t                                                            \
+  Type() const                                                                \
+  {                                                                           \
+    return segType;                                                           \
+  }                                                                           \
+  virtual DOMSVGPathSeg*                                                      \
+  Clone()                                                                     \
+  {                                                                           \
+    /* InternalItem() + 1, because we're skipping the encoded seg type */     \
+    float *args = IsInList() ? InternalItem() + 1 : mArgs;                    \
+    return new DOMSVGPathSeg##segName(args);                                  \
+  }                                                                           \
+  virtual float*                                                              \
+  PtrToMemberArgs()                                                           \
+  {                                                                           \
+    return mArgs;                                                             \
+  }                                                                           \
+                                                                              \
+  virtual JSObject*                                                           \
+  WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap)            \
+  {                                                                           \
+    return dom::SVGPathSeg##segName##Binding::Wrap(aCx, aScope, this, aTriedToWrap); \
+  }
+
+
 /**
  * Class DOMSVGPathSeg
  *
  * This class is the base class of the classes that create the DOM objects that
  * wrap the internal path segments that are encoded in an SVGPathData. Its
  * sub-classes are also used to create the objects returned by
  * SVGPathElement.createSVGPathSegXxx().
  *
@@ -38,23 +87,23 @@ namespace mozilla {
  *
  * See the architecture comment in DOMSVGLength.h (yes, LENGTH) for an overview
  * of the important points regarding how this specific class works.
  *
  * The main differences between this class and DOMSVGLength is that we have
  * sub-classes (it does not), and the "internal counterpart" that we provide a
  * DOM wrapper for is a list of floats, not an instance of an internal class.
  */
-class DOMSVGPathSeg : public nsIDOMSVGPathSeg
+class DOMSVGPathSeg : public nsISupports,
+                      public nsWrapperCache
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGPATHSEG_IID)
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(DOMSVGPathSeg)
-  NS_DECL_NSIDOMSVGPATHSEG
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPathSeg)
 
   /**
    * Unlike the other list classes, we hide our ctor (because no one should be
    * creating instances of this class directly). This factory method in exposed
    * instead to take care of creating instances of the correct sub-class.
    */
   static DOMSVGPathSeg *CreateFor(DOMSVGPathSegList *aList,
                                   uint32_t aListIndex,
@@ -116,16 +165,23 @@ public:
    */
   void ToSVGPathSegEncodedData(float *aData);
 
   /**
    * The type of this path segment.
    */
   virtual uint32_t Type() const = 0;
 
+  // WebIDL
+  DOMSVGPathSegList* GetParentObject() { return mList; }
+  uint16_t PathSegType() const { return Type(); }
+  void GetPathSegTypeAsLetter(nsAString &aPathSegTypeAsLetter)
+    { aPathSegTypeAsLetter = SVGPathSegUtils::GetPathSegTypeAsLetter(Type()); }
+  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap) = 0;
+
 protected:
 
   /**
    * Generic ctor for DOMSVGPathSeg objects that are created for an attribute.
    */
   DOMSVGPathSeg(DOMSVGPathSegList *aList,
                 uint32_t aListIndex,
                 bool aIsAnimValItem);
@@ -173,82 +229,574 @@ protected:
   // that if you change the capacity of any of the following.
 
   uint32_t mListIndex:MOZ_SVG_LIST_INDEX_BIT_COUNT;
   uint32_t mIsAnimValItem:1; // uint32_t because MSVC won't pack otherwise
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(DOMSVGPathSeg, MOZILLA_DOMSVGPATHSEG_IID)
 
+class DOMSVGPathSegClosePath
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegClosePath()
+    : DOMSVGPathSeg()
+  {
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(ClosePath, PATHSEG_CLOSEPATH)
+
+protected:
+  // To allow IMPL_SVGPATHSEG_SUBCLASS_COMMON above to compile we need an
+  // mArgs, but since C++ doesn't allow zero-sized arrays we need to give it
+  // one (unused) element.
+  float mArgs[1];
+};
+
+class DOMSVGPathSegMovetoAbs
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegMovetoAbs(float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x;
+    mArgs[1] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(MovetoAbs, PATHSEG_MOVETO_ABS)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+
+protected:
+  float mArgs[2];
+};
+
+class DOMSVGPathSegMovetoRel
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegMovetoRel(float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x;
+    mArgs[1] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(MovetoRel, PATHSEG_MOVETO_REL)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+
+protected:
+  float mArgs[2];
+};
+
+class DOMSVGPathSegLinetoAbs
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegLinetoAbs(float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x;
+    mArgs[1] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoAbs, PATHSEG_LINETO_ABS)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+
+protected:
+  float mArgs[2];
+};
+
+class DOMSVGPathSegLinetoRel
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegLinetoRel(float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x;
+    mArgs[1] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoRel, PATHSEG_LINETO_REL)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+
+protected:
+  float mArgs[2];
+};
+
+class DOMSVGPathSegCurvetoCubicAbs
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegCurvetoCubicAbs(float x1, float y1,
+                               float x2, float y2,
+                               float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x1;
+    mArgs[1] = y1;
+    mArgs[2] = x2;
+    mArgs[3] = y2;
+    mArgs[4] = x;
+    mArgs[5] = y;
+  }
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+  float X1();
+  void SetX1(float aX1, ErrorResult& rv);
+  float Y1();
+  void SetY1(float aY1, ErrorResult& rv);
+  float X2();
+  void SetX2(float aX2, ErrorResult& rv);
+  float Y2();
+  void SetY2(float aY2, ErrorResult& rv);
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoCubicAbs, PATHSEG_CURVETO_CUBIC_ABS)
+
+protected:
+  float mArgs[6];
+};
+
+class DOMSVGPathSegCurvetoCubicRel
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegCurvetoCubicRel(float x1, float y1,
+                               float x2, float y2,
+                               float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x1;
+    mArgs[1] = y1;
+    mArgs[2] = x2;
+    mArgs[3] = y2;
+    mArgs[4] = x;
+    mArgs[5] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoCubicRel, PATHSEG_CURVETO_CUBIC_REL)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+  float X1();
+  void SetX1(float aX1, ErrorResult& rv);
+  float Y1();
+  void SetY1(float aY1, ErrorResult& rv);
+  float X2();
+  void SetX2(float aX2, ErrorResult& rv);
+  float Y2();
+  void SetY2(float aY2, ErrorResult& rv);
+
+protected:
+  float mArgs[6];
+};
+
+class DOMSVGPathSegCurvetoQuadraticAbs
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegCurvetoQuadraticAbs(float x1, float y1,
+                                   float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x1;
+    mArgs[1] = y1;
+    mArgs[2] = x;
+    mArgs[3] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoQuadraticAbs, PATHSEG_CURVETO_QUADRATIC_ABS)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+  float X1();
+  void SetX1(float aX1, ErrorResult& rv);
+  float Y1();
+  void SetY1(float aY1, ErrorResult& rv);
+
+protected:
+  float mArgs[4];
+};
+
+class DOMSVGPathSegCurvetoQuadraticRel
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegCurvetoQuadraticRel(float x1, float y1,
+                                   float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x1;
+    mArgs[1] = y1;
+    mArgs[2] = x;
+    mArgs[3] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoQuadraticRel, PATHSEG_CURVETO_QUADRATIC_REL)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+  float X1();
+  void SetX1(float aX1, ErrorResult& rv);
+  float Y1();
+  void SetY1(float aY1, ErrorResult& rv);
+
+protected:
+  float mArgs[4];
+};
+
+class DOMSVGPathSegArcAbs
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegArcAbs(float r1, float r2, float angle,
+                      bool largeArcFlag, bool sweepFlag,
+                      float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = r1;
+    mArgs[1] = r2;
+    mArgs[2] = angle;
+    mArgs[3] = largeArcFlag;
+    mArgs[4] = sweepFlag;
+    mArgs[5] = x;
+    mArgs[6] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(ArcAbs, PATHSEG_ARC_ABS)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+  float R1();
+  void SetR1(float aR1, ErrorResult& rv);
+  float R2();
+  void SetR2(float aR2, ErrorResult& rv);
+  float Angle();
+  void SetAngle(float aAngle, ErrorResult& rv);
+  bool LargeArcFlag();
+  void SetLargeArcFlag(bool aFlag, ErrorResult& rv);
+  bool SweepFlag();
+  void SetSweepFlag(bool aFlag, ErrorResult& rv);
+
+protected:
+  float mArgs[7];
+};
+
+class DOMSVGPathSegArcRel
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegArcRel(float r1, float r2, float angle,
+                      bool largeArcFlag, bool sweepFlag,
+                      float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = r1;
+    mArgs[1] = r2;
+    mArgs[2] = angle;
+    mArgs[3] = largeArcFlag;
+    mArgs[4] = sweepFlag;
+    mArgs[5] = x;
+    mArgs[6] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(ArcRel, PATHSEG_ARC_REL)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+  float R1();
+  void SetR1(float aR1, ErrorResult& rv);
+  float R2();
+  void SetR2(float aR2, ErrorResult& rv);
+  float Angle();
+  void SetAngle(float aAngle, ErrorResult& rv);
+  bool LargeArcFlag();
+  void SetLargeArcFlag(bool aFlag, ErrorResult& rv);
+  bool SweepFlag();
+  void SetSweepFlag(bool aFlag, ErrorResult& rv);
+
+protected:
+  float mArgs[7];
+};
+
+class DOMSVGPathSegLinetoHorizontalAbs
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegLinetoHorizontalAbs(float x)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoHorizontalAbs, PATHSEG_LINETO_HORIZONTAL_ABS)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+
+protected:
+  float mArgs[1];
+};
+
+class DOMSVGPathSegLinetoHorizontalRel
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegLinetoHorizontalRel(float x)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoHorizontalRel, PATHSEG_LINETO_HORIZONTAL_REL)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+
+protected:
+  float mArgs[1];
+};
+
+class DOMSVGPathSegLinetoVerticalAbs
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegLinetoVerticalAbs(float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoVerticalAbs, PATHSEG_LINETO_VERTICAL_ABS)
+
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+
+protected:
+  float mArgs[1];
+};
+
+class DOMSVGPathSegLinetoVerticalRel
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegLinetoVerticalRel(float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(LinetoVerticalRel, PATHSEG_LINETO_VERTICAL_REL)
+
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+
+protected:
+  float mArgs[1];
+};
+
+class DOMSVGPathSegCurvetoCubicSmoothAbs
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegCurvetoCubicSmoothAbs(float x2, float y2,
+                                     float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x2;
+    mArgs[1] = y2;
+    mArgs[2] = x;
+    mArgs[3] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoCubicSmoothAbs, PATHSEG_CURVETO_CUBIC_SMOOTH_ABS)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+  float X2();
+  void SetX2(float aX2, ErrorResult& rv);
+  float Y2();
+  void SetY2(float aY2, ErrorResult& rv);
+
+protected:
+  float mArgs[4];
+};
+
+class DOMSVGPathSegCurvetoCubicSmoothRel
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegCurvetoCubicSmoothRel(float x2, float y2,
+                                     float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x2;
+    mArgs[1] = y2;
+    mArgs[2] = x;
+    mArgs[3] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoCubicSmoothRel, PATHSEG_CURVETO_CUBIC_SMOOTH_REL)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+  float X2();
+  void SetX2(float aX2, ErrorResult& rv);
+  float Y2();
+  void SetY2(float aY2, ErrorResult& rv);
+
+protected:
+  float mArgs[4];
+};
+
+class DOMSVGPathSegCurvetoQuadraticSmoothAbs
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x;
+    mArgs[1] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoQuadraticSmoothAbs, PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+
+protected:
+  float mArgs[2];
+};
+
+class DOMSVGPathSegCurvetoQuadraticSmoothRel
+  : public DOMSVGPathSeg
+{
+public:
+  DOMSVGPathSegCurvetoQuadraticSmoothRel(float x, float y)
+    : DOMSVGPathSeg()
+  {
+    mArgs[0] = x;
+    mArgs[1] = y;
+  }
+
+  IMPL_SVGPATHSEG_SUBCLASS_COMMON(CurvetoQuadraticSmoothRel, PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL)
+
+  float X();
+  void SetX(float aX, ErrorResult& rv);
+  float Y();
+  void SetY(float aY, ErrorResult& rv);
+
+protected:
+  float mArgs[2];
+};
+
 } // namespace mozilla
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegClosePath();
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegMovetoAbs(float x, float y);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegMovetoRel(float x, float y);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoAbs(float x, float y);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoRel(float x, float y);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoCubicAbs(float x, float y,
                                 float x1, float y1,
                                 float x2, float y2);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoCubicRel(float x, float y,
                                 float x1, float y1,
                                 float x2, float y2);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoQuadraticAbs(float x, float y,
                                     float x1, float y1);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoQuadraticRel(float x, float y,
                                     float x1, float y1);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegArcAbs(float x, float y,
                        float r1, float r2, float angle,
                        bool largeArcFlag, bool sweepFlag);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegArcRel(float x, float y,
                        float r1, float r2, float angle,
                        bool largeArcFlag, bool sweepFlag);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoHorizontalAbs(float x);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoHorizontalRel(float x);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoVerticalAbs(float y);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegLinetoVerticalRel(float y);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoCubicSmoothAbs(float x, float y,
                                       float x2, float y2);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoCubicSmoothRel(float x, float y,
                                       float x2, float y2);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y);
 
-nsIDOMSVGPathSeg*
+mozilla::DOMSVGPathSeg*
 NS_NewSVGPathSegCurvetoQuadraticSmoothRel(float x, float y);
 
 #undef MOZ_SVG_LIST_INDEX_BIT_COUNT
 
 #endif // MOZILLA_DOMSVGPATHSEG_H__
--- a/content/svg/content/src/DOMSVGPathSegList.cpp
+++ b/content/svg/content/src/DOMSVGPathSegList.cpp
@@ -271,56 +271,57 @@ DOMSVGPathSegList::Clear(ErrorResult& aE
 NS_IMETHODIMP
 DOMSVGPathSegList::Clear()
 {
   ErrorResult rv;
   Clear(rv);
   return rv.ErrorCode();
 }
 
-already_AddRefed<nsIDOMSVGPathSeg>
-DOMSVGPathSegList::Initialize(nsIDOMSVGPathSeg *aNewItem, ErrorResult& aError)
+already_AddRefed<DOMSVGPathSeg>
+DOMSVGPathSegList::Initialize(DOMSVGPathSeg& aNewItem, ErrorResult& aError)
 {
   if (IsAnimValList()) {
     aError.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return nullptr;
   }
 
   // If aNewItem is already in a list we should insert a clone of aNewItem,
   // and for consistency, this should happen even if *this* is the list that
   // aNewItem is currently in. Note that in the case of aNewItem being in this
   // list, the Clear() call before the InsertItemBefore() call would remove it
   // from this list, and so the InsertItemBefore() call would not insert a
   // clone of aNewItem, it would actually insert aNewItem. To prevent that
   // from happening we have to do the clone here, if necessary.
 
-  nsCOMPtr<DOMSVGPathSeg> domItem = do_QueryInterface(aNewItem);
-  if (!domItem) {
-    aError.Throw(NS_ERROR_DOM_SVG_WRONG_TYPE_ERR);
-    return nullptr;
-  }
-  if (domItem->HasOwner()) {
-    aNewItem = domItem->Clone();
+  nsRefPtr<DOMSVGPathSeg> domItem = &aNewItem;
+  if (aNewItem.HasOwner()) {
+    domItem = aNewItem.Clone();
   }
 
   Clear(aError);
   MOZ_ASSERT(!aError.Failed(), "How could this fail?");
-  return InsertItemBefore(aNewItem, 0, aError);
+  return InsertItemBefore(*domItem, 0, aError);
 }
 
 NS_IMETHODIMP
 DOMSVGPathSegList::Initialize(nsIDOMSVGPathSeg *newItem,
                               nsIDOMSVGPathSeg **_retval)
 {
-  ErrorResult rv;
-  *_retval = Initialize(newItem, rv).get();
+  nsCOMPtr<DOMSVGPathSeg> domItem = do_QueryInterface(newItem);
+  if (!domItem) {
+    *_retval = nullptr;
+    return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
+  }
+   ErrorResult rv;
+  *_retval = Initialize(*domItem, rv).get();
   return rv.ErrorCode();
 }
 
-nsIDOMSVGPathSeg*
+DOMSVGPathSeg*
 DOMSVGPathSegList::IndexedGetter(uint32_t aIndex, bool& aFound,
                                  ErrorResult& aError)
 {
   if (IsAnimValList()) {
     Element()->FlushAnimations();
   }
   aFound = aIndex < LengthNoFlush();
   if (aFound) {
@@ -334,18 +335,18 @@ NS_IMETHODIMP
 DOMSVGPathSegList::GetItem(uint32_t aIndex,
                            nsIDOMSVGPathSeg **_retval)
 {
   ErrorResult rv;
   NS_IF_ADDREF(*_retval = GetItem(aIndex, rv));
   return rv.ErrorCode();
 }
 
-already_AddRefed<nsIDOMSVGPathSeg>
-DOMSVGPathSegList::InsertItemBefore(nsIDOMSVGPathSeg *aNewItem,
+already_AddRefed<DOMSVGPathSeg>
+DOMSVGPathSegList::InsertItemBefore(DOMSVGPathSeg& aNewItem,
                                     uint32_t aIndex,
                                     ErrorResult& aError)
 {
   if (IsAnimValList()) {
     aError.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return nullptr;
   }
 
@@ -356,21 +357,17 @@ DOMSVGPathSegList::InsertItemBefore(nsID
     aIndex = LengthNoFlush();
     internalIndex = InternalList().mData.Length();
   }
   if (aIndex >= DOMSVGPathSeg::MaxListIndex()) {
     aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return nullptr;
   }
 
-  nsCOMPtr<DOMSVGPathSeg> domItem = do_QueryInterface(aNewItem);
-  if (!domItem) {
-    aError.Throw(NS_ERROR_DOM_SVG_WRONG_TYPE_ERR);
-    return nullptr;
-  }
+  nsRefPtr<DOMSVGPathSeg> domItem = &aNewItem;
   if (domItem->HasOwner()) {
     domItem = domItem->Clone(); // must do this before changing anything!
   }
 
   uint32_t argCount = SVGPathSegUtils::ArgCountForType(domItem->Type());
 
   // Ensure we have enough memory so we can avoid complex error handling below:
   if (!mItems.SetCapacity(mItems.Length() + 1) ||
@@ -403,40 +400,42 @@ DOMSVGPathSegList::InsertItemBefore(nsID
   return domItem.forget();
 }
 
 NS_IMETHODIMP
 DOMSVGPathSegList::InsertItemBefore(nsIDOMSVGPathSeg *aNewItem,
                                     uint32_t aIndex,
                                     nsIDOMSVGPathSeg **_retval)
 {
-  ErrorResult rv;
-  *_retval = InsertItemBefore(aNewItem, aIndex, rv).get();
+  nsCOMPtr<DOMSVGPathSeg> domItem = do_QueryInterface(aNewItem);
+  if (!domItem) {
+    *_retval = nullptr;
+    return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
+  }
+   ErrorResult rv;
+  *_retval = InsertItemBefore(*domItem, aIndex, rv).get();
   return rv.ErrorCode();
 }
 
-already_AddRefed<nsIDOMSVGPathSeg>
-DOMSVGPathSegList::ReplaceItem(nsIDOMSVGPathSeg *aNewItem,
+already_AddRefed<DOMSVGPathSeg>
+DOMSVGPathSegList::ReplaceItem(DOMSVGPathSeg& aNewItem,
                                uint32_t aIndex,
                                ErrorResult& aError)
 {
   if (IsAnimValList()) {
     aError.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return nullptr;
   }
 
-  nsCOMPtr<DOMSVGPathSeg> domItem = do_QueryInterface(aNewItem);
-  if (!domItem) {
-    aError.Throw(NS_ERROR_DOM_SVG_WRONG_TYPE_ERR);
-    return nullptr;
-  }
   if (aIndex >= LengthNoFlush()) {
     aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return nullptr;
   }
+
+  nsRefPtr<DOMSVGPathSeg> domItem = &aNewItem;
   if (domItem->HasOwner()) {
     domItem = domItem->Clone(); // must do this before changing anything!
   }
 
   nsAttrValue emptyOrOldValue = Element()->WillChangePathSegList();
   if (ItemAt(aIndex)) {
     // Notify any existing DOM item of removal *before* modifying the lists so
     // that the DOM item can copy the *old* value at its index:
@@ -480,22 +479,27 @@ DOMSVGPathSegList::ReplaceItem(nsIDOMSVG
   return domItem.forget();
 }
 
 NS_IMETHODIMP
 DOMSVGPathSegList::ReplaceItem(nsIDOMSVGPathSeg *aNewItem,
                                uint32_t aIndex,
                                nsIDOMSVGPathSeg **_retval)
 {
+  nsCOMPtr<DOMSVGPathSeg> domItem = do_QueryInterface(aNewItem);
+  if (!domItem) {
+    *_retval = nullptr;
+    return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
+  }
   ErrorResult rv;
-  *_retval = ReplaceItem(aNewItem, aIndex, rv).get();
+  *_retval = ReplaceItem(*domItem, aIndex, rv).get();
   return rv.ErrorCode();
 }
 
-already_AddRefed<nsIDOMSVGPathSeg>
+already_AddRefed<DOMSVGPathSeg>
 DOMSVGPathSegList::RemoveItem(uint32_t aIndex,
                               ErrorResult& aError)
 {
   if (IsAnimValList()) {
     aError.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
     return nullptr;
   }
 
@@ -505,17 +509,17 @@ DOMSVGPathSegList::RemoveItem(uint32_t a
   }
   // We have to return the removed item, so make sure it exists:
   EnsureItemAt(aIndex);
 
   nsAttrValue emptyOrOldValue = Element()->WillChangePathSegList();
   // Notify the DOM item of removal *before* modifying the lists so that the
   // DOM item can copy its *old* value:
   ItemAt(aIndex)->RemovingFromList();
-  nsCOMPtr<nsIDOMSVGPathSeg> result = ItemAt(aIndex);
+  nsRefPtr<DOMSVGPathSeg> result = ItemAt(aIndex);
 
   uint32_t internalIndex = mItems[aIndex].mInternalDataIndex;
   uint32_t segType = SVGPathSegUtils::DecodeType(InternalList().mData[internalIndex]);
   uint32_t argCount = SVGPathSegUtils::ArgCountForType(segType);
 
   // Now that we know we're removing, keep animVal list in sync as necessary.
   // Do this *before* touching InternalList() so the removed item can get its
   // internal value.
@@ -541,18 +545,23 @@ DOMSVGPathSegList::RemoveItem(uint32_t a
   *_retval = RemoveItem(aIndex, rv).get();
   return rv.ErrorCode();
 }
 
 NS_IMETHODIMP
 DOMSVGPathSegList::AppendItem(nsIDOMSVGPathSeg *aNewItem,
                               nsIDOMSVGPathSeg **_retval)
 {
+  nsCOMPtr<DOMSVGPathSeg> domItem = do_QueryInterface(aNewItem);
+  if (!domItem) {
+    *_retval = nullptr;
+    return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
+  }
   ErrorResult rv;
-  *_retval = AppendItem(aNewItem, rv).get();
+  *_retval = AppendItem(*domItem, rv).get();
   return rv.ErrorCode();
 }
 
 NS_IMETHODIMP
 DOMSVGPathSegList::GetLength(uint32_t *aNumberOfItems)
 {
   return GetNumberOfItems(aNumberOfItems);
 }
--- a/content/svg/content/src/DOMSVGPathSegList.h
+++ b/content/svg/content/src/DOMSVGPathSegList.h
@@ -12,18 +12,16 @@
 #include "nsDebug.h"
 #include "nsIDOMSVGPathSegList.h"
 #include "nsSVGElement.h"
 #include "nsTArray.h"
 #include "SVGPathData.h" // IWYU pragma: keep
 #include "mozilla/Attributes.h"
 #include "mozilla/ErrorResult.h"
 
-class nsIDOMSVGPathSeg;
-
 namespace mozilla {
 
 class DOMSVGPathSeg;
 class SVGAnimatedPathSegList;
 
 /**
  * Class DOMSVGPathSegList
  *
@@ -135,39 +133,39 @@ public:
   uint32_t NumberOfItems() const
   {
     if (IsAnimValList()) {
       Element()->FlushAnimations();
     }
     return LengthNoFlush();
   }
   void Clear(ErrorResult& aError);
-  already_AddRefed<nsIDOMSVGPathSeg> Initialize(nsIDOMSVGPathSeg *aNewItem,
-                                                ErrorResult& aError);
-  nsIDOMSVGPathSeg* GetItem(uint32_t aIndex, ErrorResult& aError)
+  already_AddRefed<DOMSVGPathSeg> Initialize(DOMSVGPathSeg& aNewItem,
+                                             ErrorResult& aError);
+  DOMSVGPathSeg* GetItem(uint32_t aIndex, ErrorResult& aError)
   {
     bool found;
-    nsIDOMSVGPathSeg* item = IndexedGetter(aIndex, found, aError);
+    DOMSVGPathSeg* item = IndexedGetter(aIndex, found, aError);
     if (!found) {
       aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     }
     return item;
   }
-  nsIDOMSVGPathSeg* IndexedGetter(uint32_t aIndex, bool& found,
-                                  ErrorResult& aError);
-  already_AddRefed<nsIDOMSVGPathSeg> InsertItemBefore(nsIDOMSVGPathSeg *aNewItem,
-                                                      uint32_t aIndex,
-                                                      ErrorResult& aError);
-  already_AddRefed<nsIDOMSVGPathSeg> ReplaceItem(nsIDOMSVGPathSeg *aNewItem,
-                                                 uint32_t aIndex,
-                                                 ErrorResult& aError);
-  already_AddRefed<nsIDOMSVGPathSeg> RemoveItem(uint32_t aIndex,
-                                                ErrorResult& aError);
-  already_AddRefed<nsIDOMSVGPathSeg> AppendItem(nsIDOMSVGPathSeg *aNewItem,
-                                                ErrorResult& aError)
+  DOMSVGPathSeg* IndexedGetter(uint32_t aIndex, bool& found,
+                               ErrorResult& aError);
+  already_AddRefed<DOMSVGPathSeg> InsertItemBefore(DOMSVGPathSeg& aNewItem,
+                                                   uint32_t aIndex,
+                                                   ErrorResult& aError);
+  already_AddRefed<DOMSVGPathSeg> ReplaceItem(DOMSVGPathSeg& aNewItem,
+                                              uint32_t aIndex,
+                                              ErrorResult& aError);
+  already_AddRefed<DOMSVGPathSeg> RemoveItem(uint32_t aIndex,
+                                             ErrorResult& aError);
+  already_AddRefed<DOMSVGPathSeg> AppendItem(DOMSVGPathSeg& aNewItem,
+                                             ErrorResult& aError)
   {
     return InsertItemBefore(aNewItem, LengthNoFlush(), aError);
   }
   uint32_t Length() const
   {
     return NumberOfItems();
   }
 
--- a/content/svg/content/src/SVGMotionSMILType.cpp
+++ b/content/svg/content/src/SVGMotionSMILType.cpp
@@ -6,17 +6,16 @@
 /* implementation of nsISMILType for use by <animateMotion> element */
 
 #include "SVGMotionSMILType.h"
 #include "nsSMILValue.h"
 #include "nsDebug.h"
 #include "nsSVGAngle.h"
 #include "nsIDOMSVGAngle.h"
 #include "nsSVGPathElement.h"
-#include "nsIDOMSVGPathSeg.h"
 #include "nsIDOMSVGPathSegList.h"
 #include "nsMathUtils.h"
 #include <math.h>
 
 namespace mozilla {
 
 /*static*/ SVGMotionSMILType SVGMotionSMILType::sSingleton;
 
--- a/content/svg/content/src/SVGPathData.cpp
+++ b/content/svg/content/src/SVGPathData.cpp
@@ -13,18 +13,18 @@
 #include <stdarg.h>
 #include "SVGContentUtils.h"
 #include "SVGPathSegUtils.h"
 
 using namespace mozilla;
 
 static bool IsMoveto(uint16_t aSegType)
 {
-  return aSegType == nsIDOMSVGPathSeg::PATHSEG_MOVETO_ABS ||
-         aSegType == nsIDOMSVGPathSeg::PATHSEG_MOVETO_REL;
+  return aSegType == PATHSEG_MOVETO_ABS ||
+         aSegType == PATHSEG_MOVETO_REL;
 }
 
 nsresult
 SVGPathData::CopyFrom(const SVGPathData& rhs)
 {
   if (!mData.SetCapacity(rhs.mData.Length())) {
     // Yes, we do want fallible alloc here
     return NS_ERROR_OUT_OF_MEMORY;
@@ -158,18 +158,18 @@ SVGPathData::GetDistancesFromOriginToEnd
     // the duration...':
     //
     // http://www.w3.org/TR/SVG11/animate.html#AnimateMotionElement
     //
     // This is important in the non-default case of calcMode="linear". In
     // this case an equal amount of time is spent on each path segment,
     // except on moveto segments which are jumped over immediately.
 
-    if (i == 0 || (segType != nsIDOMSVGPathSeg::PATHSEG_MOVETO_ABS &&
-                   segType != nsIDOMSVGPathSeg::PATHSEG_MOVETO_REL)) {
+    if (i == 0 || (segType != PATHSEG_MOVETO_ABS &&
+                   segType != PATHSEG_MOVETO_REL)) {
       if (!aOutput->AppendElement(state.length)) {
         return false;
       }
     }
     i += 1 + SVGPathSegUtils::ArgCountForType(segType);
   }
 
   NS_ABORT_IF_FALSE(i == mData.Length(), "Very, very bad - mData corrupt?");
@@ -236,34 +236,34 @@ ApproximateZeroLengthSubpathSquareCaps(c
   aCtx->MoveTo(aPoint);
 }
 
 #define MAYBE_APPROXIMATE_ZERO_LENGTH_SUBPATH_SQUARE_CAPS                     \
   do {                                                                        \
     if (capsAreSquare && !subpathHasLength && subpathContainsNonArc &&        \
         SVGPathSegUtils::IsValidType(prevSegType) &&                          \
         (!IsMoveto(prevSegType) ||                                            \
-         segType == nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH)) {                   \
+         segType == PATHSEG_CLOSEPATH)) {                                     \
       ApproximateZeroLengthSubpathSquareCaps(segStart, aCtx);                 \
     }                                                                         \
   } while(0)
 
 void
 SVGPathData::ConstructPath(gfxContext *aCtx) const
 {
   if (mData.IsEmpty() || !IsMoveto(SVGPathSegUtils::DecodeType(mData[0]))) {
     return; // paths without an initial moveto are invalid
   }
 
   bool capsAreSquare = aCtx->CurrentLineCap() == gfxContext::LINE_CAP_SQUARE;
   bool subpathHasLength = false;  // visual length
   bool subpathContainsNonArc = false;
 
-  uint32_t segType     = nsIDOMSVGPathSeg::PATHSEG_UNKNOWN;
-  uint32_t prevSegType = nsIDOMSVGPathSeg::PATHSEG_UNKNOWN;
+  uint32_t segType     = PATHSEG_UNKNOWN;
+  uint32_t prevSegType = PATHSEG_UNKNOWN;
   gfxPoint pathStart(0.0, 0.0); // start point of [sub]path
   gfxPoint segStart(0.0, 0.0);
   gfxPoint segEnd;
   gfxPoint cp1, cp2;            // previous bezier's control points
   gfxPoint tcp1, tcp2;          // temporaries
 
   // Regarding cp1 and cp2: If the previous segment was a cubic bezier curve,
   // then cp2 is its second control point. If the previous segment was a
@@ -271,112 +271,112 @@ SVGPathData::ConstructPath(gfxContext *a
 
   uint32_t i = 0;
   while (i < mData.Length()) {
     segType = SVGPathSegUtils::DecodeType(mData[i++]);
     uint32_t argCount = SVGPathSegUtils::ArgCountForType(segType);
 
     switch (segType)
     {
-    case nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH:
+    case PATHSEG_CLOSEPATH:
       // set this early to allow drawing of square caps for "M{x},{y} Z":
       subpathContainsNonArc = true;
       MAYBE_APPROXIMATE_ZERO_LENGTH_SUBPATH_SQUARE_CAPS;
       segEnd = pathStart;
       aCtx->ClosePath();
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_MOVETO_ABS:
+    case PATHSEG_MOVETO_ABS:
       MAYBE_APPROXIMATE_ZERO_LENGTH_SUBPATH_SQUARE_CAPS;
       pathStart = segEnd = gfxPoint(mData[i], mData[i+1]);
       aCtx->MoveTo(segEnd);
       subpathHasLength = false;
       subpathContainsNonArc = false;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_MOVETO_REL:
+    case PATHSEG_MOVETO_REL:
       MAYBE_APPROXIMATE_ZERO_LENGTH_SUBPATH_SQUARE_CAPS;
       pathStart = segEnd = segStart + gfxPoint(mData[i], mData[i+1]);
       aCtx->MoveTo(segEnd);
       subpathHasLength = false;
       subpathContainsNonArc = false;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_ABS:
+    case PATHSEG_LINETO_ABS:
       segEnd = gfxPoint(mData[i], mData[i+1]);
       aCtx->LineTo(segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_REL:
+    case PATHSEG_LINETO_REL:
       segEnd = segStart + gfxPoint(mData[i], mData[i+1]);
       aCtx->LineTo(segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS:
+    case PATHSEG_CURVETO_CUBIC_ABS:
       cp1 = gfxPoint(mData[i], mData[i+1]);
       cp2 = gfxPoint(mData[i+2], mData[i+3]);
       segEnd = gfxPoint(mData[i+4], mData[i+5]);
       aCtx->CurveTo(cp1, cp2, segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart || segEnd != cp1 || segEnd != cp2);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_REL:
+    case PATHSEG_CURVETO_CUBIC_REL:
       cp1 = segStart + gfxPoint(mData[i], mData[i+1]);
       cp2 = segStart + gfxPoint(mData[i+2], mData[i+3]);
       segEnd = segStart + gfxPoint(mData[i+4], mData[i+5]);
       aCtx->CurveTo(cp1, cp2, segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart || segEnd != cp1 || segEnd != cp2);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS:
+    case PATHSEG_CURVETO_QUADRATIC_ABS:
       cp1 = gfxPoint(mData[i], mData[i+1]);
       // Convert quadratic curve to cubic curve:
       tcp1 = segStart + (cp1 - segStart) * 2 / 3;
       segEnd = gfxPoint(mData[i+2], mData[i+3]); // set before setting tcp2!
       tcp2 = cp1 + (segEnd - cp1) / 3;
       aCtx->CurveTo(tcp1, tcp2, segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart || segEnd != cp1);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL:
+    case PATHSEG_CURVETO_QUADRATIC_REL:
       cp1 = segStart + gfxPoint(mData[i], mData[i+1]);
       // Convert quadratic curve to cubic curve:
       tcp1 = segStart + (cp1 - segStart) * 2 / 3;
       segEnd = segStart + gfxPoint(mData[i+2], mData[i+3]); // set before setting tcp2!
       tcp2 = cp1 + (segEnd - cp1) / 3;
       aCtx->CurveTo(tcp1, tcp2, segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart || segEnd != cp1);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_ARC_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_ARC_REL:
+    case PATHSEG_ARC_ABS:
+    case PATHSEG_ARC_REL:
     {
       gfxPoint radii(mData[i], mData[i+1]);
       segEnd = gfxPoint(mData[i+5], mData[i+6]);
-      if (segType == nsIDOMSVGPathSeg::PATHSEG_ARC_REL) {
+      if (segType == PATHSEG_ARC_REL) {
         segEnd += segStart;
       }
       if (segEnd != segStart) {
         if (radii.x == 0.0f || radii.y == 0.0f) {
           aCtx->LineTo(segEnd);
         } else {
           nsSVGArcConverter converter(segStart, segEnd, radii, mData[i+2],
                                       mData[i+3] != 0, mData[i+4] != 0);
@@ -386,88 +386,88 @@ SVGPathData::ConstructPath(gfxContext *a
         }
       }
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart);
       }
       break;
     }
 
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS:
+    case PATHSEG_LINETO_HORIZONTAL_ABS:
       segEnd = gfxPoint(mData[i], segStart.y);
       aCtx->LineTo(segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL:
+    case PATHSEG_LINETO_HORIZONTAL_REL:
       segEnd = segStart + gfxPoint(mData[i], 0.0f);
       aCtx->LineTo(segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS:
+    case PATHSEG_LINETO_VERTICAL_ABS:
       segEnd = gfxPoint(segStart.x, mData[i]);
       aCtx->LineTo(segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_REL:
+    case PATHSEG_LINETO_VERTICAL_REL:
       segEnd = segStart + gfxPoint(0.0f, mData[i]);
       aCtx->LineTo(segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
+    case PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
       cp1 = SVGPathSegUtils::IsCubicType(prevSegType) ? segStart * 2 - cp2 : segStart;
       cp2 = gfxPoint(mData[i],   mData[i+1]);
       segEnd = gfxPoint(mData[i+2], mData[i+3]);
       aCtx->CurveTo(cp1, cp2, segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart || segEnd != cp1 || segEnd != cp2);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
+    case PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
       cp1 = SVGPathSegUtils::IsCubicType(prevSegType) ? segStart * 2 - cp2 : segStart;
       cp2 = segStart + gfxPoint(mData[i], mData[i+1]);
       segEnd = segStart + gfxPoint(mData[i+2], mData[i+3]);
       aCtx->CurveTo(cp1, cp2, segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart || segEnd != cp1 || segEnd != cp2);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
+    case PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
       cp1 = SVGPathSegUtils::IsQuadraticType(prevSegType) ? segStart * 2 - cp1 : segStart;
       // Convert quadratic curve to cubic curve:
       tcp1 = segStart + (cp1 - segStart) * 2 / 3;
       segEnd = gfxPoint(mData[i], mData[i+1]); // set before setting tcp2!
       tcp2 = cp1 + (segEnd - cp1) / 3;
       aCtx->CurveTo(tcp1, tcp2, segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart || segEnd != cp1);
       }
       subpathContainsNonArc = true;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
+    case PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
       cp1 = SVGPathSegUtils::IsQuadraticType(prevSegType) ? segStart * 2 - cp1 : segStart;
       // Convert quadratic curve to cubic curve:
       tcp1 = segStart + (cp1 - segStart) * 2 / 3;
       segEnd = segStart + gfxPoint(mData[i], mData[i+1]); // changed before setting tcp2!
       tcp2 = cp1 + (segEnd - cp1) / 3;
       aCtx->CurveTo(tcp1, tcp2, segEnd);
       if (!subpathHasLength) {
         subpathHasLength = (segEnd != segStart || segEnd != cp1);
@@ -529,68 +529,68 @@ SVGPathData::GetMarkerPositioningData(ns
   // It should also assume that segments such as M and Z can appear in weird
   // places, and repeat multiple times consecutively.
 
   // info on current [sub]path (reset every M command):
   gfxPoint pathStart(0.0, 0.0);
   float pathStartAngle = 0.0f;
 
   // info on previous segment:
-  uint16_t prevSegType = nsIDOMSVGPathSeg::PATHSEG_UNKNOWN;
+  uint16_t prevSegType = PATHSEG_UNKNOWN;
   gfxPoint prevSegEnd(0.0, 0.0);
   float prevSegEndAngle = 0.0f;
   gfxPoint prevCP; // if prev seg was a bezier, this was its last control point
 
   uint32_t i = 0;
   while (i < mData.Length()) {
 
     // info on current segment:
     uint16_t segType =
       SVGPathSegUtils::DecodeType(mData[i++]); // advances i to args
     gfxPoint &segStart = prevSegEnd;
     gfxPoint segEnd;
     float segStartAngle, segEndAngle;
 
     switch (segType) // to find segStartAngle, segEnd and segEndAngle
     {
-    case nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH:
+    case PATHSEG_CLOSEPATH:
       segEnd = pathStart;
       segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_MOVETO_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_MOVETO_REL:
-      if (segType == nsIDOMSVGPathSeg::PATHSEG_MOVETO_ABS) {
+    case PATHSEG_MOVETO_ABS:
+    case PATHSEG_MOVETO_REL:
+      if (segType == PATHSEG_MOVETO_ABS) {
         segEnd = gfxPoint(mData[i], mData[i+1]);
       } else {
         segEnd = segStart + gfxPoint(mData[i], mData[i+1]);
       }
       pathStart = segEnd;
       // If authors are going to specify multiple consecutive moveto commands
       // with markers, me might as well make the angle do something useful:
       segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
       i += 2;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_REL:
-      if (segType == nsIDOMSVGPathSeg::PATHSEG_LINETO_ABS) {
+    case PATHSEG_LINETO_ABS:
+    case PATHSEG_LINETO_REL:
+      if (segType == PATHSEG_LINETO_ABS) {
         segEnd = gfxPoint(mData[i], mData[i+1]);
       } else {
         segEnd = segStart + gfxPoint(mData[i], mData[i+1]);
       }
       segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
       i += 2;
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_REL:
+    case PATHSEG_CURVETO_CUBIC_ABS:
+    case PATHSEG_CURVETO_CUBIC_REL:
     {
       gfxPoint cp1, cp2; // control points
-      if (segType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS) {
+      if (segType == PATHSEG_CURVETO_CUBIC_ABS) {
         cp1 = gfxPoint(mData[i],   mData[i+1]);
         cp2 = gfxPoint(mData[i+2], mData[i+3]);
         segEnd = gfxPoint(mData[i+4], mData[i+5]);
       } else {
         cp1 = segStart + gfxPoint(mData[i],   mData[i+1]);
         cp2 = segStart + gfxPoint(mData[i+2], mData[i+3]);
         segEnd = segStart + gfxPoint(mData[i+4], mData[i+5]);
       }
@@ -602,43 +602,43 @@ SVGPathData::GetMarkerPositioningData(ns
         cp2 = cp1;
       }
       segStartAngle = AngleOfVectorF(cp1 - segStart);
       segEndAngle = AngleOfVectorF(segEnd - cp2);
       i += 6;
       break;
     }
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL:
+    case PATHSEG_CURVETO_QUADRATIC_ABS:
+    case PATHSEG_CURVETO_QUADRATIC_REL:
     {
       gfxPoint cp1, cp2; // control points
-      if (segType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS) {
+      if (segType == PATHSEG_CURVETO_QUADRATIC_ABS) {
         cp1 = gfxPoint(mData[i],   mData[i+1]);
         segEnd = gfxPoint(mData[i+2], mData[i+3]);
       } else {
         cp1 = segStart + gfxPoint(mData[i],   mData[i+1]);
         segEnd = segStart + gfxPoint(mData[i+2], mData[i+3]);
       }
       prevCP = cp1;
       segStartAngle = AngleOfVectorF(cp1 - segStart);
       segEndAngle = AngleOfVectorF(segEnd - cp1);
       i += 4;
       break;
     }
 
-    case nsIDOMSVGPathSeg::PATHSEG_ARC_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_ARC_REL:
+    case PATHSEG_ARC_ABS:
+    case PATHSEG_ARC_REL:
     {
       double rx = mData[i];
       double ry = mData[i+1];
       double angle = mData[i+2];
       bool largeArcFlag = mData[i+3] != 0.0f;
       bool sweepFlag = mData[i+4] != 0.0f;
-      if (segType == nsIDOMSVGPathSeg::PATHSEG_ARC_ABS) {
+      if (segType == PATHSEG_ARC_ABS) {
         segEnd = gfxPoint(mData[i+5], mData[i+6]);
       } else {
         segEnd = segStart + gfxPoint(mData[i+5], mData[i+6]);
       }
 
       // See section F.6 of SVG 1.1 for details on what we're doing here:
       // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
 
@@ -723,43 +723,43 @@ SVGPathData::GetMarkerPositioningData(ns
       }
 
       segStartAngle = static_cast<float>(atan2(ty1, tx1));
       segEndAngle = static_cast<float>(atan2(ty2, tx2));
       i += 7;
       break;
     }
 
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL:
-      if (segType == nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS) {
+    case PATHSEG_LINETO_HORIZONTAL_ABS:
+    case PATHSEG_LINETO_HORIZONTAL_REL:
+      if (segType == PATHSEG_LINETO_HORIZONTAL_ABS) {
         segEnd = gfxPoint(mData[i++], segStart.y);
       } else {
         segEnd = segStart + gfxPoint(mData[i++], 0.0f);
       }
       segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_REL:
-      if (segType == nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS) {
+    case PATHSEG_LINETO_VERTICAL_ABS:
+    case PATHSEG_LINETO_VERTICAL_REL:
+      if (segType == PATHSEG_LINETO_VERTICAL_ABS) {
         segEnd = gfxPoint(segStart.x, mData[i++]);
       } else {
         segEnd = segStart + gfxPoint(0.0f, mData[i++]);
       }
       segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
       break;
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
+    case PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
+    case PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
     {
       gfxPoint cp1 = SVGPathSegUtils::IsCubicType(prevSegType) ?
                        segStart * 2 - prevCP : segStart;
       gfxPoint cp2;
-      if (segType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS) {
+      if (segType == PATHSEG_CURVETO_CUBIC_SMOOTH_ABS) {
         cp2 = gfxPoint(mData[i], mData[i+1]);
         segEnd = gfxPoint(mData[i+2], mData[i+3]);
       } else {
         cp2 = segStart + gfxPoint(mData[i], mData[i+1]);
         segEnd = segStart + gfxPoint(mData[i+2], mData[i+3]);
       }
       prevCP = cp2;
       if (cp1 == segStart) {
@@ -769,23 +769,23 @@ SVGPathData::GetMarkerPositioningData(ns
         cp2 = cp1;
       }
       segStartAngle = AngleOfVectorF(cp1 - segStart);
       segEndAngle = AngleOfVectorF(segEnd - cp2);
       i += 4;
       break;
     }
 
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
+    case PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
+    case PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
     {
       gfxPoint cp1 = SVGPathSegUtils::IsQuadraticType(prevSegType) ?
                        segStart * 2 - prevCP : segStart;
       gfxPoint cp2;
-      if (segType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS) {
+      if (segType == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS) {
         segEnd = gfxPoint(mData[i], mData[i+1]);
       } else {
         segEnd = segStart + gfxPoint(mData[i], mData[i+1]);
       }
       prevCP = cp1;
       segStartAngle = AngleOfVectorF(cp1 - segStart);
       segEndAngle = AngleOfVectorF(segEnd - cp1);
       i += 2;
@@ -802,43 +802,43 @@ SVGPathData::GetMarkerPositioningData(ns
     // Set the angle of the mark at the start of this segment:
     if (aMarks->Length()) {
       nsSVGMark &mark = aMarks->ElementAt(aMarks->Length() - 1);
       if (!IsMoveto(segType) && IsMoveto(prevSegType)) {
         // start of new subpath
         pathStartAngle = mark.angle = segStartAngle;
       } else if (IsMoveto(segType) && !IsMoveto(prevSegType)) {
         // end of a subpath
-        if (prevSegType != nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH)
+        if (prevSegType != PATHSEG_CLOSEPATH)
           mark.angle = prevSegEndAngle;
       } else {
-        if (!(segType == nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH &&
-              prevSegType == nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH))
+        if (!(segType == PATHSEG_CLOSEPATH &&
+              prevSegType == PATHSEG_CLOSEPATH))
           mark.angle = SVGContentUtils::AngleBisect(prevSegEndAngle, segStartAngle);
       }
     }
 
     // Add the mark at the end of this segment, and set its position:
     if (!aMarks->AppendElement(nsSVGMark(static_cast<float>(segEnd.x),
                                          static_cast<float>(segEnd.y), 0))) {
       aMarks->Clear(); // OOM, so try to free some
       return;
     }
 
-    if (segType == nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH &&
-        prevSegType != nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH) {
+    if (segType == PATHSEG_CLOSEPATH &&
+        prevSegType != PATHSEG_CLOSEPATH) {
       aMarks->ElementAt(aMarks->Length() - 1).angle =
         //aMarks->ElementAt(pathStartIndex).angle =
         SVGContentUtils::AngleBisect(segEndAngle, pathStartAngle);
     }
 
     prevSegType = segType;
     prevSegEnd = segEnd;
     prevSegEndAngle = segEndAngle;
   }
 
   NS_ABORT_IF_FALSE(i == mData.Length(), "Very, very bad - mData corrupt");
 
   if (aMarks->Length() &&
-      prevSegType != nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH)
+      prevSegType != PATHSEG_CLOSEPATH)
     aMarks->ElementAt(aMarks->Length() - 1).angle = prevSegEndAngle;
 }
 
--- a/content/svg/content/src/SVGPathSegListSMILType.cpp
+++ b/content/svg/content/src/SVGPathSegListSMILType.cpp
@@ -323,57 +323,57 @@ ConvertPathSegmentData(SVGPathDataAndOwn
   NS_ABORT_IF_FALSE
     (segmentLengthIncludingType ==
        1 + SVGPathSegUtils::ArgCountForType(endType),
      "Compatible path segment types for interpolation had different lengths!");
 
   aResult[0] = aEnd[0];
 
   switch (endType) {
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL:
+    case PATHSEG_LINETO_HORIZONTAL_ABS:
+    case PATHSEG_LINETO_HORIZONTAL_REL:
       aResult[1] = aStart[1] +
         (adjustmentType == eRelativeToAbsolute ? 1 : -1) * aState.pos.x;
       break;
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_REL:
+    case PATHSEG_LINETO_VERTICAL_ABS:
+    case PATHSEG_LINETO_VERTICAL_REL:
       aResult[1] = aStart[1] +
         (adjustmentType == eRelativeToAbsolute  ? 1 : -1) * aState.pos.y;
       break;
-    case nsIDOMSVGPathSeg::PATHSEG_ARC_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_ARC_REL:
+    case PATHSEG_ARC_ABS:
+    case PATHSEG_ARC_REL:
       aResult[1] = aStart[1];
       aResult[2] = aStart[2];
       aResult[3] = aStart[3];
       aResult[4] = aStart[4];
       aResult[5] = aStart[5];
       aResult[6] = aStart[6];
       aResult[7] = aStart[7];
       AdjustSegmentForRelativeness(adjustmentType, aResult + 6, aState);
       break;
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_REL:
+    case PATHSEG_CURVETO_CUBIC_ABS:
+    case PATHSEG_CURVETO_CUBIC_REL:
       aResult[5] = aStart[5];
       aResult[6] = aStart[6];
       AdjustSegmentForRelativeness(adjustmentType, aResult + 5, aState);
       // fall through
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL:
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
+    case PATHSEG_CURVETO_QUADRATIC_ABS:
+    case PATHSEG_CURVETO_QUADRATIC_REL:
+    case PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
+    case PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
       aResult[3] = aStart[3];
       aResult[4] = aStart[4];
       AdjustSegmentForRelativeness(adjustmentType, aResult + 3, aState);
       // fall through
-    case nsIDOMSVGPathSeg::PATHSEG_MOVETO_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_MOVETO_REL:
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_LINETO_REL:
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
-    case nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
+    case PATHSEG_MOVETO_ABS:
+    case PATHSEG_MOVETO_REL:
+    case PATHSEG_LINETO_ABS:
+    case PATHSEG_LINETO_REL:
+    case PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
+    case PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
       aResult[1] = aStart[1];
       aResult[2] = aStart[2];
       AdjustSegmentForRelativeness(adjustmentType, aResult + 1, aState);
       break;
   }
 
   SVGPathSegUtils::TraversePathSegment(pResultSegmentBegin, aState);
   aStart += segmentLengthIncludingType;
--- a/content/svg/content/src/SVGPathSegUtils.cpp
+++ b/content/svg/content/src/SVGPathSegUtils.cpp
@@ -14,17 +14,17 @@ static const float PATH_SEG_LENGTH_TOLER
 static const uint32_t MAX_RECURSION = 10;
 
 
 /* static */ void
 SVGPathSegUtils::GetValueAsString(const float* aSeg, nsAString& aValue)
 {
   // Adding new seg type? Is the formatting below acceptable for the new types?
   PR_STATIC_ASSERT(NS_SVG_PATH_SEG_LAST_VALID_TYPE ==
-                     nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
+                     PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
   PR_STATIC_ASSERT(NS_SVG_PATH_SEG_MAX_ARGS == 7);
 
   uint32_t type = DecodeType(aSeg[0]);
   PRUnichar typeAsChar = GetPathSegTypeAsLetter(type);
 
   // Special case arcs:
   if (IsArcType(type)) {
     bool largeArcFlag = aSeg[4] != 0.0f;
--- a/content/svg/content/src/SVGPathSegUtils.h
+++ b/content/svg/content/src/SVGPathSegUtils.h
@@ -3,26 +3,47 @@
  * 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_SVGPATHSEGUTILS_H__
 #define MOZILLA_SVGPATHSEGUTILS_H__
 
 #include "gfxPoint.h"
 #include "nsDebug.h"
-#include "nsIDOMSVGPathSeg.h"
 #include "nsMemory.h"
 
+namespace mozilla {
+
+// Path Segment Types
+static const unsigned short PATHSEG_UNKNOWN                      = 0;
+static const unsigned short PATHSEG_CLOSEPATH                    = 1;
+static const unsigned short PATHSEG_MOVETO_ABS                   = 2;
+static const unsigned short PATHSEG_MOVETO_REL                   = 3;
+static const unsigned short PATHSEG_LINETO_ABS                   = 4;
+static const unsigned short PATHSEG_LINETO_REL                   = 5;
+static const unsigned short PATHSEG_CURVETO_CUBIC_ABS            = 6;
+static const unsigned short PATHSEG_CURVETO_CUBIC_REL            = 7;
+static const unsigned short PATHSEG_CURVETO_QUADRATIC_ABS        = 8;
+static const unsigned short PATHSEG_CURVETO_QUADRATIC_REL        = 9;
+static const unsigned short PATHSEG_ARC_ABS                      = 10;
+static const unsigned short PATHSEG_ARC_REL                      = 11;
+static const unsigned short PATHSEG_LINETO_HORIZONTAL_ABS        = 12;
+static const unsigned short PATHSEG_LINETO_HORIZONTAL_REL        = 13;
+static const unsigned short PATHSEG_LINETO_VERTICAL_ABS          = 14;
+static const unsigned short PATHSEG_LINETO_VERTICAL_REL          = 15;
+static const unsigned short PATHSEG_CURVETO_CUBIC_SMOOTH_ABS     = 16;
+static const unsigned short PATHSEG_CURVETO_CUBIC_SMOOTH_REL     = 17;
+static const unsigned short PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;
+static const unsigned short PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;
+
 #define NS_SVG_PATH_SEG_MAX_ARGS         7
-#define NS_SVG_PATH_SEG_FIRST_VALID_TYPE nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH
-#define NS_SVG_PATH_SEG_LAST_VALID_TYPE  nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
+#define NS_SVG_PATH_SEG_FIRST_VALID_TYPE mozilla::PATHSEG_CLOSEPATH
+#define NS_SVG_PATH_SEG_LAST_VALID_TYPE  mozilla::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
 #define NS_SVG_PATH_SEG_TYPE_COUNT       (NS_SVG_PATH_SEG_LAST_VALID_TYPE + 1)
 
-namespace mozilla {
-
 /**
  * Code that works with path segments can use an instance of this class to
  * store/provide information about the start of the current subpath and the
  * last path segment (if any).
  */
 struct SVGPathTraversalState
 {
   enum TraversalMode {
@@ -172,67 +193,67 @@ public:
   }
 
   static bool IsValidType(uint32_t aType) {
     return aType >= NS_SVG_PATH_SEG_FIRST_VALID_TYPE &&
            aType <= NS_SVG_PATH_SEG_LAST_VALID_TYPE;
   }
 
   static bool IsCubicType(uint32_t aType) {
-    return aType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_REL ||
-           aType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS ||
-           aType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL ||
-           aType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
+    return aType == PATHSEG_CURVETO_CUBIC_REL ||
+           aType == PATHSEG_CURVETO_CUBIC_ABS ||
+           aType == PATHSEG_CURVETO_CUBIC_SMOOTH_REL ||
+           aType == PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
   }
 
   static bool IsQuadraticType(uint32_t aType) {
-    return aType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL ||
-           aType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS ||
-           aType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL ||
-           aType == nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
+    return aType == PATHSEG_CURVETO_QUADRATIC_REL ||
+           aType == PATHSEG_CURVETO_QUADRATIC_ABS ||
+           aType == PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL ||
+           aType == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
   }
 
   static bool IsArcType(uint32_t aType) {
-    return aType == nsIDOMSVGPathSeg::PATHSEG_ARC_ABS || 
-           aType == nsIDOMSVGPathSeg::PATHSEG_ARC_REL;
+    return aType == PATHSEG_ARC_ABS ||
+           aType == PATHSEG_ARC_REL;
   }
 
   static bool IsRelativeOrAbsoluteType(uint32_t aType) {
     NS_ABORT_IF_FALSE(IsValidType(aType), "Seg type not recognized");
 
     // When adding a new path segment type, ensure that the returned condition
     // below is still correct.
     PR_STATIC_ASSERT(NS_SVG_PATH_SEG_LAST_VALID_TYPE ==
-                       nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
+                       PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
 
-    return aType >= nsIDOMSVGPathSeg::PATHSEG_MOVETO_ABS;
+    return aType >= PATHSEG_MOVETO_ABS;
   }
 
   static bool IsRelativeType(uint32_t aType) {
     NS_ABORT_IF_FALSE
       (IsRelativeOrAbsoluteType(aType),
        "IsRelativeType called with segment type that does not come in relative and absolute forms");
 
     // When adding a new path segment type, ensure that the returned condition
     // below is still correct.
     PR_STATIC_ASSERT(NS_SVG_PATH_SEG_LAST_VALID_TYPE ==
-                       nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
+                       PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
 
     return aType & 1;
   }
 
   static uint32_t RelativeVersionOfType(uint32_t aType) {
     NS_ABORT_IF_FALSE
       (IsRelativeOrAbsoluteType(aType),
        "RelativeVersionOfType called with segment type that does not come in relative and absolute forms");
 
     // When adding a new path segment type, ensure that the returned condition
     // below is still correct.
     PR_STATIC_ASSERT(NS_SVG_PATH_SEG_LAST_VALID_TYPE ==
-                       nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
+                       PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
 
     return aType | 1;
   }
 
   static uint32_t SameTypeModuloRelativeness(uint32_t aType1, uint32_t aType2) {
     if (!IsRelativeOrAbsoluteType(aType1)) {
       return aType1 == aType2;
     }
--- a/content/svg/content/src/nsSVGPathDataParser.cpp
+++ b/content/svg/content/src/nsSVGPathDataParser.cpp
@@ -2,17 +2,17 @@
 /* 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 "nsSVGPathDataParser.h"
 #include "nsSVGDataParser.h"
 #include "nsSVGPathElement.h"
 #include "prdtoa.h"
-#include "nsIDOMSVGPathSeg.h"
+#include "DOMSVGPathSeg.h"
 #include <stdlib.h>
 #include <math.h>
 
 using namespace mozilla;
 
 nsresult nsSVGPathDataParser::Match()
 {
   return MatchSvgPath();
@@ -247,20 +247,16 @@ nsresult nsSVGPathDataParser::MatchMovet
     ENSURE_MATCHED(MatchWsp());
   }
 
   ENSURE_MATCHED(MatchMovetoArgSeq(absCoords));
   
   return NS_OK;
 }
 
-//  typedef nsresult MovetoSegCreationFunc(nsIDOMSVGPathSeg** res, float x, float y);
-//  MovetoSegCreationFunc *creationFunc;
-
-
 nsresult nsSVGPathDataParser::MatchMovetoArgSeq(bool absCoords)
 {
   
   float x, y;
   ENSURE_MATCHED(MatchCoordPair(&x, &y));
 
   nsresult rv = StoreMoveTo(absCoords, x, y);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -959,134 +955,87 @@ nsSVGPathDataParserToInternal::Parse(con
 {
   mPathSegList->Clear();
   return nsSVGPathDataParser::Parse(aValue);
 }
 
 nsresult
 nsSVGPathDataParserToInternal::StoreMoveTo(bool absCoords, float x, float y)
 {
-  // Because our IDL compiler doesn't know any better, each seg type constant
-  // in nsIDOMSVGPathSeg is in a separate enum. This results in "warning:
-  // enumeral mismatch in conditional expression" under GCC if two bare
-  // nsIDOMSVGPathSeg constants are used as operands of the ?: operator below.
-  // In newer versions of GCC we would be able to turn off this warning using:
-  //
-  //#pragma GCC diagnostic push
-  //#pragma GCC diagnostic ignored "-Wenum-compare"
-  //...
-  //#pragma GCC diagnostic pop
-  //
-  // Unfortunately we need to support older versions of GCC. Instead, to
-  // eliminate this warning noise being sent to the console, we wrap the
-  // operands with uint32_t(...).
-
-  uint32_t type = absCoords ?
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_MOVETO_ABS) :
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_MOVETO_REL);
-
-  return mPathSegList->AppendSeg(type, x, y);
+  return mPathSegList->AppendSeg(absCoords ? PATHSEG_MOVETO_ABS : PATHSEG_MOVETO_REL, x, y);
 }
 
 nsresult
 nsSVGPathDataParserToInternal::StoreClosePath()
 {
-  return mPathSegList->AppendSeg(nsIDOMSVGPathSeg::PATHSEG_CLOSEPATH);
+  return mPathSegList->AppendSeg(PATHSEG_CLOSEPATH);
 }
 
 nsresult
 nsSVGPathDataParserToInternal::StoreLineTo(bool absCoords, float x, float y)
 {
-  uint32_t type = absCoords ?
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_LINETO_ABS) :
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_LINETO_REL);
-
-  return mPathSegList->AppendSeg(type, x, y);
+  return mPathSegList->AppendSeg(absCoords ? PATHSEG_LINETO_ABS : PATHSEG_LINETO_REL, x, y);
 }
 
 nsresult
 nsSVGPathDataParserToInternal::StoreHLineTo(bool absCoords, float x)
 {
-  uint32_t type = absCoords ?
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS) :
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL);
-
-  return mPathSegList->AppendSeg(type, x);
+  return mPathSegList->AppendSeg(absCoords ? PATHSEG_LINETO_HORIZONTAL_ABS : PATHSEG_LINETO_HORIZONTAL_REL, x);
 }
 
 nsresult
 nsSVGPathDataParserToInternal::StoreVLineTo(bool absCoords, float y)
 {
-  uint32_t type = absCoords ?
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS) :
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_LINETO_VERTICAL_REL);
-
-  return mPathSegList->AppendSeg(type, y);
+  return mPathSegList->AppendSeg(absCoords ? PATHSEG_LINETO_VERTICAL_ABS : PATHSEG_LINETO_VERTICAL_REL, y);
 }
 
 nsresult
 nsSVGPathDataParserToInternal::StoreCurveTo(bool absCoords,
                                             float x, float y,
                                             float x1, float y1,
                                             float x2, float y2)
 {
-  uint32_t type = absCoords ?
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS) :
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_REL);
-
-  return mPathSegList->AppendSeg(type, x1, y1, x2, y2, x, y);
+  return mPathSegList->AppendSeg(absCoords ? PATHSEG_CURVETO_CUBIC_ABS : PATHSEG_CURVETO_CUBIC_REL,
+                                 x1, y1, x2, y2, x, y);
 }
 
 nsresult
 nsSVGPathDataParserToInternal::StoreSmoothCurveTo(bool absCoords,
                                                   float x, float y,
                                                   float x2, float y2)
 {
-  uint32_t type = absCoords ?
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS) :
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL);
-
-  return mPathSegList->AppendSeg(type, x2, y2, x, y);
+  return mPathSegList->AppendSeg(absCoords ? PATHSEG_CURVETO_CUBIC_SMOOTH_ABS : PATHSEG_CURVETO_CUBIC_SMOOTH_REL,
+                                 x2, y2, x, y);
 }
 
 nsresult
 nsSVGPathDataParserToInternal::StoreQuadCurveTo(bool absCoords,
                                                 float x, float y,
                                                 float x1, float y1)
 {
-  uint32_t type = absCoords ?
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS) :
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL);
-
-  return mPathSegList->AppendSeg(type, x1, y1, x, y);
+  return mPathSegList->AppendSeg(absCoords ? PATHSEG_CURVETO_QUADRATIC_ABS : PATHSEG_CURVETO_QUADRATIC_REL,
+                                 x1, y1, x, y);
 }
 
 nsresult
 nsSVGPathDataParserToInternal::StoreSmoothQuadCurveTo(bool absCoords,
                                                       float x, float y)
 {
-  uint32_t type = absCoords ?
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS) :
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
-
-  return mPathSegList->AppendSeg(type, x, y);
+  return mPathSegList->AppendSeg(absCoords ? PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS : PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, x, y);
 }
 
 nsresult
 nsSVGPathDataParserToInternal::StoreEllipticalArc(bool absCoords,
                                                   float x, float y,
                                                   float r1, float r2,
                                                   float angle,
                                                   bool largeArcFlag,
                                                   bool sweepFlag)
 {
-  uint32_t type = absCoords ?
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_ARC_ABS) :
-    uint32_t(nsIDOMSVGPathSeg::PATHSEG_ARC_REL);
-
   // We can only pass floats after 'type', and per the SVG spec for arc,
   // non-zero args are treated at 'true'.
-  return mPathSegList->AppendSeg(type, r1, r2, angle,
+  return mPathSegList->AppendSeg(absCoords ? PATHSEG_ARC_ABS : PATHSEG_ARC_REL,
+                                 r1, r2, angle,
                                  largeArcFlag ? 1.0f : 0.0f,
                                  sweepFlag ? 1.0f : 0.0f,
                                  x, y);
 }
 
--- a/content/svg/content/src/nsSVGPathDataParser.h
+++ b/content/svg/content/src/nsSVGPathDataParser.h
@@ -10,17 +10,17 @@
 #include "nsSVGDataParser.h"
 
 namespace mozilla {
 class SVGPathData;
 }
 
 ////////////////////////////////////////////////////////////////////////
 // nsSVGPathDataParser: a simple recursive descent parser that builds
-// nsIDOMSVGPathSegs from path data strings. The grammar for path data
+// DOMSVGPathSegs from path data strings. The grammar for path data
 // can be found in SVG CR 20001102, chapter 8.
 
 class nsSVGPathDataParser : public nsSVGDataParser
 {
 protected:
   // Path data storage
   virtual nsresult StoreMoveTo(bool absCoords, float x, float y) = 0;
   virtual nsresult StoreClosePath() = 0;
--- a/content/svg/content/src/nsSVGPathElement.cpp
+++ b/content/svg/content/src/nsSVGPathElement.cpp
@@ -1,17 +1,16 @@
 /* -*- 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 "nsIDOMSVGPathSeg.h"
 #include "DOMSVGPathSeg.h"
 #include "DOMSVGPathSegList.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsSVGPathElement.h"
 #include "DOMSVGPoint.h"
 #include "gfxContext.h"
 
@@ -105,203 +104,203 @@ nsSVGPathElement::GetPointAtLength(float
 NS_IMETHODIMP
 nsSVGPathElement::GetPathSegAtLength(float distance, uint32_t *_retval)
 {
   NS_ENSURE_FINITE(distance, NS_ERROR_ILLEGAL_VALUE);
   *_retval = mD.GetAnimValue().GetPathSegAtLength(distance);
   return NS_OK;
 }
 
-/* nsIDOMSVGPathSegClosePath createSVGPathSegClosePath (); */
+/* nsISupports createSVGPathSegClosePath (); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegClosePath(nsIDOMSVGPathSegClosePath **_retval)
+nsSVGPathElement::CreateSVGPathSegClosePath(nsISupports **_retval)
 {
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegClosePath();
+  nsISupports* seg = NS_NewSVGPathSegClosePath();
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegMovetoAbs createSVGPathSegMovetoAbs (in float x, in float y); */
+/* nsISupports createSVGPathSegMovetoAbs (in float x, in float y); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegMovetoAbs(float x, float y, nsIDOMSVGPathSegMovetoAbs **_retval)
+nsSVGPathElement::CreateSVGPathSegMovetoAbs(float x, float y, nsISupports **_retval)
 {
   NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegMovetoAbs(x, y);
+  nsISupports* seg = NS_NewSVGPathSegMovetoAbs(x, y);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegMovetoRel createSVGPathSegMovetoRel (in float x, in float y); */
+/* nsISupports createSVGPathSegMovetoRel (in float x, in float y); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegMovetoRel(float x, float y, nsIDOMSVGPathSegMovetoRel **_retval)
+nsSVGPathElement::CreateSVGPathSegMovetoRel(float x, float y, nsISupports **_retval)
 {
   NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegMovetoRel(x, y);
+  nsISupports* seg = NS_NewSVGPathSegMovetoRel(x, y);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegLinetoAbs createSVGPathSegLinetoAbs (in float x, in float y); */
+/* nsISupports createSVGPathSegLinetoAbs (in float x, in float y); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegLinetoAbs(float x, float y, nsIDOMSVGPathSegLinetoAbs **_retval)
+nsSVGPathElement::CreateSVGPathSegLinetoAbs(float x, float y, nsISupports **_retval)
 {
   NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegLinetoAbs(x, y);
+  nsISupports* seg = NS_NewSVGPathSegLinetoAbs(x, y);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegLinetoRel createSVGPathSegLinetoRel (in float x, in float y); */
+/* nsISupports createSVGPathSegLinetoRel (in float x, in float y); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegLinetoRel(float x, float y, nsIDOMSVGPathSegLinetoRel **_retval)
+nsSVGPathElement::CreateSVGPathSegLinetoRel(float x, float y, nsISupports **_retval)
 {
   NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegLinetoRel(x, y);
+  nsISupports* seg = NS_NewSVGPathSegLinetoRel(x, y);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs (in float x, in float y, in float x1, in float y1, in float x2, in float y2); */
+/* nsISupports createSVGPathSegCurvetoCubicAbs (in float x, in float y, in float x1, in float y1, in float x2, in float y2); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2, nsIDOMSVGPathSegCurvetoCubicAbs **_retval)
+nsSVGPathElement::CreateSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2, nsISupports **_retval)
 {
   NS_ENSURE_FINITE6(x, y, x1, y1, x2, y2, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel (in float x, in float y, in float x1, in float y1, in float x2, in float y2); */
+/* nsISupports createSVGPathSegCurvetoCubicRel (in float x, in float y, in float x1, in float y1, in float x2, in float y2); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2, nsIDOMSVGPathSegCurvetoCubicRel **_retval)
+nsSVGPathElement::CreateSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2, nsISupports **_retval)
 {
   NS_ENSURE_FINITE6(x, y, x1, y1, x2, y2, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs (in float x, in float y, in float x1, in float y1); */
+/* nsISupports createSVGPathSegCurvetoQuadraticAbs (in float x, in float y, in float x1, in float y1); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1, nsIDOMSVGPathSegCurvetoQuadraticAbs **_retval)
+nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1, nsISupports **_retval)
 {
   NS_ENSURE_FINITE4(x, y, x1, y1, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel (in float x, in float y, in float x1, in float y1); */
+/* nsISupports createSVGPathSegCurvetoQuadraticRel (in float x, in float y, in float x1, in float y1); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1, nsIDOMSVGPathSegCurvetoQuadraticRel **_retval)
+nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1, nsISupports **_retval)
 {
   NS_ENSURE_FINITE4(x, y, x1, y1, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegArcAbs createSVGPathSegArcAbs (in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag); */
+/* nsISupports createSVGPathSegArcAbs (in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, nsIDOMSVGPathSegArcAbs **_retval)
+nsSVGPathElement::CreateSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, nsISupports **_retval)
 {
   NS_ENSURE_FINITE5(x, y, r1, r2, angle, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegArcAbs(x, y, r1, r2, angle,
+  nsISupports* seg = NS_NewSVGPathSegArcAbs(x, y, r1, r2, angle,
                                                  largeArcFlag, sweepFlag);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegArcRel createSVGPathSegArcRel (in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag); */
+/* nsISupports createSVGPathSegArcRel (in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, nsIDOMSVGPathSegArcRel **_retval)
+nsSVGPathElement::CreateSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, nsISupports **_retval)
 {
   NS_ENSURE_FINITE5(x, y, r1, r2, angle, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegArcRel(x, y, r1, r2, angle,
+  nsISupports* seg = NS_NewSVGPathSegArcRel(x, y, r1, r2, angle,
                                                  largeArcFlag, sweepFlag);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs (in float x); */
+/* nsISupports createSVGPathSegLinetoHorizontalAbs (in float x); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegLinetoHorizontalAbs(float x, nsIDOMSVGPathSegLinetoHorizontalAbs **_retval)
+nsSVGPathElement::CreateSVGPathSegLinetoHorizontalAbs(float x, nsISupports **_retval)
 {
   NS_ENSURE_FINITE(x, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegLinetoHorizontalAbs(x);
+  nsISupports* seg = NS_NewSVGPathSegLinetoHorizontalAbs(x);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel (in float x); */
+/* nsISupports createSVGPathSegLinetoHorizontalRel (in float x); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegLinetoHorizontalRel(float x, nsIDOMSVGPathSegLinetoHorizontalRel **_retval)
+nsSVGPathElement::CreateSVGPathSegLinetoHorizontalRel(float x, nsISupports **_retval)
 {
   NS_ENSURE_FINITE(x, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegLinetoHorizontalRel(x);
+  nsISupports* seg = NS_NewSVGPathSegLinetoHorizontalRel(x);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs (in float y); */
+/* nsISupports createSVGPathSegLinetoVerticalAbs (in float y); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegLinetoVerticalAbs(float y, nsIDOMSVGPathSegLinetoVerticalAbs **_retval)
+nsSVGPathElement::CreateSVGPathSegLinetoVerticalAbs(float y, nsISupports **_retval)
 {
   NS_ENSURE_FINITE(y, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegLinetoVerticalAbs(y);
+  nsISupports* seg = NS_NewSVGPathSegLinetoVerticalAbs(y);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel (in float y); */
+/* nsISupports createSVGPathSegLinetoVerticalRel (in float y); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegLinetoVerticalRel(float y, nsIDOMSVGPathSegLinetoVerticalRel **_retval)
+nsSVGPathElement::CreateSVGPathSegLinetoVerticalRel(float y, nsISupports **_retval)
 {
   NS_ENSURE_FINITE(y, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegLinetoVerticalRel(y);
+  nsISupports* seg = NS_NewSVGPathSegLinetoVerticalRel(y);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs (in float x, in float y, in float x2, in float y2); */
+/* nsISupports createSVGPathSegCurvetoCubicSmoothAbs (in float x, in float y, in float x2, in float y2); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2, nsIDOMSVGPathSegCurvetoCubicSmoothAbs **_retval)
+nsSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2, nsISupports **_retval)
 {
   NS_ENSURE_FINITE4(x, y, x2, y2, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel (in float x, in float y, in float x2, in float y2); */
+/* nsISupports createSVGPathSegCurvetoCubicSmoothRel (in float x, in float y, in float x2, in float y2); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2, nsIDOMSVGPathSegCurvetoCubicSmoothRel **_retval)
+nsSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2, nsISupports **_retval)
 {
   NS_ENSURE_FINITE4(x, y, x2, y2, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs (in float x, in float y); */
+/* nsISupports createSVGPathSegCurvetoQuadraticSmoothAbs (in float x, in float y); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs **_retval)
+nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, nsISupports **_retval)
 {
   NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
-/* nsIDOMSVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel (in float x, in float y); */
+/* nsISupports createSVGPathSegCurvetoQuadraticSmoothRel (in float x, in float y); */
 NS_IMETHODIMP
-nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, nsIDOMSVGPathSegCurvetoQuadraticSmoothRel **_retval)
+nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, nsISupports **_retval)
 {
   NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsIDOMSVGPathSeg* seg = NS_NewSVGPathSegCurvetoQuadraticSmoothRel(x, y);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticSmoothRel(x, y);
   NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
   return CallQueryInterface(seg, _retval);
 }
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
 /* virtual */ bool
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -354,17 +354,16 @@
 #include "nsIDOMSVGLocatable.h"
 #include "nsIDOMSVGMarkerElement.h"
 #include "nsIDOMSVGMaskElement.h"
 #include "nsIDOMSVGMatrix.h"
 #include "nsIDOMSVGMetadataElement.h"
 #include "nsIDOMSVGNumber.h"
 #include "nsIDOMSVGNumberList.h"
 #include "nsIDOMSVGPathElement.h"
-#include "nsIDOMSVGPathSeg.h"
 #include "nsIDOMSVGPathSegList.h"
 #include "nsIDOMSVGPatternElement.h"
 #include "nsIDOMSVGPoint.h"
 #include "nsIDOMSVGPolygonElement.h"
 #include "nsIDOMSVGPolylineElement.h"
 #include "nsIDOMSVGRect.h"
 #include "nsIDOMSVGRectElement.h"
 #include "nsIDOMSVGScriptElement.h"
@@ -1253,56 +1252,18 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA(SVGLengthList, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGMatrix, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGNumber, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGNumberList, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegArcAbs, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegArcRel, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegClosePath, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoCubicAbs, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoCubicRel, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoCubicSmoothAbs, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoCubicSmoothRel, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoQuadraticAbs, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoQuadraticRel, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoQuadraticSmoothAbs, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoQuadraticSmoothRel, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoAbs, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoHorizontalAbs, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoHorizontalRel, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoRel, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoVerticalAbs, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoVerticalRel, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGPathSegList, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegMovetoAbs, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGPathSegMovetoRel, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGPoint, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGRect, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGStringList, nsSVGStringListSH,
                            ARRAY_SCRIPTABLE_FLAGS)    
   NS_DEFINE_CLASSINFO_DATA(SVGTransform, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -3602,115 +3563,20 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_BEGIN(SVGNumber, nsIDOMSVGNumber)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGNumber)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGNumberList, nsIDOMSVGNumberList)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGNumberList)
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegArcAbs, nsIDOMSVGPathSegArcAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegArcAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegArcRel, nsIDOMSVGPathSegArcRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegArcRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegClosePath, nsIDOMSVGPathSegClosePath)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegClosePath)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoCubicAbs, nsIDOMSVGPathSegCurvetoCubicAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoCubicAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoCubicRel, nsIDOMSVGPathSegCurvetoCubicRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoCubicRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoCubicSmoothAbs, nsIDOMSVGPathSegCurvetoCubicSmoothAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoCubicSmoothAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoCubicSmoothRel, nsIDOMSVGPathSegCurvetoCubicSmoothRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoCubicSmoothRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoQuadraticAbs, nsIDOMSVGPathSegCurvetoQuadraticAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoQuadraticAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoQuadraticRel, nsIDOMSVGPathSegCurvetoQuadraticRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoQuadraticRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoQuadraticSmoothAbs, nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoQuadraticSmoothRel, nsIDOMSVGPathSegCurvetoQuadraticSmoothRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoQuadraticSmoothRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoAbs, nsIDOMSVGPathSegLinetoAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoHorizontalAbs, nsIDOMSVGPathSegLinetoHorizontalAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoHorizontalAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoHorizontalRel, nsIDOMSVGPathSegLinetoHorizontalRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoHorizontalRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoRel, nsIDOMSVGPathSegLinetoRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoVerticalAbs, nsIDOMSVGPathSegLinetoVerticalAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoVerticalAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoVerticalRel, nsIDOMSVGPathSegLinetoVerticalRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoVerticalRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(SVGPathSegList, nsIDOMSVGPathSegList)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegList)
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegMovetoAbs, nsIDOMSVGPathSegMovetoAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegMovetoAbs)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGPathSegMovetoRel, nsIDOMSVGPathSegMovetoRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegMovetoRel)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(SVGPoint, nsIDOMSVGPoint)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPoint)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGRect, nsIDOMSVGRect)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGRect)
   DOM_CLASSINFO_MAP_END
 
--- a/dom/base/nsDOMClassInfo.h
+++ b/dom/base/nsDOMClassInfo.h
@@ -32,17 +32,16 @@ class DOMSVGTransformList;
 class nsContentList;
 class nsGlobalWindow;
 class nsICanvasRenderingContextInternal;
 class nsIDOMHTMLOptionsCollection;
 class nsIDOMSVGLength;
 class nsIDOMSVGLengthList;
 class nsIDOMSVGNumber;
 class nsIDOMSVGNumberList;
-class nsIDOMSVGPathSeg;
 class nsIDOMSVGPathSegList;
 class nsIDOMSVGPoint;
 class nsIDOMSVGStringList;
 class nsIDOMSVGTests;
 class nsIDOMSVGTransform;
 class nsIDOMSVGTransformList;
 class nsIDOMWindow;
 class nsIForm;
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -267,36 +267,17 @@ DOMCI_CLASS(SVGAnimatedRect)
 DOMCI_CLASS(SVGAnimatedString)
 DOMCI_CLASS(SVGAnimatedTransformList)
 DOMCI_CLASS(SVGEvent)
 DOMCI_CLASS(SVGLength)
 DOMCI_CLASS(SVGLengthList)
 DOMCI_CLASS(SVGMatrix)
 DOMCI_CLASS(SVGNumber)
 DOMCI_CLASS(SVGNumberList)
-DOMCI_CLASS(SVGPathSegArcAbs)
-DOMCI_CLASS(SVGPathSegArcRel)
-DOMCI_CLASS(SVGPathSegClosePath)
-DOMCI_CLASS(SVGPathSegCurvetoCubicAbs)
-DOMCI_CLASS(SVGPathSegCurvetoCubicRel)
-DOMCI_CLASS(SVGPathSegCurvetoCubicSmoothAbs)
-DOMCI_CLASS(SVGPathSegCurvetoCubicSmoothRel)
-DOMCI_CLASS(SVGPathSegCurvetoQuadraticAbs)
-DOMCI_CLASS(SVGPathSegCurvetoQuadraticRel)
-DOMCI_CLASS(SVGPathSegCurvetoQuadraticSmoothAbs)
-DOMCI_CLASS(SVGPathSegCurvetoQuadraticSmoothRel)
-DOMCI_CLASS(SVGPathSegLinetoAbs)
-DOMCI_CLASS(SVGPathSegLinetoHorizontalAbs)
-DOMCI_CLASS(SVGPathSegLinetoHorizontalRel)
-DOMCI_CLASS(SVGPathSegLinetoRel)
-DOMCI_CLASS(SVGPathSegLinetoVerticalAbs)
-DOMCI_CLASS(SVGPathSegLinetoVerticalRel)
 DOMCI_CLASS(SVGPathSegList)
-DOMCI_CLASS(SVGPathSegMovetoAbs)
-DOMCI_CLASS(SVGPathSegMovetoRel)
 DOMCI_CLASS(SVGPoint)
 DOMCI_CLASS(SVGRect)
 DOMCI_CLASS(SVGStringList)
 DOMCI_CLASS(SVGTransform)
 DOMCI_CLASS(SVGTransformList)
 DOMCI_CLASS(SVGZoomEvent)
 
 // Canvas
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -468,16 +468,117 @@ DOMInterfaces = {
 },
 
 'SVGNumberList': {
     'nativeType': 'mozilla::DOMSVGNumberList',
     'headerFile': 'DOMSVGNumberList.h',
     'resultNotAddRefed': [ 'getItem' ]
 },
 
+'SVGPathSeg': {
+    'nativeType': 'mozilla::DOMSVGPathSeg',
+    'headerFile': 'DOMSVGPathSeg.h',
+    'concrete': False,
+},
+
+'SVGPathSegClosePath': {
+    'nativeType': 'mozilla::DOMSVGPathSegClosePath',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegMovetoAbs': {
+    'nativeType': 'mozilla::DOMSVGPathSegMovetoAbs',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegMovetoRel': {
+    'nativeType': 'mozilla::DOMSVGPathSegMovetoRel',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegLinetoAbs': {
+    'nativeType': 'mozilla::DOMSVGPathSegLinetoAbs',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegLinetoRel': {
+    'nativeType': 'mozilla::DOMSVGPathSegLinetoRel',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegCurvetoCubicAbs': {
+    'nativeType': 'mozilla::DOMSVGPathSegCurvetoCubicAbs',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegCurvetoCubicRel': {
+    'nativeType': 'mozilla::DOMSVGPathSegCurvetoCubicRel',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegCurvetoQuadraticAbs': {
+    'nativeType': 'mozilla::DOMSVGPathSegCurvetoQuadraticAbs',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegCurvetoQuadraticRel': {
+    'nativeType': 'mozilla::DOMSVGPathSegCurvetoQuadraticRel',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegArcAbs': {
+    'nativeType': 'mozilla::DOMSVGPathSegArcAbs',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegArcRel': {
+    'nativeType': 'mozilla::DOMSVGPathSegArcRel',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegLinetoHorizontalAbs': {
+    'nativeType': 'mozilla::DOMSVGPathSegLinetoHorizontalAbs',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegLinetoHorizontalRel': {
+    'nativeType': 'mozilla::DOMSVGPathSegLinetoHorizontalRel',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegLinetoVerticalAbs': {
+    'nativeType': 'mozilla::DOMSVGPathSegLinetoVerticalAbs',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegLinetoVerticalRel': {
+    'nativeType': 'mozilla::DOMSVGPathSegLinetoVerticalRel',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegCurvetoCubicSmoothAbs': {
+    'nativeType': 'mozilla::DOMSVGPathSegCurvetoCubicSmoothAbs',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegCurvetoCubicSmoothRel': {
+    'nativeType': 'mozilla::DOMSVGPathSegCurvetoCubicSmoothRel',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegCurvetoQuadraticSmoothAbs': {
+    'nativeType': 'mozilla::DOMSVGPathSegCurvetoQuadraticSmoothAbs',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
+'SVGPathSegCurvetoQuadraticSmoothRel': {
+    'nativeType': 'mozilla::DOMSVGPathSegCurvetoQuadraticSmoothRel',
+    'headerFile': 'DOMSVGPathSeg.h'
+},
+
 'SVGPathSegList': {
     'nativeType': 'mozilla::DOMSVGPathSegList',
     'headerFile': 'DOMSVGPathSegList.h',
     'resultNotAddRefed': [ 'getItem' ]
 },
 
 'SVGPoint': {
     'nativeType': 'mozilla::nsISVGPoint',
@@ -888,17 +989,16 @@ addExternalIface('OutputStream', nativeT
 addExternalIface('Principal', nativeType='nsIPrincipal',
                  headerFile='nsIPrincipal.h', notflattened=True)
 addExternalIface('ProcessingInstruction', nativeType='nsXMLProcessingInstruction')
 addExternalIface('Range', nativeType='nsRange')
 addExternalIface("Rect")
 addExternalIface('StyleSheetList')
 addExternalIface('SVGLength')
 addExternalIface('SVGNumber')
-addExternalIface('SVGPathSeg')
 addExternalIface('Text', nativeType='nsTextNode')
 addExternalIface('TextMetrics', headerFile='nsIDOMCanvasRenderingContext2D.h')
 addExternalIface('TreeWalker')
 addExternalIface('Touch', headerFile='nsIDOMTouchEvent.h')
 addExternalIface('TouchList', headerFile='nsIDOMTouchEvent.h')
 addExternalIface('URI', nativeType='nsIURI', headerFile='nsIURI.h',
                  notflattened=True)
 addExternalIface('UserDataHandler')
--- a/dom/interfaces/svg/Makefile.in
+++ b/dom/interfaces/svg/Makefile.in
@@ -58,17 +58,16 @@ XPIDLSRCS	= \
 		nsIDOMSVGMarkerElement.idl \
 		nsIDOMSVGMaskElement.idl \
 		nsIDOMSVGMatrix.idl \
 		nsIDOMSVGMetadataElement.idl \
 		nsIDOMSVGMpathElement.idl \
 		nsIDOMSVGNumber.idl \
 		nsIDOMSVGNumberList.idl \
 		nsIDOMSVGPathElement.idl \
-		nsIDOMSVGPathSeg.idl \
 		nsIDOMSVGPathSegList.idl \
 		nsIDOMSVGPatternElement.idl \
 		nsIDOMSVGPoint.idl \
 		nsIDOMSVGPolygonElement.idl \
 		nsIDOMSVGPolylineElement.idl \
 		nsIDOMSVGRect.idl \
 		nsIDOMSVGRectElement.idl \
 		nsIDOMSVGScriptElement.idl \
--- a/dom/interfaces/svg/nsIDOMSVGPathElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGPathElement.idl
@@ -2,35 +2,16 @@
 /* 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 "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedNumber;
 interface nsIDOMSVGPoint;
-interface nsIDOMSVGPathSegClosePath;
-interface nsIDOMSVGPathSegMovetoAbs;
-interface nsIDOMSVGPathSegMovetoRel;
-interface nsIDOMSVGPathSegLinetoAbs;
-interface nsIDOMSVGPathSegLinetoRel;
-interface nsIDOMSVGPathSegCurvetoCubicAbs;
-interface nsIDOMSVGPathSegCurvetoCubicRel;
-interface nsIDOMSVGPathSegCurvetoQuadraticAbs;
-interface nsIDOMSVGPathSegCurvetoQuadraticRel;
-interface nsIDOMSVGPathSegArcAbs;
-interface nsIDOMSVGPathSegArcRel;
-interface nsIDOMSVGPathSegLinetoHorizontalAbs;
-interface nsIDOMSVGPathSegLinetoHorizontalRel;
-interface nsIDOMSVGPathSegLinetoVerticalAbs;
-interface nsIDOMSVGPathSegLinetoVerticalRel;
-interface nsIDOMSVGPathSegCurvetoCubicSmoothAbs;
-interface nsIDOMSVGPathSegCurvetoCubicSmoothRel;
-interface nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs;
-interface nsIDOMSVGPathSegCurvetoQuadraticSmoothRel;
 
 [scriptable, uuid(89AF3EAE-1703-461A-A2E0-86D2131C11AC)]
 interface nsIDOMSVGPathElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
@@ -48,62 +29,81 @@ interface nsIDOMSVGPathElement
 */
 { 
   readonly attribute nsIDOMSVGAnimatedNumber pathLength;
   
   float          getTotalLength();
   nsIDOMSVGPoint getPointAtLength(in float distance);
   unsigned long  getPathSegAtLength(in float distance);
 
-  nsIDOMSVGPathSegClosePath createSVGPathSegClosePath();
-  nsIDOMSVGPathSegMovetoAbs createSVGPathSegMovetoAbs(in float x, in float y);
-  nsIDOMSVGPathSegMovetoRel createSVGPathSegMovetoRel(in float x, in float y);
-  nsIDOMSVGPathSegLinetoAbs createSVGPathSegLinetoAbs(in float x, in float y);
-  nsIDOMSVGPathSegLinetoRel createSVGPathSegLinetoRel(in float x, in float y);
+  // SVGPathSegClosePath
+  nsISupports createSVGPathSegClosePath();
+  // SVGPathSegMoveToAbs
+  nsISupports createSVGPathSegMovetoAbs(in float x, in float y);
+  // SVGPathSegMoveToRel
+  nsISupports createSVGPathSegMovetoRel(in float x, in float y);
+  // SVGPathSegLineToAbs
+  nsISupports createSVGPathSegLinetoAbs(in float x, in float y);
+  // SVGPathSegLineToRel
+  nsISupports createSVGPathSegLinetoRel(in float x, in float y);
 
-  nsIDOMSVGPathSegCurvetoCubicAbs     createSVGPathSegCurvetoCubicAbs(in float x,
+  // SVGPathSegCurveToCubicAbs
+  nsISupports                         createSVGPathSegCurvetoCubicAbs(in float x,
                                                                       in float y,
                                                                       in float x1,
                                                                       in float y1,
                                                                       in float x2,
                                                                       in float y2);
-  nsIDOMSVGPathSegCurvetoCubicRel     createSVGPathSegCurvetoCubicRel(in float x,
+  // SVGPathSegCurveToCubicRel
+  nsISupports                         createSVGPathSegCurvetoCubicRel(in float x,
                                                                       in float y,
                                                                       in float x1,
                                                                       in float y1,
                                                                       in float x2,
                                                                       in float y2);
-  nsIDOMSVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs(in float x,
+  // SVGPathSegCurveToQuadraticAbs
+  nsISupports                         createSVGPathSegCurvetoQuadraticAbs(in float x,
                                                                           in float y,
                                                                           in float x1,
                                                                           in float y1);
-  nsIDOMSVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel(in float x,
+  // SVGPathSegCurveToQuadraticRel
+  nsISupports                         createSVGPathSegCurvetoQuadraticRel(in float x,
                                                                           in float y,
                                                                           in float x1,
                                                                           in float y1);
 
-  nsIDOMSVGPathSegArcAbs createSVGPathSegArcAbs(in float x, in float y, in float r1,
+  // SVGPathSegArcAbs
+  nsISupports            createSVGPathSegArcAbs(in float x, in float y, in float r1,
                                                 in float r2, in float angle,
                                                 in boolean largeArcFlag,
                                                 in boolean sweepFlag);
-  nsIDOMSVGPathSegArcRel createSVGPathSegArcRel(in float x, in float y, in float r1,
+  // SVGPathSegArcRel
+  nsISupports            createSVGPathSegArcRel(in float x, in float y, in float r1,
                                                 in float r2, in float angle,
                                                 in boolean largeArcFlag,
                                                 in boolean sweepFlag);
 
-  nsIDOMSVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs(in float x);
-  nsIDOMSVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel(in float x);
-  nsIDOMSVGPathSegLinetoVerticalAbs   createSVGPathSegLinetoVerticalAbs(in float y);
-  nsIDOMSVGPathSegLinetoVerticalRel   createSVGPathSegLinetoVerticalRel(in float y);
+  // SVGPathSegLineToHorizontalAbs
+  nsISupports createSVGPathSegLinetoHorizontalAbs(in float x);
+  // SVGPathSegLineToHorizontalRel
+  nsISupports createSVGPathSegLinetoHorizontalRel(in float x);
+  // SVGPathSegLineToVerticalAbs
+  nsISupports createSVGPathSegLinetoVerticalAbs(in float y);
+  // SVGPathSegLineToVerticalRel
+  nsISupports createSVGPathSegLinetoVerticalRel(in float y);
 
-  nsIDOMSVGPathSegCurvetoCubicSmoothAbs     createSVGPathSegCurvetoCubicSmoothAbs(in float x,
+  // SVGPathSegCurveToCubicSmoothAbs
+  nsISupports                               createSVGPathSegCurvetoCubicSmoothAbs(in float x,
                                                                                   in float y,
                                                                                   in float x2,
                                                                                   in float y2);
-  nsIDOMSVGPathSegCurvetoCubicSmoothRel     createSVGPathSegCurvetoCubicSmoothRel(in float x,
+  // SVGPathSegCurveToCubicSmoothRel
+  nsISupports                               createSVGPathSegCurvetoCubicSmoothRel(in float x,
                                                                                   in float y,
                                                                                   in float x2,
                                                                                   in float y2);
-  nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs(in float x,
+  // SVGPathSegCurveToQuadraticSmoothAbs
+  nsISupports                               createSVGPathSegCurvetoQuadraticSmoothAbs(in float x,
                                                                                       in float y);
-  nsIDOMSVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel(in float x,
+  // SVGPathSegCurveToQuadraticSmoothRel
+  nsISupports                               createSVGPathSegCurvetoQuadraticSmoothRel(in float x,
                                                                                       in float y);
 };
deleted file mode 100644
--- a/dom/interfaces/svg/nsIDOMSVGPathSeg.idl
+++ /dev/null
@@ -1,248 +0,0 @@
-/* -*- 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/. */
-
-#include "domstubs.idl"
-
-[scriptable, uuid(b9022da7-e26d-4df3-8c94-b45c4aedda7c)]
-interface nsIDOMSVGPathSeg : nsISupports
-{ 
-  // Path Segment Types
-  const unsigned short PATHSEG_UNKNOWN                      = 0;
-  const unsigned short PATHSEG_CLOSEPATH                    = 1;
-  const unsigned short PATHSEG_MOVETO_ABS                   = 2;
-  const unsigned short PATHSEG_MOVETO_REL                   = 3;
-  const unsigned short PATHSEG_LINETO_ABS                   = 4;
-  const unsigned short PATHSEG_LINETO_REL                   = 5;
-  const unsigned short PATHSEG_CURVETO_CUBIC_ABS            = 6;
-  const unsigned short PATHSEG_CURVETO_CUBIC_REL            = 7;
-  const unsigned short PATHSEG_CURVETO_QUADRATIC_ABS        = 8;
-  const unsigned short PATHSEG_CURVETO_QUADRATIC_REL        = 9;
-  const unsigned short PATHSEG_ARC_ABS                      = 10;
-  const unsigned short PATHSEG_ARC_REL                      = 11;
-  const unsigned short PATHSEG_LINETO_HORIZONTAL_ABS        = 12;
-  const unsigned short PATHSEG_LINETO_HORIZONTAL_REL        = 13;
-  const unsigned short PATHSEG_LINETO_VERTICAL_ABS          = 14;
-  const unsigned short PATHSEG_LINETO_VERTICAL_REL          = 15;
-  const unsigned short PATHSEG_CURVETO_CUBIC_SMOOTH_ABS     = 16;
-  const unsigned short PATHSEG_CURVETO_CUBIC_SMOOTH_REL     = 17;
-  const unsigned short PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;
-  const unsigned short PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;
-
-  readonly attribute unsigned short pathSegType;
-  readonly attribute DOMString      pathSegTypeAsLetter;
-};
-
-
-[scriptable, uuid(4970505f-2cc0-4afa-92e6-0cf4bdbf5a53)]
-interface nsIDOMSVGPathSegClosePath : nsISupports
-{
-};
-
-
-[scriptable, uuid(30cf7749-bf1f-4f9c-9558-8ee24da3a22c)]
-interface nsIDOMSVGPathSegMovetoAbs : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(58ca7e86-661a-473a-96de-89682e7e24d6)]
-interface nsIDOMSVGPathSegMovetoRel : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(5c7ba7b0-c7c5-4a7b-bc1c-2d784153be77)]
-interface nsIDOMSVGPathSegLinetoAbs : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-}; 
-
-[scriptable, uuid(7933a81a-72c5-4489-ba64-5635f4c23063)]
-interface nsIDOMSVGPathSegLinetoRel : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(380afecd-f884-4da7-a0d7-5ffc4531b70b)]
-interface nsIDOMSVGPathSegCurvetoCubicAbs : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-  attribute float   x1;
-              // raises nsIDOMDOMException on setting
-  attribute float   y1;
-              // raises nsIDOMDOMException on setting
-  attribute float   x2;
-              // raises nsIDOMDOMException on setting
-  attribute float   y2;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(0e661233-0c4f-4e0d-94d3-fbc460ad1f88)]
-interface nsIDOMSVGPathSegCurvetoCubicRel : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-  attribute float   x1;
-              // raises nsIDOMDOMException on setting
-  attribute float   y1;
-              // raises nsIDOMDOMException on setting
-  attribute float   x2;
-              // raises nsIDOMDOMException on setting
-  attribute float   y2;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(b7aef0f0-2830-4145-b04f-fe05789ccf8a)]
-interface nsIDOMSVGPathSegCurvetoQuadraticAbs : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-  attribute float   x1;
-              // raises nsIDOMDOMException on setting
-  attribute float   y1;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(c46eb661-9c05-4d46-9b2a-c2ae5b166060)]
-interface nsIDOMSVGPathSegCurvetoQuadraticRel : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-  attribute float   x1;
-  // raises nsIDOMDOMException on setting
-  attribute float   y1;
-  // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(c9e222e5-31fd-4083-ae1f-fcf013681340)]
-interface nsIDOMSVGPathSegArcAbs : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-  attribute float   r1;
-              // raises nsIDOMDOMException on setting
-  attribute float   r2;
-              // raises nsIDOMDOMException on setting
-  attribute float   angle;
-              // raises nsIDOMDOMException on setting
-  attribute boolean largeArcFlag;
-              // raises nsIDOMDOMException on setting
-  attribute boolean sweepFlag;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(49d0360d-bb66-4ab9-b9b0-f49b93398595)]
-interface nsIDOMSVGPathSegArcRel : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-  attribute float   r1;
-              // raises nsIDOMDOMException on setting
-  attribute float   r2;
-              // raises nsIDOMDOMException on setting
-  attribute float   angle;
-              // raises nsIDOMDOMException on setting
-  attribute boolean largeArcFlag;
-              // raises nsIDOMDOMException on setting
-  attribute boolean sweepFlag;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(4a54a4d2-edef-4e19-9600-2330311000f4)]
-interface nsIDOMSVGPathSegLinetoHorizontalAbs : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(8693268c-5180-43fd-acc3-5b9c09f43386)]
-interface nsIDOMSVGPathSegLinetoHorizontalRel : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(fd5ffb7b-7279-4c09-abfd-b733dc872e80)]
-interface nsIDOMSVGPathSegLinetoVerticalAbs : nsISupports
-{ 
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(d3ef2128-8de3-4aac-a6b4-13c7563119a6)]
-interface nsIDOMSVGPathSegLinetoVerticalRel : nsISupports
-{ 
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(5fa8fea8-bdd1-4315-ac44-a39b3ff347b5)]
-interface nsIDOMSVGPathSegCurvetoCubicSmoothAbs : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-  attribute float   x2;
-              // raises nsIDOMDOMException on setting
-  attribute float   y2;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(dd5b4b00-edaa-493a-b477-bbc2576b4a98)]
-interface nsIDOMSVGPathSegCurvetoCubicSmoothRel : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-  attribute float   x2;
-              // raises nsIDOMDOMException on setting
-  attribute float   y2;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(ff5bbb58-b49a-450f-b91b-e50585c34b3d)]
-interface nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-};
-
-[scriptable, uuid(ac0b2007-04e4-4e70-a0e0-294f374b29c4)]
-interface nsIDOMSVGPathSegCurvetoQuadraticSmoothRel : nsISupports
-{ 
-  attribute float   x;
-              // raises nsIDOMDOMException on setting
-  attribute float   y;
-              // raises nsIDOMDOMException on setting
-};
new file mode 100644
--- /dev/null
+++ b/dom/webidl/SVGPathSeg.webidl
@@ -0,0 +1,213 @@
+/* -*- 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 SVGPathSeg {
+
+  // Path Segment Types
+  const unsigned short PATHSEG_UNKNOWN = 0;
+  const unsigned short PATHSEG_CLOSEPATH = 1;
+  const unsigned short PATHSEG_MOVETO_ABS = 2;
+  const unsigned short PATHSEG_MOVETO_REL = 3;
+  const unsigned short PATHSEG_LINETO_ABS = 4;
+  const unsigned short PATHSEG_LINETO_REL = 5;
+  const unsigned short PATHSEG_CURVETO_CUBIC_ABS = 6;
+  const unsigned short PATHSEG_CURVETO_CUBIC_REL = 7;
+  const unsigned short PATHSEG_CURVETO_QUADRATIC_ABS = 8;
+  const unsigned short PATHSEG_CURVETO_QUADRATIC_REL = 9;
+  const unsigned short PATHSEG_ARC_ABS = 10;
+  const unsigned short PATHSEG_ARC_REL = 11;
+  const unsigned short PATHSEG_LINETO_HORIZONTAL_ABS = 12;
+  const unsigned short PATHSEG_LINETO_HORIZONTAL_REL = 13;
+  const unsigned short PATHSEG_LINETO_VERTICAL_ABS = 14;
+  const unsigned short PATHSEG_LINETO_VERTICAL_REL = 15;
+  const unsigned short PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16;
+  const unsigned short PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17;
+  const unsigned short PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;
+  const unsigned short PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;
+
+  readonly attribute unsigned short pathSegType;
+  readonly attribute DOMString pathSegTypeAsLetter;
+};
+
+interface SVGPathSegClosePath : SVGPathSeg {
+};
+
+interface SVGPathSegMovetoAbs : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+};
+
+interface SVGPathSegMovetoRel : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+};
+
+interface SVGPathSegLinetoAbs : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+};
+
+interface SVGPathSegLinetoRel : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+};
+
+interface SVGPathSegCurvetoCubicAbs : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+  [SetterThrows]
+  attribute float x1;
+  [SetterThrows]
+  attribute float y1;
+  [SetterThrows]
+  attribute float x2;
+  [SetterThrows]
+  attribute float y2;
+};
+
+interface SVGPathSegCurvetoCubicRel : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+  [SetterThrows]
+  attribute float x1;
+  [SetterThrows]
+  attribute float y1;
+  [SetterThrows]
+  attribute float x2;
+  [SetterThrows]
+  attribute float y2;
+};
+
+interface SVGPathSegCurvetoQuadraticAbs : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+  [SetterThrows]
+  attribute float x1;
+  [SetterThrows]
+  attribute float y1;
+};
+
+interface SVGPathSegCurvetoQuadraticRel : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+  [SetterThrows]
+  attribute float x1;
+  [SetterThrows]
+  attribute float y1;
+};
+
+interface SVGPathSegArcAbs : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+  [SetterThrows]
+  attribute float r1;
+  [SetterThrows]
+  attribute float r2;
+  [SetterThrows]
+  attribute float angle;
+  [SetterThrows]
+  attribute boolean largeArcFlag;
+  [SetterThrows]
+  attribute boolean sweepFlag;
+};
+
+interface SVGPathSegArcRel : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+  [SetterThrows]
+  attribute float r1;
+  [SetterThrows]
+  attribute float r2;
+  [SetterThrows]
+  attribute float angle;
+  [SetterThrows]
+  attribute boolean largeArcFlag;
+  [SetterThrows]
+  attribute boolean sweepFlag;
+};
+
+interface SVGPathSegLinetoHorizontalAbs : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+};
+
+interface SVGPathSegLinetoHorizontalRel : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+};
+
+interface SVGPathSegLinetoVerticalAbs : SVGPathSeg {
+  [SetterThrows]
+  attribute float y;
+};
+
+interface SVGPathSegLinetoVerticalRel : SVGPathSeg {
+  [SetterThrows]
+  attribute float y;
+};
+
+interface SVGPathSegCurvetoCubicSmoothAbs : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+  [SetterThrows]
+  attribute float x2;
+  [SetterThrows]
+  attribute float y2;
+};
+
+interface SVGPathSegCurvetoCubicSmoothRel : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+  [SetterThrows]
+  attribute float x2;
+  [SetterThrows]
+  attribute float y2;
+};
+
+interface SVGPathSegCurvetoQuadraticSmoothAbs : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+};
+
+interface SVGPathSegCurvetoQuadraticSmoothRel : SVGPathSeg {
+  [SetterThrows]
+  attribute float x;
+  [SetterThrows]
+  attribute float y;
+};
+
--- a/dom/webidl/SVGPathSegList.webidl
+++ b/dom/webidl/SVGPathSegList.webidl
@@ -5,18 +5,16 @@
  *
  * The origin of this IDL file is
  * http://www.w3.org/TR/SVG11/
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-interface SVGPathSeg;
-
 interface SVGPathSegList {
   readonly attribute unsigned long numberOfItems;
   [Throws]
   void clear();
   [Throws]
   SVGPathSeg initialize(SVGPathSeg newItem);
   [Throws]
   getter SVGPathSeg getItem(unsigned long index);
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -70,16 +70,17 @@ webidl_files = \
   Screen.webidl \
   SVGAnimatedBoolean.webidl \
   SVGAnimatedNumberList.webidl \
   SVGAnimatedPreserveAspectRatio.webidl \
   SVGAnimatedTransformList.webidl \
   SVGLengthList.webidl \
   SVGMatrix.webidl \
   SVGNumberList.webidl \
+  SVGPathSeg.webidl \
   SVGPathSegList.webidl \
   SVGPoint.webidl \
   SVGPointList.webidl \
   SVGPreserveAspectRatio.webidl \
   SVGTransform.webidl \
   SVGTransformList.webidl \
   TextDecoder.webidl \
   TextEncoder.webidl \