Bug 1388931 part 3 - Remove all the code to implement SVG path data DOM interfaces. r=longsonr draft
authorJonathan Watt <jwatt@jwatt.org>
Wed, 24 Jan 2018 21:35:52 +0000
changeset 724315 ad398af964ab8b2573d8bfcc4031ea5e86c0ec27
parent 724314 e0b1de8eb0fe9aa89cc2276b34ea4a07e261795c
child 724316 3956a171c5700fd4a56296191c45db1b2c3ab69b
push id96725
push userjwatt@jwatt.org
push dateWed, 24 Jan 2018 21:36:27 +0000
reviewerslongsonr
bugs1388931
milestone60.0a1
Bug 1388931 part 3 - Remove all the code to implement SVG path data DOM interfaces. r=longsonr MozReview-Commit-ID: BFjMjYfqz3Q
dom/svg/DOMSVGPathSeg.cpp
dom/svg/DOMSVGPathSeg.h
dom/svg/DOMSVGPathSegList.cpp
dom/svg/DOMSVGPathSegList.h
dom/svg/SVGAnimatedPathSegList.cpp
dom/svg/SVGAnimatedPathSegList.h
dom/svg/SVGGeometryElement.cpp
dom/svg/SVGGraphicsElement.cpp
dom/svg/SVGPathData.h
dom/svg/SVGPathElement.cpp
dom/svg/SVGPathElement.h
dom/svg/SVGPathSegUtils.h
dom/svg/SVGPolyElement.cpp
dom/svg/moz.build
dom/svg/nsSVGPathDataParser.h
deleted file mode 100644
--- a/dom/svg/DOMSVGPathSeg.cpp
+++ /dev/null
@@ -1,382 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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 "DOMSVGPathSeg.h"
-#include "DOMSVGPathSegList.h"
-#include "SVGAnimatedPathSegList.h"
-#include "nsSVGElement.h"
-#include "nsError.h"
-
-// See the architecture comment in DOMSVGPathSegList.h.
-
-namespace mozilla {
-
-// We could use NS_IMPL_CYCLE_COLLECTION(, except that in Unlink() we need to
-// clear our list's weak ref to us to be safe. (The other option would be to
-// not unlink and rely on the breaking of the other edges in the cycle, as
-// 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_END
-
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGPathSeg)
-NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
-NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGPathSeg, AddRef)
-NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGPathSeg, Release)
-
-//----------------------------------------------------------------------
-// Helper class: AutoChangePathSegNotifier
-// Stack-based helper class to pair calls to WillChangePathSegList
-// and DidChangePathSegList.
-class MOZ_RAII AutoChangePathSegNotifier
-{
-public:
-  explicit AutoChangePathSegNotifier(DOMSVGPathSeg* aPathSeg MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-    : mPathSeg(aPathSeg)
-  {
-    MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-    MOZ_ASSERT(mPathSeg, "Expecting non-null pathSeg");
-    MOZ_ASSERT(mPathSeg->HasOwner(),
-               "Expecting list to have an owner for notification");
-    mEmptyOrOldValue =
-      mPathSeg->Element()->WillChangePathSegList();
-  }
-
-  ~AutoChangePathSegNotifier()
-  {
-    mPathSeg->Element()->DidChangePathSegList(mEmptyOrOldValue);
-    if (mPathSeg->mList->AttrIsAnimating()) {
-      mPathSeg->Element()->AnimationNeedsResample();
-    }
-  }
-
-private:
-  DOMSVGPathSeg* const mPathSeg;
-  nsAttrValue    mEmptyOrOldValue;
-  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
-};
-
-DOMSVGPathSeg::DOMSVGPathSeg(DOMSVGPathSegList *aList,
-                             uint32_t aListIndex,
-                             bool aIsAnimValItem)
-  : mList(aList)
-  , mListIndex(aListIndex)
-  , mIsAnimValItem(aIsAnimValItem)
-{
-  // These shifts are in sync with the members in the header.
-  MOZ_ASSERT(aList && aListIndex <= MaxListIndex(), "bad arg");
-
-  MOZ_ASSERT(IndexIsValid(), "Bad index for DOMSVGPathSeg!");
-}
-
-DOMSVGPathSeg::DOMSVGPathSeg()
-  : mList(nullptr)
-  , mListIndex(0)
-  , mIsAnimValItem(false)
-{
-}
-
-void
-DOMSVGPathSeg::InsertingIntoList(DOMSVGPathSegList *aList,
-                                 uint32_t aListIndex,
-                                 bool aIsAnimValItem)
-{
-  MOZ_ASSERT(!HasOwner(), "Inserting item that is already in a list");
-
-  mList = aList;
-  mListIndex = aListIndex;
-  mIsAnimValItem = aIsAnimValItem;
-
-  MOZ_ASSERT(IndexIsValid(), "Bad index for DOMSVGPathSeg!");
-}
-
-void
-DOMSVGPathSeg::RemovingFromList()
-{
-  uint32_t argCount = SVGPathSegUtils::ArgCountForType(Type());
-  // InternalItem() + 1, because the args come after the encoded seg type
-  memcpy(PtrToMemberArgs(), InternalItem() + 1, argCount * sizeof(float));
-  mList = nullptr;
-  mIsAnimValItem = false;
-}
-
-void
-DOMSVGPathSeg::ToSVGPathSegEncodedData(float* aRaw)
-{
-  MOZ_ASSERT(aRaw, "null pointer");
-  uint32_t argCount = SVGPathSegUtils::ArgCountForType(Type());
-  if (IsInList()) {
-    // 1 + argCount, because we're copying the encoded seg type and args
-    memcpy(aRaw, InternalItem(), (1 + argCount) * sizeof(float));
-  } else {
-    aRaw[0] = SVGPathSegUtils::EncodeType(Type());
-    // aRaw + 1, because the args go after the encoded seg type
-    memcpy(aRaw + 1, PtrToMemberArgs(), argCount * sizeof(float));
-  }
-}
-
-float*
-DOMSVGPathSeg::InternalItem()
-{
-  uint32_t dataIndex = mList->mItems[mListIndex].mInternalDataIndex;
-  return &(mList->InternalList().mData[dataIndex]);
-}
-
-#ifdef DEBUG
-bool
-DOMSVGPathSeg::IndexIsValid()
-{
-  SVGAnimatedPathSegList *alist = Element()->GetAnimPathSegList();
-  return (mIsAnimValItem &&
-          mListIndex < alist->GetAnimValue().CountItems()) ||
-         (!mIsAnimValItem &&
-          mListIndex < alist->GetBaseValue().CountItems());
-}
-#endif
-
-
-////////////////////////////////////////////////////////////////////////
-// Implementation of DOMSVGPathSeg sub-classes below this point
-
-#define IMPL_PROP_WITH_TYPE(segName, propName, index, type)                   \
-  type                                                                        \
-  DOMSVGPathSeg##segName::propName()                                          \
-  {                                                                           \
-    if (mIsAnimValItem && HasOwner()) {                                       \
-      Element()->FlushAnimations(); /* May make HasOwner() == false */        \
-    }                                                                         \
-    return type(HasOwner() ? InternalItem()[1+index] : mArgs[index]);         \
-  }                                                                           \
-  void                                                                        \
-  DOMSVGPathSeg##segName::Set##propName(type a##propName, ErrorResult& rv)    \
-  {                                                                           \
-    if (mIsAnimValItem) {                                                     \
-      rv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);                     \
-      return;                                                                 \
-    }                                                                         \
-    if (HasOwner()) {                                                         \
-      if (InternalItem()[1+index] == float(a##propName)) {                    \
-        return;                                                               \
-      }                                                                       \
-      AutoChangePathSegNotifier notifier(this);                               \
-      InternalItem()[1+index] = float(a##propName);                           \
-    } else {                                                                  \
-      mArgs[index] = float(a##propName);                                      \
-    }                                                                         \
-  }
-
-// 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)
-
-
-///////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(MovetoAbs, X, 0)
-IMPL_FLOAT_PROP(MovetoAbs, Y, 1)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(MovetoRel, X, 0)
-IMPL_FLOAT_PROP(MovetoRel, Y, 1)
-
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(LinetoAbs, X, 0)
-IMPL_FLOAT_PROP(LinetoAbs, Y, 1)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(LinetoRel, X, 0)
-IMPL_FLOAT_PROP(LinetoRel, Y, 1)
-
-
-////////////////////////////////////////////////////////////////////////
-
-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)
-
-
-////////////////////////////////////////////////////////////////////////
-
-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)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(CurvetoQuadraticAbs, X1, 0)
-IMPL_FLOAT_PROP(CurvetoQuadraticAbs, Y1, 1)
-IMPL_FLOAT_PROP(CurvetoQuadraticAbs, X, 2)
-IMPL_FLOAT_PROP(CurvetoQuadraticAbs, Y, 3)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(CurvetoQuadraticRel, X1, 0)
-IMPL_FLOAT_PROP(CurvetoQuadraticRel, Y1, 1)
-IMPL_FLOAT_PROP(CurvetoQuadraticRel, X, 2)
-IMPL_FLOAT_PROP(CurvetoQuadraticRel, Y, 3)
-
-
-////////////////////////////////////////////////////////////////////////
-
-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)
-
-
-////////////////////////////////////////////////////////////////////////
-
-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)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(LinetoHorizontalAbs, X, 0)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(LinetoHorizontalRel, X, 0)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(LinetoVerticalAbs, Y, 0)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(LinetoVerticalRel, Y, 0)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(CurvetoCubicSmoothAbs, X2, 0)
-IMPL_FLOAT_PROP(CurvetoCubicSmoothAbs, Y2, 1)
-IMPL_FLOAT_PROP(CurvetoCubicSmoothAbs, X, 2)
-IMPL_FLOAT_PROP(CurvetoCubicSmoothAbs, Y, 3)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(CurvetoCubicSmoothRel, X2, 0)
-IMPL_FLOAT_PROP(CurvetoCubicSmoothRel, Y2, 1)
-IMPL_FLOAT_PROP(CurvetoCubicSmoothRel, X, 2)
-IMPL_FLOAT_PROP(CurvetoCubicSmoothRel, Y, 3)
-
-
-////////////////////////////////////////////////////////////////////////
-
-IMPL_FLOAT_PROP(CurvetoQuadraticSmoothAbs, X, 0)
-IMPL_FLOAT_PROP(CurvetoQuadraticSmoothAbs, Y, 1)
-
-
-////////////////////////////////////////////////////////////////////////
-
-
-IMPL_FLOAT_PROP(CurvetoQuadraticSmoothRel, X, 0)
-IMPL_FLOAT_PROP(CurvetoQuadraticSmoothRel, Y, 1)
-
-
-
-// This must come after DOMSVGPathSegClosePath et. al. have been declared.
-/* static */ DOMSVGPathSeg*
-DOMSVGPathSeg::CreateFor(DOMSVGPathSegList *aList,
-                         uint32_t aListIndex,
-                         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 PATHSEG_CLOSEPATH:
-    return new DOMSVGPathSegClosePath(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_MOVETO_ABS:
-    return new DOMSVGPathSegMovetoAbs(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_MOVETO_REL:
-    return new DOMSVGPathSegMovetoRel(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_LINETO_ABS:
-    return new DOMSVGPathSegLinetoAbs(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_LINETO_REL:
-    return new DOMSVGPathSegLinetoRel(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_CURVETO_CUBIC_ABS:
-    return new DOMSVGPathSegCurvetoCubicAbs(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_CURVETO_CUBIC_REL:
-    return new DOMSVGPathSegCurvetoCubicRel(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_CURVETO_QUADRATIC_ABS:
-    return new DOMSVGPathSegCurvetoQuadraticAbs(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_CURVETO_QUADRATIC_REL:
-    return new DOMSVGPathSegCurvetoQuadraticRel(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_ARC_ABS:
-    return new DOMSVGPathSegArcAbs(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_ARC_REL:
-    return new DOMSVGPathSegArcRel(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_LINETO_HORIZONTAL_ABS:
-    return new DOMSVGPathSegLinetoHorizontalAbs(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_LINETO_HORIZONTAL_REL:
-    return new DOMSVGPathSegLinetoHorizontalRel(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_LINETO_VERTICAL_ABS:
-    return new DOMSVGPathSegLinetoVerticalAbs(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_LINETO_VERTICAL_REL:
-    return new DOMSVGPathSegLinetoVerticalRel(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
-    return new DOMSVGPathSegCurvetoCubicSmoothAbs(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
-    return new DOMSVGPathSegCurvetoCubicSmoothRel(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
-    return new DOMSVGPathSegCurvetoQuadraticSmoothAbs(aList, aListIndex, aIsAnimValItem);
-  case PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
-    return new DOMSVGPathSegCurvetoQuadraticSmoothRel(aList, aListIndex, aIsAnimValItem);
-  default:
-    NS_NOTREACHED("Invalid path segment type");
-    return nullptr;
-  }
-}
-
-} // namespace mozilla
deleted file mode 100644
--- a/dom/svg/DOMSVGPathSeg.h
+++ /dev/null
@@ -1,723 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef MOZILLA_DOMSVGPATHSEG_H__
-#define MOZILLA_DOMSVGPATHSEG_H__
-
-#include "DOMSVGPathSegList.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsWrapperCache.h"
-#include "SVGPathSegUtils.h"
-#include "mozilla/dom/SVGPathSegBinding.h"
-
-class nsSVGElement;
-
-#define MOZ_SVG_LIST_INDEX_BIT_COUNT 31
-
-namespace mozilla {
-
-#define CHECK_ARG_COUNT_IN_SYNC(segType)                                      \
-  MOZ_ASSERT(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)                     \
-  explicit 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 override                                                       \
-  {                                                                           \
-    return segType;                                                           \
-  }                                                                           \
-  virtual DOMSVGPathSeg*                                                      \
-  Clone() override                                                            \
-  {                                                                           \
-    /* InternalItem() + 1, because we're skipping the encoded seg type */     \
-    float *args = IsInList() ? InternalItem() + 1 : mArgs;                    \
-    return new DOMSVGPathSeg##segName(args);                                  \
-  }                                                                           \
-  virtual float*                                                              \
-  PtrToMemberArgs() override                                                  \
-  {                                                                           \
-    return mArgs;                                                             \
-  }                                                                           \
-                                                                              \
-  virtual JSObject*                                                           \
-  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override      \
-  {                                                                           \
-    return dom::SVGPathSeg##segName##Binding::Wrap(aCx, this, aGivenProto);   \
-  }
-
-
-/**
- * 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().
- *
- * See the architecture comment in DOMSVGPathSegList.h for an overview of the
- * important points regarding these DOM wrapper structures.
- *
- * 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 nsWrapperCache
-{
-  friend class AutoChangePathSegNotifier;
-
-public:
-  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGPathSeg)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_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,
-                                  bool aIsAnimValItem);
-
-  /**
-   * Create an unowned copy of this object. The caller is responsible for the
-   * first AddRef()!
-   */
-  virtual DOMSVGPathSeg* Clone() = 0;
-
-  bool IsInList() const {
-    return !!mList;
-  }
-
-  /**
-   * In future, if this class is used for non-list segments, this will be
-   * different to IsInList().
-   */
-  bool HasOwner() const {
-    return !!mList;
-  }
-
-  /**
-   * This method is called to notify this DOM object that it is being inserted
-   * into a list, and give it the information it needs as a result.
-   *
-   * This object MUST NOT already belong to a list when this method is called.
-   * That's not to say that script can't move these DOM objects between
-   * lists - it can - it's just that the logic to handle that (and send out
-   * the necessary notifications) is located elsewhere (in DOMSVGPathSegList).)
-   */
-  void InsertingIntoList(DOMSVGPathSegList *aList,
-                         uint32_t aListIndex,
-                         bool aIsAnimValItem);
-
-  static uint32_t MaxListIndex() {
-    return (1U << MOZ_SVG_LIST_INDEX_BIT_COUNT) - 1;
-  }
-
-  /// This method is called to notify this object that its list index changed.
-  void UpdateListIndex(uint32_t aListIndex) {
-    mListIndex = aListIndex;
-  }
-
-  /**
-   * This method is called to notify this DOM object that it is about to be
-   * removed from its current DOM list so that it can first make a copy of its
-   * internal counterpart's values. (If it didn't do this, then it would
-   * "lose" its value on being removed.)
-   */
-  void RemovingFromList();
-
-  /**
-   * This method converts the segment to a string of floats as found in
-   * SVGPathData (i.e. the first float contains the type of the segment,
-   * encoded into a float, followed by its arguments in the same order as they
-   * are given in the <path> element's 'd' attribute).
-   */
-  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, JS::Handle<JSObject*> aGivenProto) override = 0;
-
-protected:
-
-  /**
-   * Generic ctor for DOMSVGPathSeg objects that are created for an attribute.
-   */
-  DOMSVGPathSeg(DOMSVGPathSegList *aList,
-                uint32_t aListIndex,
-                bool aIsAnimValItem);
-
-  /**
-   * Ctor for creating the objects returned by
-   * SVGPathElement.createSVGPathSegXxx(), which do not initially belong to an
-   * attribute.
-   */
-  DOMSVGPathSeg();
-
-  virtual ~DOMSVGPathSeg() {
-    // Our mList's weak ref to us must be nulled out when we die. If GC has
-    // unlinked us using the cycle collector code, then that has already
-    // happened, and mList is null.
-    if (mList) {
-      mList->ItemAt(mListIndex) = nullptr;
-    }
-  }
-
-  nsSVGElement* Element() {
-    return mList->Element();
-  }
-
-  /**
-   * Get a reference to the internal SVGPathSeg list item that this DOM wrapper
-   * object currently wraps.
-   *
-   * To simplify the code we just have this one method for obtaining both
-   * baseVal and animVal internal items. This means that animVal items don't
-   * get const protection, but then our setter methods guard against changing
-   * animVal items.
-   */
-  float* InternalItem();
-
-  virtual float* PtrToMemberArgs() = 0;
-
-#ifdef DEBUG
-  bool IndexIsValid();
-#endif
-
-  RefPtr<DOMSVGPathSegList> mList;
-
-  // Bounds for the following are checked in the ctor, so be sure to update
-  // 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
-};
-
-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:
-  explicit 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:
-  explicit 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:
-  explicit 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:
-  explicit 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
-
-#undef MOZ_SVG_LIST_INDEX_BIT_COUNT
-
-#endif // MOZILLA_DOMSVGPATHSEG_H__
deleted file mode 100644
--- a/dom/svg/DOMSVGPathSegList.cpp
+++ /dev/null
@@ -1,606 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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 "nsSVGElement.h"
-#include "DOMSVGPathSegList.h"
-#include "DOMSVGPathSeg.h"
-#include "nsError.h"
-#include "SVGAnimatedPathSegList.h"
-#include "nsCOMPtr.h"
-#include "nsSVGAttrTearoffTable.h"
-#include "SVGPathSegUtils.h"
-#include "mozilla/dom/SVGPathSegListBinding.h"
-
-// See the comment in this file's header.
-
-namespace mozilla {
-
-  static inline
-nsSVGAttrTearoffTable<void, DOMSVGPathSegList>&
-SVGPathSegListTearoffTable()
-{
-  static nsSVGAttrTearoffTable<void, DOMSVGPathSegList>
-    sSVGPathSegListTearoffTable;
-  return sSVGPathSegListTearoffTable;
-}
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(DOMSVGPathSegList)
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGPathSegList)
-  // No unlinking of mElement, we'd need to null out the value pointer (the
-  // object it points to is held by the element) and null-check it everywhere.
-  NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGPathSegList)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mElement)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGPathSegList)
-  NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGPathSegList)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGPathSegList)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGPathSegList)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-
-//----------------------------------------------------------------------
-// Helper class: AutoChangePathSegListNotifier
-// Stack-based helper class to pair calls to WillChangePathSegList and
-// DidChangePathSegList.
-class MOZ_RAII AutoChangePathSegListNotifier
-{
-public:
-  explicit AutoChangePathSegListNotifier(DOMSVGPathSegList* aPathSegList MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-    : mPathSegList(aPathSegList)
-  {
-    MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-    MOZ_ASSERT(mPathSegList, "Expecting non-null pathSegList");
-    mEmptyOrOldValue =
-      mPathSegList->Element()->WillChangePathSegList();
-  }
-
-  ~AutoChangePathSegListNotifier()
-  {
-    mPathSegList->Element()->DidChangePathSegList(mEmptyOrOldValue);
-    if (mPathSegList->AttrIsAnimating()) {
-      mPathSegList->Element()->AnimationNeedsResample();
-    }
-  }
-
-private:
-  DOMSVGPathSegList* const mPathSegList;
-  nsAttrValue        mEmptyOrOldValue;
-  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
-};
-
-/* static */ already_AddRefed<DOMSVGPathSegList>
-DOMSVGPathSegList::GetDOMWrapper(void *aList,
-                                 nsSVGElement *aElement,
-                                 bool aIsAnimValList)
-{
-  RefPtr<DOMSVGPathSegList> wrapper =
-    SVGPathSegListTearoffTable().GetTearoff(aList);
-  if (!wrapper) {
-    wrapper = new DOMSVGPathSegList(aElement, aIsAnimValList);
-    SVGPathSegListTearoffTable().AddTearoff(aList, wrapper);
-  }
-  return wrapper.forget();
-}
-
-/* static */ DOMSVGPathSegList*
-DOMSVGPathSegList::GetDOMWrapperIfExists(void *aList)
-{
-  return SVGPathSegListTearoffTable().GetTearoff(aList);
-}
-
-DOMSVGPathSegList::~DOMSVGPathSegList()
-{
-  // There are now no longer any references to us held by script or list items.
-  // Note we must use GetAnimValKey/GetBaseValKey here, NOT InternalList()!
-  void *key = mIsAnimValList ?
-    InternalAList().GetAnimValKey() :
-    InternalAList().GetBaseValKey();
-  SVGPathSegListTearoffTable().RemoveTearoff(key);
-}
-
-JSObject*
-DOMSVGPathSegList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
-{
-  return mozilla::dom::SVGPathSegListBinding::Wrap(cx, this, aGivenProto);
-}
-
-void
-DOMSVGPathSegList::InternalListWillChangeTo(const SVGPathData& aNewValue)
-{
-  // When the number of items in our internal counterpart changes, we MUST stay
-  // in sync. Everything in the scary comment in
-  // DOMSVGLengthList::InternalBaseValListWillChangeTo applies here just as
-  // much, but we have the additional issue that failing to stay in sync would
-  // mean that - assuming we aren't reading bad memory - we would likely end up
-  // decoding command types from argument floats when looking in our
-  // SVGPathData's data array! Either way, we'll likely then go down
-  // NS_NOTREACHED code paths, or end up reading/setting more bad memory!!
-
-  // The only time that our other DOM list type implementations remove items is
-  // if those items become surplus items due to an attribute change or SMIL
-  // animation sample shortening the list. In general though, they try to keep
-  // their existing DOM items, even when things change. To be consistent, we'd
-  // really like to do the same thing. However, because different types of path
-  // segment correspond to different DOMSVGPathSeg subclasses, the type of
-  // items in our list are generally not the same, which makes this harder for
-  // us. We have to remove DOM segments if their type is not the same as the
-  // type of the new internal segment at their index.
-  //
-  // We also need to sync up mInternalDataIndex, but since we need to loop over
-  // all the items in the new list checking types anyway, that's almost
-  // insignificant in terms of overhead.
-  //
-  // Note that this method is called on every single SMIL animation resample
-  // and we have no way to short circuit the overhead since we don't have a
-  // way to tell if the call is due to a new animation, or a resample of an
-  // existing animation (when the number and type of items would be the same).
-  // (Note that a new animation could start overriding an existing animation at
-  // any time, so checking IsAnimating() wouldn't work.) Because we get called
-  // on every sample, it would not be acceptable alternative to throw away all
-  // our items and let them be recreated lazily, since that would break what
-  // script sees!
-
-  uint32_t length = mItems.Length();
-  uint32_t index = 0;
-
-  uint32_t dataLength = aNewValue.mData.Length();
-  uint32_t dataIndex = 0; // index into aNewValue's raw data array
-
-  uint32_t newSegType;
-
-  RefPtr<DOMSVGPathSegList> kungFuDeathGrip;
-  if (length) {
-    // RemovingFromList() might clear last reference to |this|.
-    // Retain a temporary reference to keep from dying before returning.
-    //
-    // NOTE: For path-seg lists (unlike other list types), we have to do this
-    // *whenever our list is nonempty* (even if we're growing in length).
-    // That's because the path-seg-type of any segment could differ between old
-    // list vs. new list, which will make us destroy & recreate that segment,
-    // which could remove the last reference to us.
-    //
-    // (We explicitly *don't* want to create a kungFuDeathGrip in the length=0
-    // case, though, because we do hit this code inside our constructor before
-    // any other owning references have been added, and at that point, the
-    // deathgrip-removal would make us die before we exit our constructor.)
-    kungFuDeathGrip = this;
-  }
-
-  while (index < length && dataIndex < dataLength) {
-    newSegType = SVGPathSegUtils::DecodeType(aNewValue.mData[dataIndex]);
-    if (ItemAt(index) && ItemAt(index)->Type() != newSegType) {
-      ItemAt(index)->RemovingFromList();
-      ItemAt(index) = nullptr;
-    }
-    // Only after the RemovingFromList() can we touch mInternalDataIndex!
-    mItems[index].mInternalDataIndex = dataIndex;
-    ++index;
-    dataIndex += 1 + SVGPathSegUtils::ArgCountForType(newSegType);
-  }
-
-  MOZ_ASSERT((index == length && dataIndex <= dataLength) ||
-             (index <= length && dataIndex == dataLength),
-             "very bad - list corruption?");
-
-  if (index < length) {
-    // aNewValue has fewer items than our previous internal counterpart
-
-    uint32_t newLength = index;
-
-    // Remove excess items from the list:
-    for (; index < length; ++index) {
-      if (ItemAt(index)) {
-        ItemAt(index)->RemovingFromList();
-        ItemAt(index) = nullptr;
-      }
-    }
-
-    // Only now may we truncate mItems
-    mItems.TruncateLength(newLength);
-  } else if (dataIndex < dataLength) {
-    // aNewValue has more items than our previous internal counterpart
-
-    // Sync mItems:
-    while (dataIndex < dataLength) {
-      if (mItems.Length() &&
-          mItems.Length() - 1 > DOMSVGPathSeg::MaxListIndex()) {
-        // It's safe to get out of sync with our internal list as long as we
-        // have FEWER items than it does.
-        return;
-      }
-      if (!mItems.AppendElement(ItemProxy(nullptr, dataIndex), fallible)) {
-        // OOM
-        ErrorResult rv;
-        Clear(rv);
-        MOZ_ASSERT(!rv.Failed());
-        return;
-      }
-      dataIndex += 1 + SVGPathSegUtils::ArgCountForType(SVGPathSegUtils::DecodeType(aNewValue.mData[dataIndex]));
-    }
-  }
-
-  MOZ_ASSERT(dataIndex == dataLength, "Serious processing error");
-  MOZ_ASSERT(index == length, "Serious counting error");
-}
-
-bool
-DOMSVGPathSegList::AttrIsAnimating() const
-{
-  return InternalAList().IsAnimating();
-}
-
-bool
-DOMSVGPathSegList::AnimListMirrorsBaseList() const
-{
-  return GetDOMWrapperIfExists(InternalAList().GetAnimValKey()) &&
-           !AttrIsAnimating();
-}
-
-SVGPathData&
-DOMSVGPathSegList::InternalList() const
-{
-  SVGAnimatedPathSegList *alist = mElement->GetAnimPathSegList();
-  return mIsAnimValList && alist->IsAnimating() ? *alist->mAnimVal : alist->mBaseVal;
-}
-
-SVGAnimatedPathSegList&
-DOMSVGPathSegList::InternalAList() const
-{
-  MOZ_ASSERT(mElement->GetAnimPathSegList(), "Internal error");
-  return *mElement->GetAnimPathSegList();
-}
-
-// ----------------------------------------------------------------------------
-// nsIDOMSVGPathSegList implementation:
-
-void
-DOMSVGPathSegList::Clear(ErrorResult& aError)
-{
-  if (IsAnimValList()) {
-    aError.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
-    return;
-  }
-
-  if (LengthNoFlush() > 0) {
-    AutoChangePathSegListNotifier notifier(this);
-    // DOM list items that are to be removed must be removed before we change
-    // the internal list, otherwise they wouldn't be able to copy their
-    // internal counterparts' values!
-
-    InternalListWillChangeTo(SVGPathData()); // clears mItems
-
-    if (!AttrIsAnimating()) {
-      // The anim val list is in sync with the base val list
-      DOMSVGPathSegList *animList =
-        GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
-      if (animList) {
-        animList->InternalListWillChangeTo(SVGPathData()); // clears its mItems
-      }
-    }
-
-    InternalList().Clear();
-  }
-}
-
-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.
-
-  RefPtr<DOMSVGPathSeg> domItem = &aNewItem;
-  if (aNewItem.HasOwner()) {
-    domItem = aNewItem.Clone();
-  }
-
-  Clear(aError);
-  MOZ_ASSERT(!aError.Failed(), "How could this fail?");
-  return InsertItemBefore(*domItem, 0, aError);
-}
-
-already_AddRefed<DOMSVGPathSeg>
-DOMSVGPathSegList::GetItem(uint32_t index, ErrorResult& error)
-{
-  bool found;
-  RefPtr<DOMSVGPathSeg> item = IndexedGetter(index, found, error);
-  if (!found) {
-    error.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
-  }
-  return item.forget();
-}
-
-already_AddRefed<DOMSVGPathSeg>
-DOMSVGPathSegList::IndexedGetter(uint32_t aIndex, bool& aFound,
-                                 ErrorResult& aError)
-{
-  if (IsAnimValList()) {
-    Element()->FlushAnimations();
-  }
-  aFound = aIndex < LengthNoFlush();
-  if (aFound) {
-    return GetItemAt(aIndex);
-  }
-  return nullptr;
-}
-
-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;
-  }
-
-  uint32_t internalIndex;
-  if (aIndex < LengthNoFlush()) {
-    internalIndex = mItems[aIndex].mInternalDataIndex;
-  } else {
-    aIndex = LengthNoFlush();
-    internalIndex = InternalList().mData.Length();
-  }
-  if (aIndex >= DOMSVGPathSeg::MaxListIndex()) {
-    aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
-    return nullptr;
-  }
-
-  RefPtr<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, fallible) ||
-      !InternalList().mData.SetCapacity(InternalList().mData.Length() + 1 + argCount,
-                                        fallible)) {
-    aError.Throw(NS_ERROR_OUT_OF_MEMORY);
-    return nullptr;
-  }
-  if (AnimListMirrorsBaseList()) {
-    DOMSVGPathSegList *animVal =
-      GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
-    MOZ_ASSERT(animVal, "animVal should be a valid pointer");
-    if (!animVal->mItems.SetCapacity(
-          animVal->mItems.Length() + 1, fallible)) {
-      aError.Throw(NS_ERROR_OUT_OF_MEMORY);
-      return nullptr;
-    }
-  }
-
-  AutoChangePathSegListNotifier notifier(this);
-  // Now that we know we're inserting, keep animVal list in sync as necessary.
-  MaybeInsertNullInAnimValListAt(aIndex, internalIndex, argCount);
-
-  float segAsRaw[1 + NS_SVG_PATH_SEG_MAX_ARGS];
-  domItem->ToSVGPathSegEncodedData(segAsRaw);
-
-  MOZ_ALWAYS_TRUE(InternalList().mData.InsertElementsAt(internalIndex,
-                                                        segAsRaw,
-                                                        1 + argCount,
-                                                        fallible));
-  MOZ_ALWAYS_TRUE(mItems.InsertElementAt(aIndex,
-                                         ItemProxy(domItem.get(),
-                                                   internalIndex),
-                                         fallible));
-
-  // This MUST come after the insertion into InternalList(), or else under the
-  // insertion into InternalList() the values read from domItem would be bad
-  // data from InternalList() itself!:
-  domItem->InsertingIntoList(this, aIndex, IsAnimValList());
-
-  UpdateListIndicesFromIndex(aIndex + 1, argCount + 1);
-
-  return domItem.forget();
-}
-
-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;
-  }
-
-  if (aIndex >= LengthNoFlush()) {
-    aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
-    return nullptr;
-  }
-
-  RefPtr<DOMSVGPathSeg> domItem = &aNewItem;
-  if (domItem->HasOwner()) {
-    domItem = domItem->Clone(); // must do this before changing anything!
-  }
-
-  AutoChangePathSegListNotifier notifier(this);
-  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:
-    ItemAt(aIndex)->RemovingFromList();
-  }
-
-  uint32_t internalIndex = mItems[aIndex].mInternalDataIndex;
-  // We use InternalList() to get oldArgCount since we may not have a DOM
-  // wrapper at the index being replaced.
-  uint32_t oldType = SVGPathSegUtils::DecodeType(InternalList().mData[internalIndex]);
-
-  // NOTE: ArgCountForType returns a (small) unsigned value, but we're
-  // intentionally putting it in a signed variable, because we're going to
-  // subtract these values and might produce something negative.
-  int32_t oldArgCount = SVGPathSegUtils::ArgCountForType(oldType);
-  int32_t newArgCount = SVGPathSegUtils::ArgCountForType(domItem->Type());
-
-  float segAsRaw[1 + NS_SVG_PATH_SEG_MAX_ARGS];
-  domItem->ToSVGPathSegEncodedData(segAsRaw);
-
-  if (!InternalList().mData.ReplaceElementsAt(internalIndex, 1 + oldArgCount,
-                                              segAsRaw, 1 + newArgCount,
-                                              fallible)) {
-    aError.Throw(NS_ERROR_OUT_OF_MEMORY);
-    return nullptr;
-  }
-  ItemAt(aIndex) = domItem;
-
-  // This MUST come after the ToSVGPathSegEncodedData call, otherwise that call
-  // would end up reading bad data from InternalList()!
-  domItem->InsertingIntoList(this, aIndex, IsAnimValList());
-
-  int32_t delta = newArgCount - oldArgCount;
-  if (delta != 0) {
-    for (uint32_t i = aIndex + 1; i < LengthNoFlush(); ++i) {
-      mItems[i].mInternalDataIndex += delta;
-    }
-  }
-
-  return domItem.forget();
-}
-
-already_AddRefed<DOMSVGPathSeg>
-DOMSVGPathSegList::RemoveItem(uint32_t aIndex,
-                              ErrorResult& aError)
-{
-  if (IsAnimValList()) {
-    aError.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
-    return nullptr;
-  }
-
-  if (aIndex >= LengthNoFlush()) {
-    aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
-    return nullptr;
-  }
-  // We have to return the removed item, so get it, creating it if necessary:
-  RefPtr<DOMSVGPathSeg> result = GetItemAt(aIndex);
-
-  AutoChangePathSegListNotifier notifier(this);
-  // Notify the DOM item of removal *before* modifying the lists so that the
-  // DOM item can copy its *old* value:
-  ItemAt(aIndex)->RemovingFromList();
-
-  uint32_t internalIndex = mItems[aIndex].mInternalDataIndex;
-  uint32_t segType = SVGPathSegUtils::DecodeType(InternalList().mData[internalIndex]);
-  // NOTE: ArgCountForType returns a (small) unsigned value, but we're
-  // intentionally putting it in a signed value, because we're going to
-  // negate it, and you can't negate an unsigned value.
-  int32_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.
-  MaybeRemoveItemFromAnimValListAt(aIndex, argCount);
-
-  InternalList().mData.RemoveElementsAt(internalIndex, 1 + argCount);
-  mItems.RemoveElementAt(aIndex);
-
-  UpdateListIndicesFromIndex(aIndex, -(argCount + 1));
-
-  return result.forget();
-}
-
-already_AddRefed<DOMSVGPathSeg>
-DOMSVGPathSegList::GetItemAt(uint32_t aIndex)
-{
-  MOZ_ASSERT(aIndex < mItems.Length());
-
-  if (!ItemAt(aIndex)) {
-    ItemAt(aIndex) = DOMSVGPathSeg::CreateFor(this, aIndex, IsAnimValList());
-  }
-  RefPtr<DOMSVGPathSeg> result = ItemAt(aIndex);
-  return result.forget();
-}
-
-void
-DOMSVGPathSegList::
-  MaybeInsertNullInAnimValListAt(uint32_t aIndex,
-                                 uint32_t aInternalIndex,
-                                 uint32_t aArgCountForItem)
-{
-  MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
-
-  if (!AnimListMirrorsBaseList()) {
-    return;
-  }
-
-  // The anim val list is in sync with the base val list
-  DOMSVGPathSegList *animVal =
-    GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
-
-  MOZ_ASSERT(animVal, "AnimListMirrorsBaseList() promised a non-null animVal");
-  MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
-             "animVal list not in sync!");
-  MOZ_ALWAYS_TRUE(animVal->mItems.InsertElementAt(aIndex,
-                                                  ItemProxy(nullptr,
-                                                            aInternalIndex),
-                                                  fallible));
-
-  animVal->UpdateListIndicesFromIndex(aIndex + 1, 1 + aArgCountForItem);
-}
-
-void
-DOMSVGPathSegList::
-  MaybeRemoveItemFromAnimValListAt(uint32_t aIndex,
-                                   int32_t aArgCountForItem)
-{
-  MOZ_ASSERT(!IsAnimValList(), "call from baseVal to animVal");
-
-  if (!AnimListMirrorsBaseList()) {
-    return;
-  }
-
-  // This needs to be a strong reference; otherwise, the RemovingFromList call
-  // below might drop the last reference to animVal before we're done with it.
-  RefPtr<DOMSVGPathSegList> animVal =
-    GetDOMWrapperIfExists(InternalAList().GetAnimValKey());
-
-  MOZ_ASSERT(animVal, "AnimListMirrorsBaseList() promised a non-null animVal");
-  MOZ_ASSERT(animVal->mItems.Length() == mItems.Length(),
-             "animVal list not in sync!");
-
-  if (animVal->ItemAt(aIndex)) {
-    animVal->ItemAt(aIndex)->RemovingFromList();
-  }
-  animVal->mItems.RemoveElementAt(aIndex);
-
-  animVal->UpdateListIndicesFromIndex(aIndex, -(1 + aArgCountForItem));
-}
-
-void
-DOMSVGPathSegList::UpdateListIndicesFromIndex(uint32_t aStartingIndex,
-                                              int32_t  aInternalDataIndexDelta)
-{
-  uint32_t length = mItems.Length();
-
-  for (uint32_t i = aStartingIndex; i < length; ++i) {
-    mItems[i].mInternalDataIndex += aInternalDataIndexDelta;
-    if (ItemAt(i)) {
-      ItemAt(i)->UpdateListIndex(i);
-    }
-  }
-}
-
-} // namespace mozilla
deleted file mode 100644
--- a/dom/svg/DOMSVGPathSegList.h
+++ /dev/null
@@ -1,256 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef MOZILLA_DOMSVGPATHSEGLIST_H__
-#define MOZILLA_DOMSVGPATHSEGLIST_H__
-
-#include "nsCOMPtr.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsDebug.h"
-#include "nsSVGElement.h"
-#include "nsTArray.h"
-#include "SVGPathData.h" // IWYU pragma: keep
-#include "mozilla/Attributes.h"
-#include "mozilla/ErrorResult.h"
-
-namespace mozilla {
-
-class DOMSVGPathSeg;
-class SVGAnimatedPathSegList;
-
-/**
- * Class DOMSVGPathSegList
- *
- * This class is used to create the DOM tearoff objects that wrap internal
- * SVGPathData objects.
- *
- * See the architecture comment in DOMSVGAnimatedLengthList.h first (that's
- * LENGTH list), then continue reading the remainder of this comment.
- *
- * The architecture of this class is very similar to that of DOMSVGLengthList
- * except that, since there is no nsIDOMSVGAnimatedPathSegList interface
- * in SVG, we have no parent DOMSVGAnimatedPathSegList (unlike DOMSVGLengthList
- * which has a parent DOMSVGAnimatedLengthList class). (There is an
- * SVGAnimatedPathData interface, but that is quite different to
- * DOMSVGAnimatedLengthList, since it is inherited by elements rather than
- * elements having members of that type.) As a consequence, much of the logic
- * that would otherwise be in DOMSVGAnimatedPathSegList (and is in
- * DOMSVGAnimatedLengthList) is contained in this class.
- *
- * This class is strongly intertwined with DOMSVGPathSeg. Our DOMSVGPathSeg
- * items are friends of us and responsible for nulling out our pointers to
- * them when they die.
- *
- * Our DOM items are created lazily on demand as and when script requests them.
- */
-class DOMSVGPathSegList final : public nsISupports,
-                                public nsWrapperCache
-{
-  friend class AutoChangePathSegListNotifier;
-  friend class DOMSVGPathSeg;
-
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPathSegList)
-
-  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
-
-  nsISupports* GetParentObject()
-  {
-    return static_cast<nsIContent*>(mElement);
-  }
-
-  /**
-   * Factory method to create and return a DOMSVGPathSegList wrapper
-   * for a given internal SVGPathData object. The factory takes care
-   * of caching the object that it returns so that the same object can be
-   * returned for the given SVGPathData each time it is requested.
-   * The cached object is only removed from the cache when it is destroyed due
-   * to there being no more references to it or to any of its descendant
-   * objects. If that happens, any subsequent call requesting the DOM wrapper
-   * for the SVGPathData will naturally result in a new
-   * DOMSVGPathSegList being returned.
-   *
-   * It's unfortunate that aList is a void* instead of a typed argument. This
-   * is because the mBaseVal and mAnimVal members of SVGAnimatedPathSegList are
-   * of different types - a plain SVGPathData, and a SVGPathData*. We
-   * use the addresses of these members as the key for the hash table, and
-   * clearly SVGPathData* and a SVGPathData** are not the same type.
-   */
-  static already_AddRefed<DOMSVGPathSegList>
-  GetDOMWrapper(void *aList,
-                nsSVGElement *aElement,
-                bool aIsAnimValList);
-
-  /**
-   * This method returns the DOMSVGPathSegList wrapper for an internal
-   * SVGPathData object if it currently has a wrapper. If it does
-   * not, then nullptr is returned.
-   */
-  static DOMSVGPathSegList*
-  GetDOMWrapperIfExists(void *aList);
-
-  /**
-   * This will normally be the same as InternalList().CountItems(), except if
-   * we've hit OOM, in which case our length will be zero.
-   */
-  uint32_t LengthNoFlush() const {
-    MOZ_ASSERT(mItems.Length() == 0 ||
-               mItems.Length() == InternalList().CountItems(),
-               "DOM wrapper's list length is out of sync");
-    return mItems.Length();
-  }
-
-  /**
-   * WATCH OUT! If you add code to call this on a baseVal wrapper, then you
-   * must also call it on the animVal wrapper too if necessary!! See other
-   * callers!
-   *
-   * Called by internal code to notify us when we need to sync the length of
-   * this DOM list with its internal list. This is called immediately prior to
-   * the length of the internal list being changed so that any DOM list items
-   * that need to be removed from the DOM list can first copy their values from
-   * their internal counterpart.
-   *
-   * The only time this method could fail is on OOM when trying to increase the
-   * length of the DOM list. If that happens then this method simply clears the
-   * list and returns. Callers just proceed as normal, and we simply accept
-   * that the DOM list will be empty (until successfully set to a new value).
-   */
-  void InternalListWillChangeTo(const SVGPathData& aNewValue);
-
-  /**
-   * Returns true if our attribute is animating (in which case our animVal is
-   * not simply a mirror of our baseVal).
-   */
-  bool AttrIsAnimating() const;
-  /**
-   * Returns true if there is an animated list mirroring the base list.
-   */
-  bool AnimListMirrorsBaseList() const;
-
-  uint32_t NumberOfItems() const
-  {
-    if (IsAnimValList()) {
-      Element()->FlushAnimations();
-    }
-    return LengthNoFlush();
-  }
-  void Clear(ErrorResult& aError);
-  already_AddRefed<DOMSVGPathSeg> Initialize(DOMSVGPathSeg& aNewItem,
-                                             ErrorResult& aError);
-  already_AddRefed<DOMSVGPathSeg> GetItem(uint32_t index,
-                                          ErrorResult& error);
-  already_AddRefed<DOMSVGPathSeg> IndexedGetter(uint32_t index, bool& found,
-                                                ErrorResult& error);
-  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();
-  }
-
-private:
-
-  /**
-   * Only our static GetDOMWrapper() factory method may create objects of our
-   * type.
-   */
-  DOMSVGPathSegList(nsSVGElement *aElement, bool aIsAnimValList)
-    : mElement(aElement)
-    , mIsAnimValList(aIsAnimValList)
-  {
-    InternalListWillChangeTo(InternalList()); // Sync mItems
-  }
-
-  ~DOMSVGPathSegList();
-
-  nsSVGElement* Element() const {
-    return mElement.get();
-  }
-
-  /// Used to determine if this list is the baseVal or animVal list.
-  bool IsAnimValList() const {
-    return mIsAnimValList;
-  }
-
-  /**
-   * Get a reference to this object's corresponding internal SVGPathData.
-   *
-   * To simplify the code we just have this one method for obtaining both
-   * base val and anim val internal lists. This means that anim val lists don't
-   * get const protection, but our setter methods guard against changing
-   * anim val lists.
-   */
-  SVGPathData& InternalList() const;
-
-  SVGAnimatedPathSegList& InternalAList() const;
-
-  /// Creates an instance of the appropriate DOMSVGPathSeg sub-class for
-  // aIndex, if it doesn't already exist, and then returs it.
-  already_AddRefed<DOMSVGPathSeg> GetItemAt(uint32_t aIndex);
-
-  void MaybeInsertNullInAnimValListAt(uint32_t aIndex,
-                                      uint32_t aInternalIndex,
-                                      uint32_t aArgCountForItem);
-  void MaybeRemoveItemFromAnimValListAt(uint32_t aIndex,
-                                        int32_t aArgCountForItem);
-
-  // Calls UpdateListIndex on all elements in |mItems| that satisfy ItemAt(),
-  // from |aStartingIndex| to the end of |mItems|.  Also adjusts
-  // |mItems.mInternalDataIndex| by the requested amount.
-  void UpdateListIndicesFromIndex(uint32_t aStartingIndex,
-                                  int32_t  aInternalDataIndexDelta);
-
-  DOMSVGPathSeg*& ItemAt(uint32_t aIndex) {
-    return mItems[aIndex].mItem;
-  }
-
-  /**
-   * This struct is used in our array of mItems to provide us with somewhere to
-   * store the indexes into the internal SVGPathData of the internal seg data
-   * that our DOMSVGPathSeg items wrap (the internal segment data is or varying
-   * length, so we can't just use the index of our DOMSVGPathSeg items
-   * themselves). The reason that we have this separate struct rather than
-   * just storing the internal indexes in the DOMSVGPathSeg items is because we
-   * want to create the DOMSVGPathSeg items lazily on demand.
-   */
-  struct ItemProxy {
-    ItemProxy(){}
-    ItemProxy(DOMSVGPathSeg *aItem, uint32_t aInternalDataIndex)
-      : mItem(aItem)
-      , mInternalDataIndex(aInternalDataIndex)
-    {}
-
-    DOMSVGPathSeg *mItem;
-    uint32_t mInternalDataIndex;
-  };
-
-  // Weak refs to our DOMSVGPathSeg items. The items are friends and take care
-  // of clearing our pointer to them when they die.
-  FallibleTArray<ItemProxy> mItems;
-
-  // Strong ref to our element to keep it alive. We hold this not only for
-  // ourself, but also for our DOMSVGPathSeg items too.
-  RefPtr<nsSVGElement> mElement;
-
-  bool mIsAnimValList;
-};
-
-} // namespace mozilla
-
-#endif // MOZILLA_DOMSVGPATHSEGLIST_H__
--- a/dom/svg/SVGAnimatedPathSegList.cpp
+++ b/dom/svg/SVGAnimatedPathSegList.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "SVGAnimatedPathSegList.h"
 
