Backout 7f4f96dbf94f (bug 827172), 661847c6e48b (bug 827724), 00e357dd1458 (bug 827149) to fix the build on a CLOSED TREE
authorEd Morley <emorley@mozilla.com>
Fri, 11 Jan 2013 11:13:17 +0000
changeset 118508 fe51ccc530834cf224c35a294fc50e7230c03211
parent 118507 48acf4054a035c6de87eb63c6af3140cca0fcf61
child 118509 cceb83b998de59193ca289e55a6d9ae2e2eb17e5
push id21113
push useremorley@mozilla.com
push dateFri, 11 Jan 2013 11:13:43 +0000
treeherdermozilla-inbound@fe51ccc53083 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs827172, 827724, 827149
milestone21.0a1
backs out7f4f96dbf94f8aa0ccf67ae242bb1fe08098617b
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout 7f4f96dbf94f (bug 827172), 661847c6e48b (bug 827724), 00e357dd1458 (bug 827149) to fix the build on a CLOSED TREE
content/base/public/Makefile.in
content/base/public/nsIDocument.h
content/base/public/nsIDocumentInlines.h
content/base/src/Element.cpp
content/base/src/FragmentOrElement.cpp
content/base/src/nsDocument.cpp
content/html/content/src/nsGenericHTMLElement.cpp
content/html/document/src/ImageDocument.cpp
content/html/document/src/PluginDocument.cpp
content/html/document/src/VideoDocument.cpp
content/html/document/src/nsHTMLDocument.cpp
content/svg/content/src/Makefile.in
content/svg/content/src/SVGMPathElement.cpp
content/svg/content/src/SVGMPathElement.h
content/svg/content/src/SVGMotionSMILAnimationFunction.cpp
content/svg/content/src/SVGMotionSMILType.cpp
content/svg/content/src/SVGPathElement.cpp
content/svg/content/src/SVGPathElement.h
content/svg/content/src/nsSVGPathDataParser.cpp
content/svg/content/src/nsSVGPathElement.cpp
content/svg/content/src/nsSVGPathElement.h
content/svg/content/src/nsSVGPolyElement.cpp
content/svg/content/src/nsSVGPolyElement.h
dom/base/nsDOMClassInfo.cpp
dom/interfaces/svg/Makefile.in
dom/interfaces/svg/nsIDOMSVGAnimatedPoints.idl
dom/ipc/TabChild.cpp
editor/libeditor/html/nsHTMLEditor.cpp
layout/base/nsCSSRendering.cpp
layout/generic/nsBlockFrame.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/style/nsStyleSet.cpp
layout/svg/nsSVGGeometryFrame.cpp
layout/svg/nsSVGTextFrame.cpp
layout/svg/nsSVGTextPathFrame.cpp
layout/svg/nsSVGUtils.cpp
widget/tests/TestWinTSF.cpp
--- a/content/base/public/Makefile.in
+++ b/content/base/public/Makefile.in
@@ -16,17 +16,16 @@ GRE_MODULE	= 1
 EXPORTS		= \
 mozFlushType.h \
 nsIContent.h \
 nsIAttribute.h \
 nsIContentIterator.h \
 nsContentPolicyUtils.h \
 nsContentUtils.h \
 nsIDocument.h \
-nsIDocumentInlines.h \
 nsDeprecatedOperationList.h \
 nsIDocumentObserver.h \
 nsIMutationObserver.h \
 nsINameSpaceManager.h \
 nsINode.h \
 nsINodeInfo.h \
 nsINodeList.h \
 nsIScriptElement.h \
--- a/content/base/public/nsIDocument.h
+++ b/content/base/public/nsIDocument.h
@@ -86,17 +86,16 @@ class ImageLoader;
 
 namespace dom {
 class CDATASection;
 class Comment;
 class DocumentFragment;
 class DocumentType;
 class DOMImplementation;
 class Element;
-class HTMLBodyElement;
 class Link;
 class ProcessingInstruction;
 class UndoManager;
 template<typename> class Sequence;
 } // namespace dom
 } // namespace mozilla
 
 #define NS_IDOCUMENT_IID \
@@ -576,17 +575,19 @@ public:
   // Get the root <html> element, or return null if there isn't one (e.g.
   // if the root isn't <html>)
   Element* GetHtmlElement();
   // Returns the first child of GetHtmlContent which has the given tag,
   // or nullptr if that doesn't exist.
   Element* GetHtmlChildElement(nsIAtom* aTag);
   // Get the canonical <body> element, or return null if there isn't one (e.g.
   // if the root isn't <html> or if the <body> isn't there)
-  mozilla::dom::HTMLBodyElement* GetBodyElement();
+  Element* GetBodyElement() {
+    return GetHtmlChildElement(nsGkAtoms::body);
+  }
   // Get the canonical <head> element, or return null if there isn't one (e.g.
   // if the root isn't <html> or if the <head> isn't there)
   Element* GetHeadElement() {
     return GetHtmlChildElement(nsGkAtoms::head);
   }
   
   /**
    * Accessors to the collection of stylesheets owned by this document.
deleted file mode 100644
--- a/content/base/public/nsIDocumentInlines.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
-/* vim: set sw=2 sts=2 ts=8 et 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 nsIDocumentInlines_h
-#define nsIDocumentInlines_h
-
-#include "nsIDocument.h"
-#include "mozilla/dom/HTMLBodyElement.h"
-
-inline mozilla::dom::HTMLBodyElement*
-nsIDocument::GetBodyElement()
-{
-  return static_cast<mozilla::dom::HTMLBodyElement*>(GetHtmlChildElement(nsGkAtoms::body));
-}
-
-#endif // nsIDocumentInlines_h
--- a/content/base/src/Element.cpp
+++ b/content/base/src/Element.cpp
@@ -13,17 +13,17 @@
 #include "mozilla/DebugOnly.h"
 
 #include "mozilla/dom/Element.h"
 
 #include "nsDOMAttribute.h"
 #include "nsDOMAttributeMap.h"
 #include "nsIAtom.h"
 #include "nsINodeInfo.h"
-#include "nsIDocumentInlines.h"
+#include "nsIDocument.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMDocument.h"
 #include "nsIContentIterator.h"
 #include "nsEventListenerManager.h"
 #include "nsFocusManager.h"
 #include "nsILinkHandler.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIURL.h"
--- a/content/base/src/FragmentOrElement.cpp
+++ b/content/base/src/FragmentOrElement.cpp
@@ -14,17 +14,17 @@
 #include "mozilla/Likely.h"
 
 #include "mozilla/dom/FragmentOrElement.h"
 
 #include "nsDOMAttribute.h"
 #include "nsDOMAttributeMap.h"
 #include "nsIAtom.h"
 #include "nsINodeInfo.h"
-#include "nsIDocumentInlines.h"
+#include "nsIDocument.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMDocument.h"
 #include "nsIContentIterator.h"
 #include "nsEventListenerManager.h"
 #include "nsFocusManager.h"
 #include "nsILinkHandler.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIURL.h"
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -178,19 +178,18 @@
 
 #include "imgILoader.h"
 #include "imgRequestProxy.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsSandboxFlags.h"
 #include "nsIAppsService.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/DocumentFragment.h"
-#include "mozilla/dom/HTMLBodyElement.h"
 #include "mozilla/dom/UndoManager.h"
-#include "nsFrame.h"
+#include "nsFrame.h" 
 #include "nsDOMCaretPosition.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsViewportInfo.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 typedef nsTArray<Link*> LinkArray;
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -11,16 +11,17 @@
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsCOMPtr.h"
 #include "nsIAtom.h"
 #include "nsIContentViewer.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsIDocument.h"
 #include "nsIDocumentEncoder.h"
+#include "nsIDOMHTMLBodyElement.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMAttr.h"
 #include "nsIDOMDocumentFragment.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMHTMLMenuElement.h"
 #include "nsIDOMElementCSSInlineStyle.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMDocument.h"
@@ -94,17 +95,16 @@
 #include "nsDOMSettableTokenList.h"
 #include "nsThreadUtils.h"
 #include "nsTextFragment.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/ErrorResult.h"
 #include "nsHTMLDocument.h"
 #include "nsDOMTouchEvent.h"
 #include "nsGlobalWindow.h"
-#include "mozilla/dom/HTMLBodyElement.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 class nsINodeInfo;
 class nsIDOMNodeList;
 class nsRuleWalker;
 
@@ -3020,29 +3020,30 @@ nsGenericHTMLElement::GetAssociatedEdito
   return editor.forget();
 }
 
 bool
 nsGenericHTMLElement::IsCurrentBodyElement()
 {
   // TODO Bug 698498: Should this handle the case where GetBody returns a
   //                  frameset?
-  if (!IsHTML(nsGkAtoms::body)) {
+  nsCOMPtr<nsIDOMHTMLBodyElement> bodyElement = do_QueryInterface(this);
+  if (!bodyElement) {
     return false;
   }
 
   nsCOMPtr<nsIDOMHTMLDocument> htmlDocument =
     do_QueryInterface(GetCurrentDoc());
   if (!htmlDocument) {
     return false;
   }
 
   nsCOMPtr<nsIDOMHTMLElement> htmlElement;
   htmlDocument->GetBody(getter_AddRefs(htmlElement));
-  return htmlElement == static_cast<HTMLBodyElement*>(this);
+  return htmlElement == bodyElement;
 }
 
 // static
 void
 nsGenericHTMLElement::SyncEditorsOnSubtree(nsIContent* content)
 {
   /* Sync this node */
   nsGenericHTMLElement* element = FromContent(content);