-#include "DOMSVGPathSegList.h"
 #include "mozilla/Move.h"
 #include "nsSVGElement.h"
 #include "nsSVGAttrTearoffTable.h"
 #include "nsSMILValue.h"
 #include "SVGPathSegListSMILType.h"
 
 // See the comments in this file's header!
 
@@ -23,128 +22,61 @@ SVGAnimatedPathSegList::SetBaseValueStri
   SVGPathData newBaseValue;
 
   // The spec says that the path data is parsed and accepted up to the first
   // error encountered, so we don't return early if an error occurs. However,
   // we do want to throw any error code from setAttribute if there's a problem.
 
   nsresult rv = newBaseValue.SetValueFromString(aValue);
 
-  // We must send these notifications *before* changing mBaseVal! Our baseVal's
-  // DOM wrapper list may have to remove DOM items from itself, and any removed
-  // DOM items need to copy their internal counterpart's values *before* we
-  // change them. See the comments in
-  // DOMSVGPathSegList::InternalListWillChangeTo().
-
-  DOMSVGPathSegList *baseValWrapper =
-    DOMSVGPathSegList::GetDOMWrapperIfExists(GetBaseValKey());
-  if (baseValWrapper) {
-    baseValWrapper->InternalListWillChangeTo(newBaseValue);
-  }
-
-  DOMSVGPathSegList* animValWrapper = nullptr;
-  if (!IsAnimating()) {  // DOM anim val wraps our base val too!
-    animValWrapper = DOMSVGPathSegList::GetDOMWrapperIfExists(GetAnimValKey());
-    if (animValWrapper) {
-      animValWrapper->InternalListWillChangeTo(newBaseValue);
-    }
-  }
-
-  // Only now may we modify mBaseVal!
-
   // We don't need to call DidChange* here - we're only called by
   // nsSVGElement::ParseAttribute under Element::SetAttr,
   // which takes care of notifying.
 
   nsresult rv2 = mBaseVal.CopyFrom(newBaseValue);