--- a/content/html/document/src/ImageDocument.cpp
+++ b/content/html/document/src/ImageDocument.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MediaDocument.h"
 #include "nsRect.h"
 #include "nsHTMLDocument.h"
 #include "nsIImageDocument.h"
 #include "nsIImageLoadingContent.h"
 #include "nsGenericHTMLElement.h"
-#include "nsIDocumentInlines.h"
 #include "nsIDOMHTMLImageElement.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMEventListener.h"
 #include "nsGkAtoms.h"
 #include "imgIRequest.h"
 #include "imgILoader.h"
--- a/content/html/document/src/PluginDocument.cpp
+++ b/content/html/document/src/PluginDocument.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MediaDocument.h"
 #include "nsIPluginDocument.h"
 #include "nsGkAtoms.h"
 #include "nsIPresShell.h"
 #include "nsIObjectFrame.h"
 #include "nsNPAPIPluginInstance.h"
-#include "nsIDocumentInlines.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentPolicyUtils.h"
 #include "nsIPropertyBag2.h"
 #include "mozilla/dom/Element.h"
 #include "nsObjectLoadingContent.h"
 #include "sampler.h"
--- a/content/html/document/src/VideoDocument.cpp
+++ b/content/html/document/src/VideoDocument.cpp
@@ -3,17 +3,16 @@
  * 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 "MediaDocument.h"
 #include "nsGkAtoms.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsHTMLMediaElement.h"
-#include "nsIDocumentInlines.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/Element.h"
 
 namespace mozilla {
 namespace dom {
 
 class VideoDocument : public MediaDocument
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -50,29 +50,29 @@
 #include "nsNetCID.h"
 #include "nsICookieService.h"
 
 #include "nsIServiceManager.h"
 #include "nsIConsoleService.h"
 #include "nsIComponentManager.h"
 #include "nsParserCIID.h"
 #include "nsIDOMHTMLElement.h"
+#include "nsIDOMHTMLBodyElement.h"
 #include "nsIDOMHTMLHeadElement.h"
 #include "nsINameSpaceManager.h"
 #include "nsGenericHTMLElement.h"
 #include "mozilla/css/Loader.h"
 #include "nsIHttpChannel.h"
 #include "nsIFile.h"
 #include "nsEventListenerManager.h"
 #include "nsFrameSelection.h"
 #include "nsISelectionPrivate.h"//for toStringwithformat code
 
 #include "nsContentUtils.h"
 #include "nsJSUtils.h"
-#include "nsIDocumentInlines.h"
 #include "nsIDocumentEncoder.h" //for outputting selection
 #include "nsICachingChannel.h"
 #include "nsIJSContextStack.h"
 #include "nsIContentViewer.h"
 #include "nsIWyciwygChannel.h"
 #include "nsIScriptElement.h"
 #include "nsIScriptError.h"
 #include "nsIMutableArray.h"
@@ -99,17 +99,16 @@
 #include "mozilla/dom/Element.h"
 #include "mozilla/Preferences.h"
 #include "nsMimeTypes.h"
 #include "nsIRequest.h"
 #include "nsHtml5TreeOpExecutor.h"
 #include "nsHtml5Parser.h"
 #include "nsIDOMJSWindow.h"
 #include "nsSandboxFlags.h"
-#include "mozilla/dom/HTMLBodyElement.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 #define NS_MAX_DOCUMENT_WRITE_DEPTH 20
 
 #include "prtime.h"
 
@@ -2053,124 +2052,124 @@ nsHTMLDocument::GetNumFormsSynchronous()
   return mNumForms;
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::GetAlinkColor(nsAString& aAlinkColor)
 {
   aAlinkColor.Truncate();
 
-  HTMLBodyElement* body = GetBodyElement();
+  nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->GetALink(aAlinkColor);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::SetAlinkColor(const nsAString& aAlinkColor)
 {
-  HTMLBodyElement* body = GetBodyElement();
+  nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->SetALink(aAlinkColor);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::GetLinkColor(nsAString& aLinkColor)
 {
   aLinkColor.Truncate();
 
-  HTMLBodyElement* body = GetBodyElement();
+  nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->GetLink(aLinkColor);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::SetLinkColor(const nsAString& aLinkColor)
 {
-  HTMLBodyElement* body = GetBodyElement();
+  nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->SetLink(aLinkColor);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::GetVlinkColor(nsAString& aVlinkColor)
 {
   aVlinkColor.Truncate();
 
-  HTMLBodyElement* body = GetBodyElement();
+  nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->GetVLink(aVlinkColor);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::SetVlinkColor(const nsAString& aVlinkColor)
 {
-  HTMLBodyElement* body = GetBodyElement();
+  nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->SetVLink(aVlinkColor);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::GetBgColor(nsAString& aBgColor)
 {
   aBgColor.Truncate();
 
-  HTMLBodyElement* body = GetBodyElement();
+  nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->GetBgColor(aBgColor);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::SetBgColor(const nsAString& aBgColor)
 {
-  HTMLBodyElement* body = GetBodyElement();
+  nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->SetBgColor(aBgColor);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::GetFgColor(nsAString& aFgColor)
 {
   aFgColor.Truncate();
 
-  HTMLBodyElement* body = GetBodyElement();
+  nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->GetText(aFgColor);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHTMLDocument::SetFgColor(const nsAString& aFgColor)
 {
-  HTMLBodyElement* body = GetBodyElement();
+  nsCOMPtr<nsIDOMHTMLBodyElement> body = do_QueryInterface(GetBodyElement());
   if (body) {
     body->SetText(aFgColor);
   }
 
   return NS_OK;
 }
 
 
--- a/content/svg/content/src/Makefile.in
+++ b/content/svg/content/src/Makefile.in
@@ -51,16 +51,17 @@ CPPSRCS		= \
 		nsSVGInteger.cpp \
 		nsSVGIntegerPair.cpp \
 		nsSVGLength2.cpp \
 		nsSVGMarkerElement.cpp \
 		nsSVGMaskElement.cpp \
 		nsSVGNumber2.cpp \
 		nsSVGNumberPair.cpp \
 		nsSVGPathDataParser.cpp \
+		nsSVGPathElement.cpp \
 		nsSVGPathGeometryElement.cpp \
 		nsSVGPatternElement.cpp \
 		nsSVGPolyElement.cpp \
 		nsSVGString.cpp \
 		nsSVGRect.cpp \
 		nsSVGSymbolElement.cpp \
 		nsSVGUnknownElement.cpp \
 		nsSVGUseElement.cpp \
@@ -103,17 +104,16 @@ CPPSRCS		= \
 		SVGMotionSMILAnimationFunction.cpp \
 		SVGMotionSMILPathUtils.cpp \
 		SVGMPathElement.cpp \
 		SVGNumberList.cpp \
 		SVGNumberListSMILType.cpp \
 		SVGNumberPairSMILType.cpp \
 		SVGOrientSMILType.cpp \
 		SVGPathData.cpp \
-		SVGPathElement.cpp \
 		SVGPathSegUtils.cpp \
 		SVGPathSegListSMILType.cpp \
 		SVGPointList.cpp \
 		SVGPointListSMILType.cpp \
 		SVGPolygonElement.cpp \
 		SVGPolylineElement.cpp \
 		SVGPreserveAspectRatio.cpp \
 		SVGRectElement.cpp \
@@ -169,17 +169,16 @@ EXPORTS_mozilla/dom = \
 	SVGForeignObjectElement.h \
 	SVGGElement.h \
 	SVGGraphicsElement.h \
 	SVGImageElement.h \
 	SVGLineElement.h \
 	SVGLocatableElement.h \
 	SVGMetadataElement.h \
 	SVGMPathElement.h \
-	SVGPathElement.h \
 	SVGPolygonElement.h \
 	SVGPolylineElement.h \
 	SVGRectElement.h \
 	SVGScriptElement.h \
 	SVGSetElement.h \
 	SVGStopElement.h \
 	SVGStyleElement.h \
 	SVGSVGElement.h \
--- a/content/svg/content/src/SVGMPathElement.cpp
+++ b/content/svg/content/src/SVGMPathElement.cpp
@@ -3,18 +3,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Util.h"
 
 #include "mozilla/dom/SVGMPathElement.h"
 #include "nsAutoPtr.h"
 #include "nsDebug.h"
+#include "nsSVGPathElement.h"
 #include "mozilla/dom/SVGAnimateMotionElement.h"
-#include "mozilla/dom/SVGPathElement.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/SVGMPathElementBinding.h"
 
 DOMCI_NODE_DATA(SVGMpathElement, mozilla::dom::SVGMPathElement)
 
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(MPath)
 
 namespace mozilla {
@@ -198,29 +198,29 @@ SVGMPathElement::AttributeChanged(nsIDoc
       NotifyParentOfMpathChange(GetParent());
     }
   }
 }
 
 //----------------------------------------------------------------------
 // Public helper methods
 
-SVGPathElement*
+nsSVGPathElement*
 SVGMPathElement::GetReferencedPath()
 {
   if (!HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
     NS_ABORT_IF_FALSE(!mHrefTarget.get(),
                       "We shouldn't have an xlink:href target "
                       "if we don't have an xlink:href attribute");
     return nullptr;
   }
 
   nsIContent* genericTarget = mHrefTarget.get();
   if (genericTarget && genericTarget->IsSVG(nsGkAtoms::path)) {
-    return static_cast<SVGPathElement*>(genericTarget);
+    return static_cast<nsSVGPathElement*>(genericTarget);
   }
   return nullptr;
 }
 
 //----------------------------------------------------------------------
 // Protected helper methods
 
 void
--- a/content/svg/content/src/SVGMPathElement.h
+++ b/content/svg/content/src/SVGMPathElement.h
@@ -5,27 +5,27 @@
 
 #ifndef mozilla_dom_SVGMPathElement_h
 #define mozilla_dom_SVGMPathElement_h
 
 #include "nsIDOMSVGMpathElement.h"
 #include "nsIDOMSVGURIReference.h"
 #include "nsSVGElement.h"
 #include "nsStubMutationObserver.h"
+#include "nsSVGPathElement.h"
 #include "nsSVGString.h"
 #include "nsReferencedElement.h"
 
 nsresult NS_NewSVGMPathElement(nsIContent **aResult,
                                already_AddRefed<nsINodeInfo> aNodeInfo);
 
 typedef nsSVGElement SVGMPathElementBase;
 
 namespace mozilla {
 namespace dom {
-class SVGPathElement;
 
 class SVGMPathElement MOZ_FINAL : public SVGMPathElementBase,
                                   public nsIDOMSVGMpathElement,
                                   public nsIDOMSVGURIReference,
                                   public nsStubMutationObserver
 {
 protected:
   friend nsresult (::NS_NewSVGMPathElement(nsIContent **aResult,
@@ -64,17 +64,17 @@ public:
   virtual bool ParseAttribute(int32_t aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
 
   // Public helper method: If our xlink:href attribute links to a <path>
   // element, this method returns a pointer to that element. Otherwise,
   // this returns nullptr.
-  SVGPathElement* GetReferencedPath();
+  nsSVGPathElement* GetReferencedPath();
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
   already_AddRefed<nsIDOMSVGAnimatedString> Href();
 
--- a/content/svg/content/src/SVGMotionSMILAnimationFunction.cpp
+++ b/content/svg/content/src/SVGMotionSMILAnimationFunction.cpp
@@ -5,18 +5,18 @@
 
 #include "SVGMotionSMILAnimationFunction.h"
 #include "nsISMILAnimationElement.h"
 #include "nsSMILParserUtils.h"
 #include "nsSVGAngle.h"
 #include "SVGMotionSMILType.h"
 #include "SVGMotionSMILPathUtils.h"
 #include "nsSVGPathDataParser.h"
-#include "mozilla/dom/SVGPathElement.h" // for nsSVGPathList
-#include "mozilla/dom/SVGMPathElement.h"
+#include "nsSVGPathElement.h" // for nsSVGPathList
+#include "SVGMPathElement.h"
 #include "nsAttrValueInlines.h"
 
 namespace mozilla {
 
 using namespace dom;
 
 SVGMotionSMILAnimationFunction::SVGMotionSMILAnimationFunction()
   : mRotateType(eRotateType_Explicit),
@@ -212,17 +212,17 @@ SVGMotionSMILAnimationFunction::
 
 void
 SVGMotionSMILAnimationFunction::
   RebuildPathAndVerticesFromMpathElem(SVGMPathElement* aMpathElem)
 {
   mPathSourceType = ePathSourceType_Mpath;
 
   // Use the path that's the target of our chosen <mpath> child.
-  SVGPathElement* pathElem = aMpathElem->GetReferencedPath();
+  nsSVGPathElement* pathElem = aMpathElem->GetReferencedPath();
   if (pathElem) {
     const SVGPathData &path = pathElem->GetAnimPathSegList()->GetAnimValue();
     // Path data must contain of at least one path segment (if the path data
     // doesn't begin with a valid "M", then it's invalid).
     if (path.Length()) {
       bool ok =
         path.GetDistancesFromOriginToEndsOfVisibleSegments(&mPathVertices);
       if (ok && mPathVertices.Length()) {
--- a/content/svg/content/src/SVGMotionSMILType.cpp
+++ b/content/svg/content/src/SVGMotionSMILType.cpp
@@ -3,20 +3,18 @@
  * 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/. */
 
 /* implementation of nsISMILType for use by <animateMotion> element */
 
 #include "SVGMotionSMILType.h"
 #include "nsSMILValue.h"
 #include "nsDebug.h"
+#include "nsSVGPathElement.h"
 #include "nsMathUtils.h"
-#include "nsISupportsUtils.h"
-#include "gfxPath.h"
-#include "nsTArray.h"
 #include <math.h>
 
 namespace mozilla {
 
 /*static*/ SVGMotionSMILType SVGMotionSMILType::sSingleton;
 
 
 // Helper enum, for distinguishing between types of MotionSegment structs
deleted file mode 100644
--- a/content/svg/content/src/SVGPathElement.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/Util.h"
-
-#include "nsGkAtoms.h"
-#include "DOMSVGPathSeg.h"
-#include "DOMSVGPathSegList.h"
-#include "nsCOMPtr.h"
-#include "nsContentUtils.h"
-#include "mozilla/dom/SVGPathElement.h"
-#include "DOMSVGPoint.h"
-#include "gfxContext.h"
-
-DOMCI_NODE_DATA(SVGPathElement, mozilla::dom::SVGPathElement)
-
-NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Path)
-
-namespace mozilla {
-namespace dom {
-
-nsSVGElement::NumberInfo SVGPathElement::sNumberInfo = 
-{ &nsGkAtoms::pathLength, 0, false };
-
-//----------------------------------------------------------------------
-// nsISupports methods
-
-NS_IMPL_ADDREF_INHERITED(SVGPathElement,SVGPathElementBase)
-NS_IMPL_RELEASE_INHERITED(SVGPathElement,SVGPathElementBase)
-
-NS_INTERFACE_TABLE_HEAD(SVGPathElement)
-  NS_NODE_INTERFACE_TABLE5(SVGPathElement, nsIDOMNode, nsIDOMElement,
-                           nsIDOMSVGElement,
-                           nsIDOMSVGPathElement, nsIDOMSVGAnimatedPathData)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGPathElement)
-NS_INTERFACE_MAP_END_INHERITING(SVGPathElementBase)
-
-//----------------------------------------------------------------------
-// Implementation
-
-SVGPathElement::SVGPathElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : SVGPathElementBase(aNodeInfo)
-{
-}
-
-//----------------------------------------------------------------------
-// nsIDOMNode methods
-
-NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPathElement)
-
-//----------------------------------------------------------------------
-// nsIDOMSVGPathElement methods:
-
-/* readonly attribute nsIDOMSVGAnimatedNumber pathLength; */
-NS_IMETHODIMP
-SVGPathElement::GetPathLength(nsIDOMSVGAnimatedNumber * *aPathLength)
-{
-  return mPathLength.ToDOMAnimatedNumber(aPathLength, this);
-}
-
-/* float getTotalLength (); */
-NS_IMETHODIMP
-SVGPathElement::GetTotalLength(float *_retval)
-{
-  *_retval = 0;
-
-  nsRefPtr<gfxFlattenedPath> flat = GetFlattenedPath(gfxMatrix());
-
-  if (!flat)
-    return NS_ERROR_FAILURE;
-
-  *_retval = flat->GetLength();
-
-  return NS_OK;
-}
-
-/* DOMSVGPoint getPointAtLength (in float distance); */
-NS_IMETHODIMP
-SVGPathElement::GetPointAtLength(float distance, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE(distance, NS_ERROR_ILLEGAL_VALUE);
-
-  nsRefPtr<gfxFlattenedPath> flat = GetFlattenedPath(gfxMatrix());
-  if (!flat)
-    return NS_ERROR_FAILURE;
-
-  float totalLength = flat->GetLength();
-  if (mPathLength.IsExplicitlySet()) {
-    float pathLength = mPathLength.GetAnimValue();
-    if (pathLength <= 0) {
-      return NS_ERROR_FAILURE;
-    }
-    distance *= totalLength / pathLength;
-  }
-  distance = NS_MAX(0.f,         distance);
-  distance = NS_MIN(totalLength, distance);
-
-  NS_ADDREF(*_retval = new DOMSVGPoint(flat->FindPoint(gfxPoint(distance, 0))));
-  return NS_OK;
-}
-
-/* unsigned long getPathSegAtLength (in float distance); */
-NS_IMETHODIMP
-SVGPathElement::GetPathSegAtLength(float distance, uint32_t *_retval)
-{
-  NS_ENSURE_FINITE(distance, NS_ERROR_ILLEGAL_VALUE);
-  *_retval = mD.GetAnimValue().GetPathSegAtLength(distance);
-  return NS_OK;
-}
-
-/* nsISupports createSVGPathSegClosePath (); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegClosePath(nsISupports **_retval)
-{
-  nsISupports* seg = NS_NewSVGPathSegClosePath();
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegMovetoAbs (in float x, in float y); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegMovetoAbs(float x, float y, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegMovetoAbs(x, y);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegMovetoRel (in float x, in float y); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegMovetoRel(float x, float y, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegMovetoRel(x, y);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegLinetoAbs (in float x, in float y); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegLinetoAbs(float x, float y, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegLinetoAbs(x, y);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegLinetoRel (in float x, in float y); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegLinetoRel(float x, float y, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegLinetoRel(x, y);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegCurvetoCubicAbs (in float x, in float y, in float x1, in float y1, in float x2, in float y2); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE6(x, y, x1, y1, x2, y2, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegCurvetoCubicRel (in float x, in float y, in float x1, in float y1, in float x2, in float y2); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE6(x, y, x1, y1, x2, y2, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegCurvetoQuadraticAbs (in float x, in float y, in float x1, in float y1); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE4(x, y, x1, y1, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegCurvetoQuadraticRel (in float x, in float y, in float x1, in float y1); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE4(x, y, x1, y1, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegArcAbs (in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE5(x, y, r1, r2, angle, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegArcAbs(x, y, r1, r2, angle,
-                                                 largeArcFlag, sweepFlag);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegArcRel (in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE5(x, y, r1, r2, angle, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegArcRel(x, y, r1, r2, angle,
-                                                 largeArcFlag, sweepFlag);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegLinetoHorizontalAbs (in float x); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegLinetoHorizontalAbs(float x, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE(x, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegLinetoHorizontalAbs(x);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegLinetoHorizontalRel (in float x); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegLinetoHorizontalRel(float x, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE(x, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegLinetoHorizontalRel(x);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegLinetoVerticalAbs (in float y); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegLinetoVerticalAbs(float y, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE(y, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegLinetoVerticalAbs(y);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegLinetoVerticalRel (in float y); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegLinetoVerticalRel(float y, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE(y, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegLinetoVerticalRel(y);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegCurvetoCubicSmoothAbs (in float x, in float y, in float x2, in float y2); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE4(x, y, x2, y2, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegCurvetoCubicSmoothRel (in float x, in float y, in float x2, in float y2); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE4(x, y, x2, y2, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegCurvetoQuadraticSmoothAbs (in float x, in float y); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-/* nsISupports createSVGPathSegCurvetoQuadraticSmoothRel (in float x, in float y); */
-NS_IMETHODIMP
-SVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, nsISupports **_retval)
-{
-  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
-  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticSmoothRel(x, y);
-  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
-  return CallQueryInterface(seg, _retval);
-}
-
-//----------------------------------------------------------------------
-// nsSVGElement methods
-
-/* virtual */ bool
-SVGPathElement::HasValidDimensions() const
-{
-  return !mD.GetAnimValue().IsEmpty();
-}
-
-nsSVGElement::NumberAttributesInfo
-SVGPathElement::GetNumberInfo()
-{
-  return NumberAttributesInfo(&mPathLength, &sNumberInfo, 1);
-}
-
-//----------------------------------------------------------------------
-// nsIDOMSVGAnimatedPathData methods:
-
-/* readonly attribute DOMSVGPathSegList pathSegList; */
-NS_IMETHODIMP SVGPathElement::GetPathSegList(nsISupports * *aPathSegList)
-{
-  void *key = mD.GetBaseValKey();
-  *aPathSegList = DOMSVGPathSegList::GetDOMWrapper(key, this, false).get();
-  return *aPathSegList ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
-}
-
-/* readonly attribute DOMSVGPathSegList animatedPathSegList; */
-NS_IMETHODIMP SVGPathElement::GetAnimatedPathSegList(nsISupports * *aAnimatedPathSegList)
-{
-  void *key = mD.GetAnimValKey();
-  *aAnimatedPathSegList =
-    DOMSVGPathSegList::GetDOMWrapper(key, this, true).get();
-  return *aAnimatedPathSegList ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
-}
-
-//----------------------------------------------------------------------
-// nsIContent methods
-
-NS_IMETHODIMP_(bool)
-SVGPathElement::IsAttributeMapped(const nsIAtom* name) const
-{
-  static const MappedAttributeEntry* const map[] = {
-    sMarkersMap
-  };
-
-  return FindAttributeDependence(name, map) ||
-    SVGPathElementBase::IsAttributeMapped(name);
-}
-
-already_AddRefed<gfxFlattenedPath>
-SVGPathElement::GetFlattenedPath(const gfxMatrix &aMatrix)
-{
-  return mD.GetAnimValue().ToFlattenedPath(aMatrix);
-}
-
-//----------------------------------------------------------------------
-// nsSVGPathGeometryElement methods
-
-bool
-SVGPathElement::AttributeDefinesGeometry(const nsIAtom *aName)
-{
-  return aName == nsGkAtoms::d ||
-         aName == nsGkAtoms::pathLength;
-}
-
-bool
-SVGPathElement::IsMarkable()
-{
-  return true;
-}
-
-void
-SVGPathElement::GetMarkPoints(nsTArray<nsSVGMark> *aMarks)
-{
-  mD.GetAnimValue().GetMarkerPositioningData(aMarks);
-}
-
-void
-SVGPathElement::ConstructPath(gfxContext *aCtx)
-{
-  mD.GetAnimValue().ConstructPath(aCtx);
-}
-
-gfxFloat
-SVGPathElement::GetPathLengthScale(PathLengthScaleForType aFor)
-{
-  NS_ABORT_IF_FALSE(aFor == eForTextPath || aFor == eForStroking,
-                    "Unknown enum");
-  if (mPathLength.IsExplicitlySet()) {
-    float authorsPathLengthEstimate = mPathLength.GetAnimValue();
-    if (authorsPathLengthEstimate > 0) {
-      gfxMatrix matrix;
-      if (aFor == eForTextPath) {
-        // For textPath, a transform on the referenced path affects the
-        // textPath layout, so when calculating the actual path length
-        // we need to take that into account.
-        matrix = PrependLocalTransformsTo(matrix);
-      }
-      nsRefPtr<gfxFlattenedPath> path = GetFlattenedPath(matrix);
-      if (path) {
-        return path->GetLength() / authorsPathLengthEstimate;
-      }
-    }
-  }
-  return 1.0;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/content/svg/content/src/SVGPathElement.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_SVGPathElement_h
-#define mozilla_dom_SVGPathElement_h
-
-#include "nsIDOMSVGAnimatedPathData.h"
-#include "nsIDOMSVGPathElement.h"
-#include "nsSVGNumber2.h"
-#include "nsSVGPathGeometryElement.h"
-#include "SVGAnimatedPathSegList.h"
-
-nsresult NS_NewSVGPathElement(nsIContent **aResult,
-                              already_AddRefed<nsINodeInfo> aNodeInfo);
-
-class gfxContext;
-
-typedef nsSVGPathGeometryElement SVGPathElementBase;
-
-namespace mozilla {
-namespace dom {
-
-class SVGPathElement MOZ_FINAL : public SVGPathElementBase,
-                                 public nsIDOMSVGPathElement,
-                                 public nsIDOMSVGAnimatedPathData
-{
-friend class nsSVGPathFrame;
-
-protected:
-  friend nsresult (::NS_NewSVGPathElement(nsIContent **aResult,
-                                          already_AddRefed<nsINodeInfo> aNodeInfo));
-  SVGPathElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-
-public:
-  typedef SVGAnimatedPathSegList SVGAnimatedPathSegList;
-  // interfaces:
-
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_NSIDOMSVGPATHELEMENT
-  NS_DECL_NSIDOMSVGANIMATEDPATHDATA
-
-  // xxx I wish we could use virtual inheritance
-  NS_FORWARD_NSIDOMNODE_TO_NSINODE
-  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-  NS_FORWARD_NSIDOMSVGELEMENT(SVGPathElementBase::)
-
-  // nsIContent interface
-  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* name) const;
-
-  // nsSVGSVGElement methods:
-  virtual bool HasValidDimensions() const;
-
-  // nsSVGPathGeometryElement methods:
-  virtual bool AttributeDefinesGeometry(const nsIAtom *aName);
-  virtual bool IsMarkable();
-  virtual void GetMarkPoints(nsTArray<nsSVGMark> *aMarks);
-  virtual void ConstructPath(gfxContext *aCtx);
-
-  virtual already_AddRefed<gfxFlattenedPath> GetFlattenedPath(const gfxMatrix &aMatrix);
-
-  // nsIContent interface
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-
-  virtual nsXPCClassInfo* GetClassInfo();
-
-  virtual nsIDOMNode* AsDOMNode() { return this; }
-
-  virtual SVGAnimatedPathSegList* GetAnimPathSegList() {
-    return &mD;
-  }
-
-  virtual nsIAtom* GetPathDataAttrName() const {
-    return nsGkAtoms::d;
-  }
-
-  enum PathLengthScaleForType {
-    eForTextPath,
-    eForStroking
-  };
-
-  /**
-   * 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.
-   */
-  gfxFloat GetPathLengthScale(PathLengthScaleForType aFor);
-
-protected:
-
-  // nsSVGElement method
-  virtual NumberAttributesInfo GetNumberInfo();
-
-  SVGAnimatedPathSegList mD;
-  nsSVGNumber2 mPathLength;
-  static NumberInfo sNumberInfo;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_SVGPathElement_h
--- a/content/svg/content/src/nsSVGPathDataParser.cpp
+++ b/content/svg/content/src/nsSVGPathDataParser.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsSVGPathDataParser.h"
 #include "nsSVGDataParser.h"
+#include "nsSVGPathElement.h"
 #include "prdtoa.h"
 #include "DOMSVGPathSeg.h"
 #include <stdlib.h>
 #include <math.h>
 
 using namespace mozilla;
 
 nsresult nsSVGPathDataParser::Match()
new file mode 100644
--- /dev/null
+++ b/content/svg/content/src/nsSVGPathElement.cpp
@@ -0,0 +1,408 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "mozilla/Util.h"
+
+#include "nsGkAtoms.h"
+#include "DOMSVGPathSeg.h"
+#include "DOMSVGPathSegList.h"
+#include "nsCOMPtr.h"
+#include "nsContentUtils.h"
+#include "nsSVGPathElement.h"
+#include "DOMSVGPoint.h"
+#include "gfxContext.h"
+
+using namespace mozilla;
+
+nsSVGElement::NumberInfo nsSVGPathElement::sNumberInfo = 
+{ &nsGkAtoms::pathLength, 0, false };
+
+NS_IMPL_NS_NEW_SVG_ELEMENT(Path)
+
+//----------------------------------------------------------------------
+// nsISupports methods
+
+NS_IMPL_ADDREF_INHERITED(nsSVGPathElement,nsSVGPathElementBase)
+NS_IMPL_RELEASE_INHERITED(nsSVGPathElement,nsSVGPathElementBase)
+
+DOMCI_NODE_DATA(SVGPathElement, nsSVGPathElement)
+
+NS_INTERFACE_TABLE_HEAD(nsSVGPathElement)
+  NS_NODE_INTERFACE_TABLE5(nsSVGPathElement, nsIDOMNode, nsIDOMElement,
+                           nsIDOMSVGElement,
+                           nsIDOMSVGPathElement, nsIDOMSVGAnimatedPathData)
+  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGPathElement)
+NS_INTERFACE_MAP_END_INHERITING(nsSVGPathElementBase)
+
+//----------------------------------------------------------------------
+// Implementation
+
+nsSVGPathElement::nsSVGPathElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+  : nsSVGPathElementBase(aNodeInfo)
+{
+}
+
+//----------------------------------------------------------------------
+// nsIDOMNode methods
+
+NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGPathElement)
+
+//----------------------------------------------------------------------
+// nsIDOMSVGPathElement methods:
+
+/* readonly attribute nsIDOMSVGAnimatedNumber pathLength; */
+NS_IMETHODIMP
+nsSVGPathElement::GetPathLength(nsIDOMSVGAnimatedNumber * *aPathLength)
+{
+  return mPathLength.ToDOMAnimatedNumber(aPathLength, this);
+}
+
+/* float getTotalLength (); */
+NS_IMETHODIMP
+nsSVGPathElement::GetTotalLength(float *_retval)
+{
+  *_retval = 0;
+
+  nsRefPtr<gfxFlattenedPath> flat = GetFlattenedPath(gfxMatrix());
+
+  if (!flat)
+    return NS_ERROR_FAILURE;
+
+  *_retval = flat->GetLength();
+
+  return NS_OK;
+}
+
+/* DOMSVGPoint getPointAtLength (in float distance); */
+NS_IMETHODIMP
+nsSVGPathElement::GetPointAtLength(float distance, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE(distance, NS_ERROR_ILLEGAL_VALUE);
+
+  nsRefPtr<gfxFlattenedPath> flat = GetFlattenedPath(gfxMatrix());
+  if (!flat)
+    return NS_ERROR_FAILURE;
+
+  float totalLength = flat->GetLength();
+  if (mPathLength.IsExplicitlySet()) {
+    float pathLength = mPathLength.GetAnimValue();
+    if (pathLength <= 0) {
+      return NS_ERROR_FAILURE;
+    }
+    distance *= totalLength / pathLength;
+  }
+  distance = NS_MAX(0.f,         distance);
+  distance = NS_MIN(totalLength, distance);
+
+  NS_ADDREF(*_retval = new DOMSVGPoint(flat->FindPoint(gfxPoint(distance, 0))));
+  return NS_OK;
+}
+
+/* unsigned long getPathSegAtLength (in float distance); */
+NS_IMETHODIMP
+nsSVGPathElement::GetPathSegAtLength(float distance, uint32_t *_retval)
+{
+  NS_ENSURE_FINITE(distance, NS_ERROR_ILLEGAL_VALUE);
+  *_retval = mD.GetAnimValue().GetPathSegAtLength(distance);
+  return NS_OK;
+}
+
+/* nsISupports createSVGPathSegClosePath (); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegClosePath(nsISupports **_retval)
+{
+  nsISupports* seg = NS_NewSVGPathSegClosePath();
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegMovetoAbs (in float x, in float y); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegMovetoAbs(float x, float y, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegMovetoAbs(x, y);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegMovetoRel (in float x, in float y); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegMovetoRel(float x, float y, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegMovetoRel(x, y);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegLinetoAbs (in float x, in float y); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegLinetoAbs(float x, float y, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegLinetoAbs(x, y);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegLinetoRel (in float x, in float y); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegLinetoRel(float x, float y, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegLinetoRel(x, y);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegCurvetoCubicAbs (in float x, in float y, in float x1, in float y1, in float x2, in float y2); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE6(x, y, x1, y1, x2, y2, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegCurvetoCubicRel (in float x, in float y, in float x1, in float y1, in float x2, in float y2); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE6(x, y, x1, y1, x2, y2, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegCurvetoQuadraticAbs (in float x, in float y, in float x1, in float y1); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE4(x, y, x1, y1, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegCurvetoQuadraticRel (in float x, in float y, in float x1, in float y1); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE4(x, y, x1, y1, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegArcAbs (in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE5(x, y, r1, r2, angle, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegArcAbs(x, y, r1, r2, angle,
+                                                 largeArcFlag, sweepFlag);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegArcRel (in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE5(x, y, r1, r2, angle, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegArcRel(x, y, r1, r2, angle,
+                                                 largeArcFlag, sweepFlag);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegLinetoHorizontalAbs (in float x); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegLinetoHorizontalAbs(float x, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE(x, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegLinetoHorizontalAbs(x);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegLinetoHorizontalRel (in float x); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegLinetoHorizontalRel(float x, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE(x, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegLinetoHorizontalRel(x);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegLinetoVerticalAbs (in float y); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegLinetoVerticalAbs(float y, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE(y, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegLinetoVerticalAbs(y);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegLinetoVerticalRel (in float y); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegLinetoVerticalRel(float y, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE(y, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegLinetoVerticalRel(y);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegCurvetoCubicSmoothAbs (in float x, in float y, in float x2, in float y2); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE4(x, y, x2, y2, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegCurvetoCubicSmoothRel (in float x, in float y, in float x2, in float y2); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE4(x, y, x2, y2, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegCurvetoQuadraticSmoothAbs (in float x, in float y); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+/* nsISupports createSVGPathSegCurvetoQuadraticSmoothRel (in float x, in float y); */
+NS_IMETHODIMP
+nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, nsISupports **_retval)
+{
+  NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
+  nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticSmoothRel(x, y);
+  NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
+  return CallQueryInterface(seg, _retval);
+}
+
+//----------------------------------------------------------------------
+// nsSVGElement methods
+
+/* virtual */ bool
+nsSVGPathElement::HasValidDimensions() const
+{
+  return !mD.GetAnimValue().IsEmpty();
+}
+
+nsSVGElement::NumberAttributesInfo
+nsSVGPathElement::GetNumberInfo()
+{
+  return NumberAttributesInfo(&mPathLength, &sNumberInfo, 1);
+}
+
+//----------------------------------------------------------------------
+// nsIDOMSVGAnimatedPathData methods:
+
+/* readonly attribute DOMSVGPathSegList pathSegList; */
+NS_IMETHODIMP nsSVGPathElement::GetPathSegList(nsISupports * *aPathSegList)
+{
+  void *key = mD.GetBaseValKey();
+  *aPathSegList = DOMSVGPathSegList::GetDOMWrapper(key, this, false).get();
+  return *aPathSegList ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
+}
+
+/* readonly attribute DOMSVGPathSegList animatedPathSegList; */
+NS_IMETHODIMP nsSVGPathElement::GetAnimatedPathSegList(nsISupports * *aAnimatedPathSegList)
+{
+  void *key = mD.GetAnimValKey();
+  *aAnimatedPathSegList =
+    DOMSVGPathSegList::GetDOMWrapper(key, this, true).get();
+  return *aAnimatedPathSegList ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
+}
+
+//----------------------------------------------------------------------
+// nsIContent methods
+
+NS_IMETHODIMP_(bool)
+nsSVGPathElement::IsAttributeMapped(const nsIAtom* name) const
+{
+  static const MappedAttributeEntry* const map[] = {
+    sMarkersMap
+  };
+
+  return FindAttributeDependence(name, map) ||
+    nsSVGPathElementBase::IsAttributeMapped(name);
+}
+
+already_AddRefed<gfxFlattenedPath>
+nsSVGPathElement::GetFlattenedPath(const gfxMatrix &aMatrix)
+{
+  return mD.GetAnimValue().ToFlattenedPath(aMatrix);
+}
+
+//----------------------------------------------------------------------
+// nsSVGPathGeometryElement methods
+
+bool
+nsSVGPathElement::AttributeDefinesGeometry(const nsIAtom *aName)
+{
+  return aName == nsGkAtoms::d ||
+         aName == nsGkAtoms::pathLength;
+}
+
+bool
+nsSVGPathElement::IsMarkable()
+{
+  return true;
+}
+
+void
+nsSVGPathElement::GetMarkPoints(nsTArray<nsSVGMark> *aMarks)
+{
+  mD.GetAnimValue().GetMarkerPositioningData(aMarks);
+}
+
+void
+nsSVGPathElement::ConstructPath(gfxContext *aCtx)
+{
+  mD.GetAnimValue().ConstructPath(aCtx);
+}
+
+gfxFloat
+nsSVGPathElement::GetPathLengthScale(PathLengthScaleForType aFor)
+{
+  NS_ABORT_IF_FALSE(aFor == eForTextPath || aFor == eForStroking,
+                    "Unknown enum");
+  if (mPathLength.IsExplicitlySet()) {
+    float authorsPathLengthEstimate = mPathLength.GetAnimValue();
+    if (authorsPathLengthEstimate > 0) {
+      gfxMatrix matrix;
+      if (aFor == eForTextPath) {
+        // For textPath, a transform on the referenced path affects the
+        // textPath layout, so when calculating the actual path length
+        // we need to take that into account.
+        matrix = PrependLocalTransformsTo(matrix);
+      }
+      nsRefPtr<gfxFlattenedPath> path = GetFlattenedPath(matrix);
+      if (path) {
+        return path->GetLength() / authorsPathLengthEstimate;
+      }
+    }
+  }
+  return 1.0;
+}
new file mode 100644
--- /dev/null
+++ b/content/svg/content/src/nsSVGPathElement.h
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef __NS_SVGPATHELEMENT_H__
+#define __NS_SVGPATHELEMENT_H__
+
+#include "nsIDOMSVGAnimatedPathData.h"
+#include "nsIDOMSVGPathElement.h"
+#include "nsSVGNumber2.h"
+#include "nsSVGPathGeometryElement.h"
+#include "SVGAnimatedPathSegList.h"
+
+class gfxContext;
+
+typedef nsSVGPathGeometryElement nsSVGPathElementBase;
+
+class nsSVGPathElement : public nsSVGPathElementBase,
+                         public nsIDOMSVGPathElement,
+                         public nsIDOMSVGAnimatedPathData
+{
+friend class nsSVGPathFrame;
+
+protected:
+  friend nsresult NS_NewSVGPathElement(nsIContent **aResult,
+                                       already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGPathElement(already_AddRefed<nsINodeInfo> aNodeInfo);
+
+public:
+  typedef mozilla::SVGAnimatedPathSegList SVGAnimatedPathSegList;
+  // interfaces:
+
+  NS_DECL_ISUPPORTS_INHERITED
+  NS_DECL_NSIDOMSVGPATHELEMENT
+  NS_DECL_NSIDOMSVGANIMATEDPATHDATA
+
+  // xxx I wish we could use virtual inheritance
+  NS_FORWARD_NSIDOMNODE_TO_NSINODE
+  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
+  NS_FORWARD_NSIDOMSVGELEMENT(nsSVGPathElementBase::)
+
+  // nsIContent interface
+  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* name) const;
+
+  // nsSVGSVGElement methods:
+  virtual bool HasValidDimensions() const;
+
+  // nsSVGPathGeometryElement methods:
+  virtual bool AttributeDefinesGeometry(const nsIAtom *aName);
+  virtual bool IsMarkable();
+  virtual void GetMarkPoints(nsTArray<nsSVGMark> *aMarks);
+  virtual void ConstructPath(gfxContext *aCtx);
+
+  virtual already_AddRefed<gfxFlattenedPath> GetFlattenedPath(const gfxMatrix &aMatrix);
+
+  // nsIContent interface
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
+
+  virtual nsXPCClassInfo* GetClassInfo();
+
+  virtual nsIDOMNode* AsDOMNode() { return this; }
+
+  virtual SVGAnimatedPathSegList* GetAnimPathSegList() {
+    return &mD;
+  }
+
+  virtual nsIAtom* GetPathDataAttrName() const {
+    return nsGkAtoms::d;
+  }
+
+  enum PathLengthScaleForType {
+    eForTextPath,
+    eForStroking
+  };
+
+  /**
+   * 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.
+   */
+  gfxFloat GetPathLengthScale(PathLengthScaleForType aFor);
+
+protected:
+
+  // nsSVGElement method
+  virtual NumberAttributesInfo GetNumberInfo();
+
+  SVGAnimatedPathSegList mD;
+  nsSVGNumber2 mPathLength;
+  static NumberInfo sNumberInfo;
+};
+
+#endif
--- a/content/svg/content/src/nsSVGPolyElement.cpp
+++ b/content/svg/content/src/nsSVGPolyElement.cpp
@@ -14,35 +14,55 @@ using namespace mozilla;
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ADDREF_INHERITED(nsSVGPolyElement,nsSVGPolyElementBase)
 NS_IMPL_RELEASE_INHERITED(nsSVGPolyElement,nsSVGPolyElementBase)
 
 NS_INTERFACE_MAP_BEGIN(nsSVGPolyElement)
+  NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedPoints)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGPolyElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
 nsSVGPolyElement::nsSVGPolyElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGPolyElementBase(aNodeInfo)
 {
   SetIsDOMBinding();
 }
 
+//----------------------------------------------------------------------
+// nsIDOMSGAnimatedPoints methods:
+
+/* readonly attribute DOMSVGPointList points; */
+NS_IMETHODIMP
+nsSVGPolyElement::GetPoints(nsISupports * *aPoints)
+{
+  *aPoints = Points().get();
+  return NS_OK;
+}
+
 already_AddRefed<DOMSVGPointList>
 nsSVGPolyElement::Points()
 {
   void *key = mPoints.GetBaseValKey();
   nsRefPtr<DOMSVGPointList> points = DOMSVGPointList::GetDOMWrapper(key, this, false);
   return points.forget();
 }
 
+/* readonly attribute DOMSVGPointList animatedPoints; */
+NS_IMETHODIMP
+nsSVGPolyElement::GetAnimatedPoints(nsISupports * *aAnimatedPoints)
+{
+  *aAnimatedPoints = AnimatedPoints().get();
+  return NS_OK;
+}
+
 already_AddRefed<DOMSVGPointList>
 nsSVGPolyElement::AnimatedPoints()
 {
   void *key = mPoints.GetAnimValKey();
   nsRefPtr<DOMSVGPointList> points = DOMSVGPointList::GetDOMWrapper(key, this, true);
   return points.forget();
 }
 
--- a/content/svg/content/src/nsSVGPolyElement.h
+++ b/content/svg/content/src/nsSVGPolyElement.h
@@ -1,36 +1,39 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_SVGPOLYELEMENT_H_
 #define NS_SVGPOLYELEMENT_H_
 
+#include "nsIDOMSVGAnimatedPoints.h"
 #include "nsSVGPathGeometryElement.h"
 #include "SVGAnimatedPointList.h"
 
 typedef nsSVGPathGeometryElement nsSVGPolyElementBase;
 
 class gfxContext;
 
 namespace mozilla {
 class DOMSVGPointList;
 }
 
-class nsSVGPolyElement : public nsSVGPolyElementBase
+class nsSVGPolyElement : public nsSVGPolyElementBase,
+                         public nsIDOMSVGAnimatedPoints
 {
 protected:
   nsSVGPolyElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
 public:
   //interfaces
-
+  
   NS_DECL_ISUPPORTS_INHERITED
+  NS_DECL_NSIDOMSVGANIMATEDPOINTS
 
   // nsIContent interface
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* name) const;
 
   virtual SVGAnimatedPointList* GetAnimatedPointList() {
     return &mPoints;
   }
   virtual nsIAtom* GetPointListAttrName() const {
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -312,16 +312,17 @@
 #include "nsIDOMGetSVGDocument.h"
 #include "nsIDOMSVGAElement.h"
 #include "nsIDOMSVGAltGlyphElement.h"
 #include "nsIDOMSVGAnimatedEnum.h"
 #include "nsIDOMSVGAnimatedInteger.h"
 #include "nsIDOMSVGAnimatedLength.h"
 #include "nsIDOMSVGAnimatedNumber.h"
 #include "nsIDOMSVGAnimatedPathData.h"
+#include "nsIDOMSVGAnimatedPoints.h"
 #include "nsIDOMSVGAnimatedRect.h"
 #include "nsIDOMSVGAnimatedString.h"
 #include "nsIDOMSVGAnimateElement.h"
 #include "nsIDOMSVGAnimateTransformElement.h"
 #include "nsIDOMSVGAnimateMotionElement.h"
 #include "nsIDOMSVGMpathElement.h"
 #include "nsIDOMSVGSetElement.h"
 #include "nsIDOMSVGAnimationElement.h"
@@ -3315,21 +3316,23 @@ nsDOMClassInfo::Init()
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes)
     DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGPolygonElement, nsIDOMSVGPolygonElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPolygonElement)
+    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedPoints)
     DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGPolylineElement, nsIDOMSVGPolylineElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPolylineElement)
+    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedPoints)
     DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGRadialGradientElement, nsIDOMSVGRadialGradientElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGGradientElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGRadialGradientElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes)
--- a/dom/interfaces/svg/Makefile.in
+++ b/dom/interfaces/svg/Makefile.in
@@ -19,16 +19,17 @@ XPIDLSRCS	= \
 		nsIDOMGetSVGDocument.idl \
 		nsIDOMSVGAElement.idl \
 		nsIDOMSVGAltGlyphElement.idl \
 		nsIDOMSVGAnimatedEnum.idl \
 		nsIDOMSVGAnimatedInteger.idl \
 		nsIDOMSVGAnimatedLength.idl \
 		nsIDOMSVGAnimatedNumber.idl \
 		nsIDOMSVGAnimatedPathData.idl \
+		nsIDOMSVGAnimatedPoints.idl \
 		nsIDOMSVGAnimatedRect.idl \
 		nsIDOMSVGAnimatedString.idl \
 		nsIDOMSVGAnimateElement.idl \
 		nsIDOMSVGAnimateMotionElement.idl \
 		nsIDOMSVGAnimateTransformElement.idl \
 		nsIDOMSVGAnimationElement.idl \
 		nsIDOMSVGCircleElement.idl \
 		nsIDOMSVGClipPathElement.idl \
new file mode 100644
--- /dev/null
+++ b/dom/interfaces/svg/nsIDOMSVGAnimatedPoints.idl
@@ -0,0 +1,14 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+
+#include "domstubs.idl"
+
+[scriptable, uuid(ebf334b3-86ef-4bf3-8a92-d775c72defa4)]
+interface nsIDOMSVGAnimatedPoints : nsISupports
+{
+  readonly attribute nsISupports points;
+  readonly attribute nsISupports animatedPoints;
+};
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -32,17 +32,16 @@
 #include "nsEventListenerManager.h"
 #ifdef MOZ_CRASHREPORTER
 #include "nsExceptionHandler.h"
 #endif
 #include "mozilla/dom/Element.h"
 #include "nsIAppsService.h"
 #include "nsIBaseWindow.h"
 #include "nsIComponentManager.h"
-#include "nsIDocumentInlines.h"
 #include "nsIDOMClassInfo.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIInterfaceRequestorUtils.h"
@@ -423,27 +422,27 @@ TabChild::HandlePossibleViewportChange()
   // 771575).
   if (!mContentDocumentIsDisplayed) {
     return;
   }
 
   float minScale = 1.0f;
 
   nsCOMPtr<nsIDOMElement> htmlDOMElement = do_QueryInterface(document->GetHtmlElement());
-  HTMLBodyElement* bodyDOMElement = document->GetBodyElement();
+  nsCOMPtr<nsIDOMElement> bodyDOMElement = do_QueryInterface(document->GetBodyElement());
 
   int32_t htmlWidth = 0, htmlHeight = 0;
   if (htmlDOMElement) {
     htmlDOMElement->GetScrollWidth(&htmlWidth);
     htmlDOMElement->GetScrollHeight(&htmlHeight);
   }
   int32_t bodyWidth = 0, bodyHeight = 0;
   if (bodyDOMElement) {
-    bodyWidth = bodyDOMElement->ScrollWidth();
-    bodyHeight = bodyDOMElement->ScrollHeight();
+    bodyDOMElement->GetScrollWidth(&bodyWidth);
+    bodyDOMElement->GetScrollHeight(&bodyHeight);
   }
 
   float pageWidth, pageHeight;
   if (htmlDOMElement || bodyDOMElement) {
     pageWidth = NS_MAX(htmlWidth, bodyWidth);
     pageHeight = NS_MAX(htmlHeight, bodyHeight);
   } else {
     // For non-HTML content (e.g. SVG), just assume page size == viewport size.
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -64,17 +64,16 @@
 #include "nsWSRunObject.h"
 #include "nsGkAtoms.h"
 #include "nsIWidget.h"
 
 #include "nsIFrame.h"
 #include "nsIParserService.h"
 #include "mozilla/Selection.h"
 #include "mozilla/dom/Element.h"
-#include "mozilla/dom/HTMLBodyElement.h"
 #include "nsTextFragment.h"
 
 using namespace mozilla;
 using namespace mozilla::widget;
 
 // Some utilities to handle annoying overloading of "A" tag for link and named anchor
 static char hrefText[] = "href";
 static char anchorTxt[] = "anchor";
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -22,17 +22,17 @@
 #include "nsViewManager.h"
 #include "nsIPresShell.h"
 #include "nsFrameManager.h"
 #include "nsStyleContext.h"
 #include "nsGkAtoms.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsTransform2D.h"
 #include "nsIContent.h"
-#include "nsIDocumentInlines.h"
+#include "nsIDocument.h"
 #include "nsIScrollableFrame.h"
 #include "imgIRequest.h"
 #include "imgIContainer.h"
 #include "nsCSSRendering.h"
 #include "nsCSSColorUtils.h"
 #include "nsITheme.h"
 #include "nsThemeConstants.h"
 #include "nsIServiceManager.h"
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -6023,18 +6023,19 @@ static void ComputeVisualOverflowArea(ns
   aResult.width = xb - xa;
   aResult.height = yb - ya;
 }
 #endif
 
 bool
 nsBlockFrame::IsVisibleInSelection(nsISelection* aSelection)
 {
-  if (mContent->IsHTML() && (mContent->Tag() == nsGkAtoms::html ||
-                             mContent->Tag() == nsGkAtoms::body))
+  nsCOMPtr<nsIDOMHTMLHtmlElement> html(do_QueryInterface(mContent));
+  nsCOMPtr<nsIDOMHTMLBodyElement> body(do_QueryInterface(mContent));
+  if (html || body)
     return true;
 
   nsCOMPtr<nsIDOMNode> node(do_QueryInterface(mContent));
   bool visible;
   nsresult rv = aSelection->ContainsNode(node, true, &visible);
   return NS_SUCCEEDED(rv) && visible;
 }
 
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -12,17 +12,17 @@
 #include "nsView.h"
 #include "nsIScrollable.h"
 #include "nsViewManager.h"
 #include "nsContainerFrame.h"
 #include "nsGfxScrollFrame.h"
 #include "nsGkAtoms.h"
 #include "nsINameSpaceManager.h"
 #include "nsContentList.h"
-#include "nsIDocumentInlines.h"
+#include "nsIDocument.h"
 #include "nsFontMetrics.h"
 #include "nsIDocumentObserver.h"
 #include "nsBoxLayoutState.h"
 #include "nsINodeInfo.h"
 #include "nsScrollbarFrame.h"
 #include "nsIScrollbarMediator.h"
 #include "nsITextControlFrame.h"
 #include "nsIDOMHTMLTextAreaElement.h"
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -9,17 +9,17 @@
  * potentially re-creating) style contexts
  */
 
 #include "mozilla/Util.h"
 
 #include "nsStyleSet.h"
 #include "nsNetUtil.h"
 #include "nsCSSStyleSheet.h"
-#include "nsIDocumentInlines.h"
+#include "nsIDocument.h"
 #include "nsRuleWalker.h"
 #include "nsStyleContext.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCSSRuleProcessor.h"
 #include "nsDataHashtable.h"
 #include "nsIContent.h"
--- a/layout/svg/nsSVGGeometryFrame.cpp
+++ b/layout/svg/nsSVGGeometryFrame.cpp
@@ -7,16 +7,17 @@
 #include "nsSVGGeometryFrame.h"
 
 // Keep others in (case-insensitive) order:
 #include "gfxContext.h"
 #include "gfxSVGGlyphs.h"
 #include "nsPresContext.h"
 #include "nsSVGEffects.h"
 #include "nsSVGPaintServerFrame.h"
+#include "nsSVGPathElement.h"
 #include "nsSVGUtils.h"
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSVGGeometryFrame)
 
 //----------------------------------------------------------------------
 // nsIFrame methods
 
 NS_IMETHODIMP
--- a/layout/svg/nsSVGTextFrame.cpp
+++ b/layout/svg/nsSVGTextFrame.cpp
@@ -7,16 +7,17 @@
 #include "nsSVGTextFrame.h"
 
 // Keep others in (case-insensitive) order:
 #include "nsGkAtoms.h"
 #include "nsIDOMSVGRect.h"
 #include "nsISVGGlyphFragmentNode.h"
 #include "nsSVGGlyphFrame.h"
 #include "nsSVGIntegrationUtils.h"
+#include "nsSVGPathElement.h"
 #include "nsSVGTextPathFrame.h"
 #include "nsSVGUtils.h"
 #include "SVGGraphicsElement.h"
 #include "SVGLengthList.h"
 
 using namespace mozilla;
 
 //----------------------------------------------------------------------
--- a/layout/svg/nsSVGTextPathFrame.cpp
+++ b/layout/svg/nsSVGTextPathFrame.cpp
@@ -5,17 +5,17 @@
 
 // Main header first:
 #include "nsSVGTextPathFrame.h"
 
 // Keep others in (case-insensitive) order:
 #include "nsContentUtils.h"
 #include "nsSVGEffects.h"
 #include "nsSVGLength2.h"
-#include "mozilla/dom/SVGPathElement.h"
+#include "nsSVGPathElement.h"
 #include "mozilla/dom/SVGTextPathElement.h"
 #include "SVGLengthList.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 // Implementation
@@ -139,18 +139,18 @@ nsSVGTextPathFrame::GetStartOffset()
 
 gfxFloat
 nsSVGTextPathFrame::GetOffsetScale()
 {
   nsIFrame *pathFrame = GetPathFrame();
   if (!pathFrame)
     return 1.0;
 
-  return static_cast<SVGPathElement*>(pathFrame->GetContent())->
-    GetPathLengthScale(SVGPathElement::eForTextPath);
+  return static_cast<nsSVGPathElement*>(pathFrame->GetContent())->
+    GetPathLengthScale(nsSVGPathElement::eForTextPath);
 }
 
 //----------------------------------------------------------------------
 // nsIFrame methods
 
 NS_IMETHODIMP
 nsSVGTextPathFrame::AttributeChanged(int32_t         aNameSpaceID,
                                      nsIAtom*        aAttribute,
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -39,17 +39,17 @@
 #include "nsSVGForeignObjectFrame.h"
 #include "nsSVGGeometryFrame.h"
 #include "nsSVGGlyphFrame.h"
 #include "nsSVGInnerSVGFrame.h"
 #include "nsSVGIntegrationUtils.h"
 #include "nsSVGLength2.h"
 #include "nsSVGMaskFrame.h"
 #include "nsSVGOuterSVGFrame.h"
-#include "mozilla/dom/SVGPathElement.h"
+#include "nsSVGPathElement.h"
 #include "nsSVGPathGeometryElement.h"
 #include "nsSVGPathGeometryFrame.h"
 #include "nsSVGPaintServerFrame.h"
 #include "mozilla/dom/SVGSVGElement.h"
 #include "nsSVGTextContainerFrame.h"
 #include "nsTextFrame.h"
 #include "SVGContentUtils.h"
 #include "mozilla/unused.h"
@@ -1728,18 +1728,18 @@ GetStrokeDashData(nsIFrame* aFrame,
     uint32_t count = style->mStrokeDasharrayLength;
     if (!count || !aDashes.SetLength(count)) {
       return false;
     }
 
     gfxFloat pathScale = 1.0;
 
     if (content->Tag() == nsGkAtoms::path) {
-      pathScale = static_cast<SVGPathElement*>(content)->
-        GetPathLengthScale(SVGPathElement::eForStroking);
+      pathScale = static_cast<nsSVGPathElement*>(content)->
+        GetPathLengthScale(nsSVGPathElement::eForStroking);
       if (pathScale <= 0) {
         return false;
       }
     }
 
     const nsStyleCoord *dasharray = style->mStrokeDasharray;
 
     for (uint32_t i = 0; i < count; i++) {
--- a/widget/tests/TestWinTSF.cpp
+++ b/widget/tests/TestWinTSF.cpp
@@ -54,17 +54,17 @@ template<class T> class nsReadingIterato
 #include "nsIWidget.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "nsIFrame.h"
 #include "nsIWebProgress.h"
 #include "nsIWebProgressListener.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIDOMHTMLDocument.h"
-#include "mozilla/dom/HTMLBodyElement.h"
+#include "nsIDOMHTMLBodyElement.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIDOMElement.h"
 #include "nsISelectionController.h"
 #include "nsViewManager.h"
 #include "nsTArray.h"
 #include "nsGUIEvent.h"
@@ -1570,17 +1570,17 @@ TestApp::Init(void)
   NS_ENSURE_SUCCESS(rv, rv);
   rv = form->AppendChild(mButton, getter_AddRefs(node));
   NS_ENSURE_SUCCESS(rv, rv);
   rv = htmlBody->AppendChild(form, getter_AddRefs(node));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // set a background color manually,
   // otherwise the window might be transparent
-  static_cast<HTMLBodyElement*>(htmlBody)->
+  nsCOMPtr<nsIDOMHTMLBodyElement>(do_QueryInterface(htmlBody))->
       SetBgColor(NS_LITERAL_STRING("white"));
 
   widget->Show(true);
   widget->SetFocus();
   return NS_OK;
 }
 
 nsresult