-  if (NS_FAILED(rv2)) {
-    // Attempting to increase mBaseVal's length failed (mBaseVal is left
-    // unmodified). We MUST keep any DOM wrappers in sync:
-    if (baseValWrapper) {
-      baseValWrapper->InternalListWillChangeTo(mBaseVal);
-    }
-    if (animValWrapper) {
-      animValWrapper->InternalListWillChangeTo(mBaseVal);
-    }
-    return rv2;
-  }
-  return rv;
+
+  return NS_FAILED(rv2)? rv2 : rv;
 }
 
 void
 SVGAnimatedPathSegList::ClearBaseValue()
 {
-  // We must send these notifications *before* changing mBaseVal! (See above.)
-
-  DOMSVGPathSegList *baseValWrapper =
-    DOMSVGPathSegList::GetDOMWrapperIfExists(GetBaseValKey());
-  if (baseValWrapper) {
-    baseValWrapper->InternalListWillChangeTo(SVGPathData());
-  }
-
-  if (!IsAnimating()) { // DOM anim val wraps our base val too!
-    DOMSVGPathSegList *animValWrapper =
-      DOMSVGPathSegList::GetDOMWrapperIfExists(GetAnimValKey());
-    if (animValWrapper) {
-      animValWrapper->InternalListWillChangeTo(SVGPathData());
-    }
-  }
+  // Our caller notifies, so we don't have to.
 
   mBaseVal.Clear();
-  // Caller notifies
 }
 
 nsresult
 SVGAnimatedPathSegList::SetAnimValue(const SVGPathData& aNewAnimValue,
                                      nsSVGElement *aElement)
 {
   // Note that a new animation may totally change the number of items in the
   // animVal list, either replacing what was essentially a mirror of the
   // baseVal list, or else replacing and overriding an existing animation.
   // Unfortunately it is not possible for us to reliably distinguish between
   // calls to this method that are setting a new sample for an existing
   // animation, and calls that are setting the first sample of an animation
-  // that will override an existing animation. In the case of DOMSVGPathSegList
-  // the InternalListWillChangeTo method is not virtually free as it is for the
-  // other DOM list classes, so this is a shame. We'd quite like to be able to
-  // skip the call if possible.
+  // that will override an existing animation.
 
-  // We must send these notifications *before* changing mAnimVal! (See above.)
-
-  DOMSVGPathSegList *domWrapper =
-    DOMSVGPathSegList::GetDOMWrapperIfExists(GetAnimValKey());
-  if (domWrapper) {
-    domWrapper->InternalListWillChangeTo(aNewAnimValue);
-  }
   if (!mAnimVal) {
     mAnimVal = new SVGPathData();
   }
   nsresult rv = mAnimVal->CopyFrom(aNewAnimValue);
   if (NS_FAILED(rv)) {
     // OOM. We clear the animation and, importantly, ClearAnimValue() ensures
     // that mAnimVal's DOM wrapper (if any) is kept in sync!
     ClearAnimValue(aElement);
   }
   aElement->DidAnimatePathSegList();
   return rv;
 }
 
 void
 SVGAnimatedPathSegList::ClearAnimValue(nsSVGElement *aElement)
 {
-  // We must send these notifications *before* changing mAnimVal! (See above.)
-
-  DOMSVGPathSegList *domWrapper =
-    DOMSVGPathSegList::GetDOMWrapperIfExists(GetAnimValKey());
-  if (domWrapper) {
-    // When all animation ends, animVal simply mirrors baseVal, which may have
-    // a different number of items to the last active animated value.
-    //
-    domWrapper->InternalListWillChangeTo(mBaseVal);
-  }
   mAnimVal = nullptr;
   aElement->DidAnimatePathSegList();
 }
 
 UniquePtr<nsISMILAttr>
 SVGAnimatedPathSegList::ToSMILAttr(nsSVGElement *aElement)
 {
   return MakeUnique<SMILAnimatedPathSegList>(this, aElement);
--- a/dom/svg/SVGAnimatedPathSegList.h
+++ b/dom/svg/SVGAnimatedPathSegList.h
@@ -27,37 +27,23 @@ class SVGAnimationElement;
  * Class SVGAnimatedPathSegList
  *
  * Despite the fact that no SVGAnimatedPathSegList interface or objects exist
  * in the SVG specification (unlike e.g. SVGAnimated*Length*List), we
  * nevertheless have this internal class. (Note that there is an
  * SVGAnimatedPathData interface, but that's quite different to
  * SVGAnimatedLengthList since it is inherited by elements, as opposed to
  * elements having members of that type.) The reason that we have this class is
- * to provide a single locked down point of entry to the SVGPathData objects,
- * which helps ensure that the DOM wrappers for SVGPathData objects' are always
- * kept in sync. This is vitally important (see the comment in
- * DOMSVGPathSegList::InternalListWillChangeTo) and frees consumers from having
- * to know or worry about wrappers (or forget about them!) for the most part.
+ * to provide a single point of entry to the SVGPathData objects.
  */
 class SVGAnimatedPathSegList final
 {
-  // friends so that they can get write access to mBaseVal and mAnimVal
-  friend class DOMSVGPathSeg;
-  friend class DOMSVGPathSegList;
-
 public:
   SVGAnimatedPathSegList() {}
 
-  /**
-   * Because it's so important that mBaseVal and its DOMSVGPathSegList wrapper
-   * (if any) be kept in sync (see the comment in
-   * DOMSVGPathSegList::InternalListWillChangeTo), this method returns a const
-   * reference. Only our friend classes may get mutable references to mBaseVal.
-   */
   const SVGPathData& GetBaseValue() const {
     return mBaseVal;
   }
 
   nsresult SetBaseValueString(const nsAString& aValue);
 
   void ClearBaseValue();
 
--- a/dom/svg/SVGGeometryElement.cpp
+++ b/dom/svg/SVGGeometryElement.cpp
@@ -12,16 +12,19 @@
 #include "nsComputedDOMStyle.h"
 #include "nsSVGUtils.h"
 #include "nsSVGLength2.h"
 #include "SVGContentUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
+namespace mozilla {
+namespace dom {
+
 nsSVGElement::NumberInfo SVGGeometryElement::sNumberInfo =
 { &nsGkAtoms::pathLength, 0, false };
 
 //----------------------------------------------------------------------
 // Implementation
 
 SVGGeometryElement::SVGGeometryElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
   : SVGGeometryElementBase(aNodeInfo)
@@ -181,8 +184,11 @@ SVGGeometryElement::GetPointAtLength(flo
   return point.forget();
 }
 
 already_AddRefed<SVGAnimatedNumber>
 SVGGeometryElement::PathLength()
 {
   return mPathLength.ToDOMAnimatedNumber(this);
 }
+
+} // namespace dom
+} // namespace mozilla
--- a/dom/svg/SVGGraphicsElement.cpp
+++ b/dom/svg/SVGGraphicsElement.cpp
@@ -1,16 +1,18 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/dom/SVGGraphicsElement.h"
 
+#include "nsContentUtils.h"
+
 namespace mozilla {
 namespace dom {
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ADDREF_INHERITED(SVGGraphicsElement, SVGGraphicsElementBase)
 NS_IMPL_RELEASE_INHERITED(SVGGraphicsElement, SVGGraphicsElementBase)
--- a/dom/svg/SVGPathData.h
+++ b/dom/svg/SVGPathData.h
@@ -23,66 +23,53 @@
 
 class nsSVGPathDataParser; // IWYU pragma: keep
 
 struct nsSVGMark;
 
 namespace mozilla {
 
 /**
- * ATTENTION! WARNING! WATCH OUT!!
- *
- * Consumers that modify objects of this type absolutely MUST keep the DOM
- * wrappers for those lists (if any) in sync!! That's why this class is so
- * locked down.
- *
- * The DOM wrapper class for this class is DOMSVGPathSegList.
- *
  * This class is not called |class SVGPathSegList| for one very good reason;
  * this class does not provide a list of "SVGPathSeg" items, it provides an
  * array of floats into which path segments are encoded. See the paragraphs
  * that follow for why. Note that the Length() method returns the number of
  * floats in our array, not the number of encoded segments, and the index
  * operator indexes floats in the array, not segments. If this class were
  * called SVGPathSegList the names of these methods would be very misleading.
  *
  * The reason this class is designed in this way is because there are many
  * different types of path segment, each taking a different numbers of
  * arguments. We want to store the segments in an nsTArray to avoid individual
  * allocations for each item, but the different size of segments means we can't
  * have one single segment type for the nsTArray (not without using a space
  * wasteful union or something similar). Since the internal code does not need
- * to index into the list (the DOM wrapper does, but it handles that itself)
- * the obvious solution is to have the items in this class take up variable
- * width and have the internal code iterate over these lists rather than index
- * into them.
+ * to index into the list the obvious solution is to have the items in this
+ * class take up variable width and have the internal code iterate over these
+ * lists rather than index into them.
  *
  * Implementing indexing to segments with O(1) performance would require us to
  * allocate and maintain a separate segment index table (keeping that table in
  * sync when items are inserted or removed from the list). So long as the
  * internal code doesn't require indexing to segments, we can avoid that
  * overhead and additional complexity.
  *
  * Segment encoding: the first float in the encoding of a segment contains the
  * segment's type. The segment's type is encoded to/decoded from this float
  * using the static methods SVGPathSegUtils::EncodeType(uint32_t)/
  * SVGPathSegUtils::DecodeType(float). If the path segment type in question
  * takes any arguments then these follow the first float, and are in the same
- * order as they are given in a <path> element's 'd' attribute (NOT in the
- * order of the createSVGPathSegXxx() methods' arguments from the SVG DOM
- * interface SVGPathElement, which are different...grr). Consumers can use
- * SVGPathSegUtils::ArgCountForType(type) to determine how many arguments
+ * order as they are given in a <path> element's 'd' attribute. Consumers can
+ * use SVGPathSegUtils::ArgCountForType(type) to determine how many arguments
  * there are (if any), and thus where the current encoded segment ends, and
  * where the next segment (if any) begins.
  */
 class SVGPathData
 {
   friend class SVGAnimatedPathSegList;
-  friend class DOMSVGPathSegList;
-  friend class DOMSVGPathSeg;
   friend class ::nsSVGPathDataParser;
   // nsSVGPathDataParser will not keep wrappers in sync, so consumers
   // are responsible for that!
 
   typedef gfx::DrawTarget DrawTarget;
   typedef gfx::Path Path;
   typedef gfx::PathBuilder PathBuilder;
   typedef gfx::FillRule FillRule;
--- a/dom/svg/SVGPathElement.cpp
+++ b/dom/svg/SVGPathElement.cpp
@@ -3,18 +3,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 "mozilla/dom/SVGPathElement.h"
 
 #include <algorithm>
 
-#include "DOMSVGPathSeg.h"
-#include "DOMSVGPathSegList.h"
 #include "gfx2DGlue.h"
 #include "gfxPlatform.h"
 #include "mozilla/dom/SVGPathElementBinding.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/RefPtr.h"
 #include "nsCOMPtr.h"
 #include "nsComputedDOMStyle.h"
 #include "nsGkAtoms.h"
@@ -54,190 +52,16 @@ SVGPathElement::AddSizeOfExcludingThis(n
   *aNodeSize += mD.SizeOfExcludingThis(aSizes.mState.mMallocSizeOf);
 }
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPathElement)
 
-uint32_t
-SVGPathElement::GetPathSegAtLength(float distance)
-{
-  return mD.GetAnimValue().GetPathSegAtLength(distance);
-}
-
-already_AddRefed<DOMSVGPathSegClosePath>
-SVGPathElement::CreateSVGPathSegClosePath()
-{
-  RefPtr<DOMSVGPathSegClosePath> pathSeg = new DOMSVGPathSegClosePath();
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegMovetoAbs>
-SVGPathElement::CreateSVGPathSegMovetoAbs(float x, float y)
-{
-  RefPtr<DOMSVGPathSegMovetoAbs> pathSeg = new DOMSVGPathSegMovetoAbs(x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegMovetoRel>
-SVGPathElement::CreateSVGPathSegMovetoRel(float x, float y)
-{
-  RefPtr<DOMSVGPathSegMovetoRel> pathSeg = new DOMSVGPathSegMovetoRel(x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegLinetoAbs>
-SVGPathElement::CreateSVGPathSegLinetoAbs(float x, float y)
-{
-  RefPtr<DOMSVGPathSegLinetoAbs> pathSeg = new DOMSVGPathSegLinetoAbs(x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegLinetoRel>
-SVGPathElement::CreateSVGPathSegLinetoRel(float x, float y)
-{
-  RefPtr<DOMSVGPathSegLinetoRel> pathSeg = new DOMSVGPathSegLinetoRel(x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegCurvetoCubicAbs>
-SVGPathElement::CreateSVGPathSegCurvetoCubicAbs(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).
-  RefPtr<DOMSVGPathSegCurvetoCubicAbs> pathSeg =
-    new DOMSVGPathSegCurvetoCubicAbs(x1, y1, x2, y2, x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegCurvetoCubicRel>
-SVGPathElement::CreateSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2)
-{
-  // See comment in CreateSVGPathSegCurvetoCubicAbs
-  RefPtr<DOMSVGPathSegCurvetoCubicRel> pathSeg =
-    new DOMSVGPathSegCurvetoCubicRel(x1, y1, x2, y2, x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegCurvetoQuadraticAbs>
-SVGPathElement::CreateSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1)
-{
-  // See comment in CreateSVGPathSegCurvetoCubicAbs
-  RefPtr<DOMSVGPathSegCurvetoQuadraticAbs> pathSeg =
-    new DOMSVGPathSegCurvetoQuadraticAbs(x1, y1, x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegCurvetoQuadraticRel>
-SVGPathElement::CreateSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1)
-{
-  // See comment in CreateSVGPathSegCurvetoCubicAbs
-  RefPtr<DOMSVGPathSegCurvetoQuadraticRel> pathSeg =
-    new DOMSVGPathSegCurvetoQuadraticRel(x1, y1, x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegArcAbs>
-SVGPathElement::CreateSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
-{
-  // See comment in CreateSVGPathSegCurvetoCubicAbs
-  RefPtr<DOMSVGPathSegArcAbs> pathSeg =
-    new DOMSVGPathSegArcAbs(r1, r2, angle, largeArcFlag, sweepFlag, x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegArcRel>
-SVGPathElement::CreateSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
-{
-  // See comment in CreateSVGPathSegCurvetoCubicAbs
-  RefPtr<DOMSVGPathSegArcRel> pathSeg =
-    new DOMSVGPathSegArcRel(r1, r2, angle, largeArcFlag, sweepFlag, x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegLinetoHorizontalAbs>
-SVGPathElement::CreateSVGPathSegLinetoHorizontalAbs(float x)
-{
-  RefPtr<DOMSVGPathSegLinetoHorizontalAbs> pathSeg =
-    new DOMSVGPathSegLinetoHorizontalAbs(x);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegLinetoHorizontalRel>
-SVGPathElement::CreateSVGPathSegLinetoHorizontalRel(float x)
-{
-  RefPtr<DOMSVGPathSegLinetoHorizontalRel> pathSeg =
-    new DOMSVGPathSegLinetoHorizontalRel(x);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegLinetoVerticalAbs>
-SVGPathElement::CreateSVGPathSegLinetoVerticalAbs(float y)
-{
-  RefPtr<DOMSVGPathSegLinetoVerticalAbs> pathSeg =
-    new DOMSVGPathSegLinetoVerticalAbs(y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegLinetoVerticalRel>
-SVGPathElement::CreateSVGPathSegLinetoVerticalRel(float y)
-{
-  RefPtr<DOMSVGPathSegLinetoVerticalRel> pathSeg =
-    new DOMSVGPathSegLinetoVerticalRel(y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegCurvetoCubicSmoothAbs>
-SVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2)
-{
-  // See comment in CreateSVGPathSegCurvetoCubicAbs
-  RefPtr<DOMSVGPathSegCurvetoCubicSmoothAbs> pathSeg =
-    new DOMSVGPathSegCurvetoCubicSmoothAbs(x2, y2, x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegCurvetoCubicSmoothRel>
-SVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2)
-{
-  // See comment in CreateSVGPathSegCurvetoCubicAbs
-  RefPtr<DOMSVGPathSegCurvetoCubicSmoothRel> pathSeg =
-    new DOMSVGPathSegCurvetoCubicSmoothRel(x2, y2, x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegCurvetoQuadraticSmoothAbs>
-SVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y)
-{
-  RefPtr<DOMSVGPathSegCurvetoQuadraticSmoothAbs> pathSeg =
-    new DOMSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegCurvetoQuadraticSmoothRel>
-SVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRel(float x, float y)
-{
-  RefPtr<DOMSVGPathSegCurvetoQuadraticSmoothRel> pathSeg =
-    new DOMSVGPathSegCurvetoQuadraticSmoothRel(x, y);
-  return pathSeg.forget();
-}
-
-already_AddRefed<DOMSVGPathSegList>
-SVGPathElement::PathSegList()
-{
-  return DOMSVGPathSegList::GetDOMWrapper(mD.GetBaseValKey(), this, false);
-}
-
-already_AddRefed<DOMSVGPathSegList>
-SVGPathElement::AnimatedPathSegList()
-{
-  return DOMSVGPathSegList::GetDOMWrapper(mD.GetAnimValKey(), this, true);
-}
 
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
 /* virtual */ bool
 SVGPathElement::HasValidDimensions() const
 {
   return !mD.GetAnimValue().IsEmpty();
--- a/dom/svg/SVGPathElement.h
+++ b/dom/svg/SVGPathElement.h
@@ -6,17 +6,16 @@
 
 #ifndef mozilla_dom_SVGPathElement_h
 #define mozilla_dom_SVGPathElement_h
 
 #include "mozilla/gfx/2D.h"
 #include "mozilla/RefPtr.h"
 #include "SVGAnimatedPathSegList.h"
 #include "SVGGeometryElement.h"
-#include "DOMSVGPathSeg.h"
 
 nsresult NS_NewSVGPathElement(nsIContent **aResult,
                               already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
 namespace mozilla {
 
 class nsISVGPoint;
 
@@ -75,51 +74,16 @@ public:
 
   /**
    * Gets the ratio of the actual path length to the content author's estimated
    * length (as provided by the <path> element's 'pathLength' attribute). This
    * is used to scale stroke dashing, and to scale offsets along a textPath.
    */
   float GetPathLengthScale(PathLengthScaleForType aFor);
 
-  // WebIDL
-  uint32_t GetPathSegAtLength(float distance);
-  already_AddRefed<DOMSVGPathSegClosePath> CreateSVGPathSegClosePath();
-  already_AddRefed<DOMSVGPathSegMovetoAbs> CreateSVGPathSegMovetoAbs(float x, float y);
-  already_AddRefed<DOMSVGPathSegMovetoRel> CreateSVGPathSegMovetoRel(float x, float y);
-  already_AddRefed<DOMSVGPathSegLinetoAbs> CreateSVGPathSegLinetoAbs(float x, float y);
-  already_AddRefed<DOMSVGPathSegLinetoRel> CreateSVGPathSegLinetoRel(float x, float y);
-  already_AddRefed<DOMSVGPathSegCurvetoCubicAbs>
-    CreateSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2);
-  already_AddRefed<DOMSVGPathSegCurvetoCubicRel>
-    CreateSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2);
-  already_AddRefed<DOMSVGPathSegCurvetoQuadraticAbs>
-    CreateSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1);
-  already_AddRefed<DOMSVGPathSegCurvetoQuadraticRel>
-    CreateSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1);
-  already_AddRefed<DOMSVGPathSegArcAbs>
-    CreateSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag);
-  already_AddRefed<DOMSVGPathSegArcRel>
-    CreateSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag);
-  already_AddRefed<DOMSVGPathSegLinetoHorizontalAbs> CreateSVGPathSegLinetoHorizontalAbs(float x);
-  already_AddRefed<DOMSVGPathSegLinetoHorizontalRel> CreateSVGPathSegLinetoHorizontalRel(float x);
-  already_AddRefed<DOMSVGPathSegLinetoVerticalAbs> CreateSVGPathSegLinetoVerticalAbs(float y);
-  already_AddRefed<DOMSVGPathSegLinetoVerticalRel> CreateSVGPathSegLinetoVerticalRel(float y);
-  already_AddRefed<DOMSVGPathSegCurvetoCubicSmoothAbs>
-    CreateSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2);
-  already_AddRefed<DOMSVGPathSegCurvetoCubicSmoothRel>
-    CreateSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2);
-  already_AddRefed<DOMSVGPathSegCurvetoQuadraticSmoothAbs>
-    CreateSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y);
-  already_AddRefed<DOMSVGPathSegCurvetoQuadraticSmoothRel>
-    CreateSVGPathSegCurvetoQuadraticSmoothRel(float x, float y);
-  already_AddRefed<DOMSVGPathSegList> PathSegList();
-  already_AddRefed<DOMSVGPathSegList> AnimatedPathSegList();
-
-protected:
-
+private:
   SVGAnimatedPathSegList mD;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_SVGPathElement_h
--- a/dom/svg/SVGPathSegUtils.h
+++ b/dom/svg/SVGPathSegUtils.h
@@ -85,21 +85,16 @@ struct SVGPathTraversalState
 
 /**
  * This class is just a collection of static methods - it doesn't have any data
  * members, and it's not possible to create instances of this class. This class
  * exists purely as a convenient place to gather together a bunch of methods
  * related to manipulating and answering questions about path segments.
  * Internally we represent path segments purely as an array of floats. See the
  * comment documenting SVGPathData for more info on that.
- *
- * The DOM wrapper classes for encoded path segments (data contained in
- * instances of SVGPathData) is DOMSVGPathSeg and its sub-classes. Note that
- * there are multiple different DOM classes for path segs - one for each of the
- * 19 SVG 1.1 segment types.
  */
 class SVGPathSegUtils
 {
 private:
   SVGPathSegUtils(){} // private to prevent instances
 
 public:
 
--- a/dom/svg/SVGPolyElement.cpp
+++ b/dom/svg/SVGPolyElement.cpp
@@ -7,16 +7,19 @@
 #include "SVGPolyElement.h"
 #include "DOMSVGPointList.h"
 #include "mozilla/gfx/2D.h"
 #include "SVGContentUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
+namespace mozilla {
+namespace dom {
+
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ADDREF_INHERITED(SVGPolyElement,SVGPolyElementBase)
 NS_IMPL_RELEASE_INHERITED(SVGPolyElement,SVGPolyElementBase)
 
 NS_INTERFACE_MAP_BEGIN(SVGPolyElement)
 NS_INTERFACE_MAP_END_INHERITING(SVGPolyElementBase)
@@ -152,8 +155,10 @@ SVGPolyElement::GetGeometryBounds(Rect* 
     *aBounds = Rect(aToBoundsSpace.TransformPoint(points[0]), Size());
     for (uint32_t i = 1; i < points.Length(); ++i) {
       aBounds->ExpandToEnclose(aToBoundsSpace.TransformPoint(points[i]));
     }
   }
   return true;
 }
 
+} // namespace dom
+} // namespace mozilla
--- a/dom/svg/moz.build
+++ b/dom/svg/moz.build
@@ -109,18 +109,16 @@ EXPORTS.mozilla.dom += [
 
 UNIFIED_SOURCES += [
     'DOMSVGAnimatedLengthList.cpp',
     'DOMSVGAnimatedNumberList.cpp',
     'DOMSVGLength.cpp',
     'DOMSVGLengthList.cpp',
     'DOMSVGNumber.cpp',
     'DOMSVGNumberList.cpp',
-    'DOMSVGPathSeg.cpp',
-    'DOMSVGPathSegList.cpp',
     'DOMSVGPoint.cpp',
     'DOMSVGPointList.cpp',
     'DOMSVGStringList.cpp',
     'DOMSVGTransformList.cpp',
     'nsISVGPoint.cpp',
     'nsSVGAngle.cpp',
     'nsSVGAnimatedTransformList.cpp',
     'nsSVGBoolean.cpp',
--- a/dom/svg/nsSVGPathDataParser.h
+++ b/dom/svg/nsSVGPathDataParser.h
@@ -11,18 +11,18 @@
 #include "mozilla/gfx/Point.h"
 #include "nsSVGDataParser.h"
 
 namespace mozilla {
 class SVGPathData;
 } // namespace mozilla
 
 ////////////////////////////////////////////////////////////////////////
-// nsSVGPathDataParser: a simple recursive descent parser that builds
-// DOMSVGPathSegs from path data strings. The grammar for path data
+// nsSVGPathDataParser: a simple recursive descent parser that populates
+// an SVGPathData from path data strings. The grammar for path data
 // can be found in SVG CR 20001102, chapter 8.
 
 class nsSVGPathDataParser : public nsSVGDataParser
 {
 public:
   nsSVGPathDataParser(const nsAString& aValue,
                       mozilla::SVGPathData* aList)
     : nsSVGDataParser(aValue),