Bug 956311 - Remove nsSVGGeometryFrame. r=dholbert
authorRobert Longson <longsonr@gmail.com>
Sat, 04 Jan 2014 08:29:02 +0000
changeset 178168 eca13ded05d798cf4f4f1941ba41b389e7e21aee
parent 178167 d79dc7a1e94bcc1956c7bc84e0cea2b6a36bc6d2
child 178169 e8ba8d0373659069182487c46a97d2c76d616976
push idunknown
push userunknown
push dateunknown
reviewersdholbert
bugs956311
milestone29.0a1
Bug 956311 - Remove nsSVGGeometryFrame. r=dholbert
layout/generic/nsFrameIdList.h
layout/svg/moz.build
layout/svg/nsSVGGeometryFrame.cpp
layout/svg/nsSVGGeometryFrame.h
layout/svg/nsSVGImageFrame.cpp
layout/svg/nsSVGPaintServerFrame.cpp
layout/svg/nsSVGPaintServerFrame.h
layout/svg/nsSVGPathGeometryFrame.cpp
layout/svg/nsSVGPathGeometryFrame.h
layout/svg/nsSVGPatternFrame.cpp
layout/svg/nsSVGPatternFrame.h
layout/svg/nsSVGUtils.cpp
--- a/layout/generic/nsFrameIdList.h
+++ b/layout/generic/nsFrameIdList.h
@@ -129,17 +129,16 @@ FRAME_ID(nsSVGContainerFrame)
 FRAME_ID(nsSVGDisplayContainerFrame)
 FRAME_ID(SVGFEContainerFrame)
 FRAME_ID(SVGFEImageFrame)
 FRAME_ID(SVGFELeafFrame)
 FRAME_ID(SVGFEUnstyledLeafFrame)
 FRAME_ID(nsSVGFilterFrame)
 FRAME_ID(nsSVGForeignObjectFrame)
 FRAME_ID(nsSVGGenericContainerFrame)
-FRAME_ID(nsSVGGeometryFrame)
 FRAME_ID(nsSVGGFrame)
 FRAME_ID(nsSVGGradientFrame)
 FRAME_ID(nsSVGImageFrame)
 FRAME_ID(nsSVGInnerSVGFrame)
 FRAME_ID(nsSVGLinearGradientFrame)
 FRAME_ID(nsSVGMarkerFrame)
 FRAME_ID(nsSVGMarkerAnonChildFrame)
 FRAME_ID(nsSVGMaskFrame)
--- a/layout/svg/moz.build
+++ b/layout/svg/moz.build
@@ -17,17 +17,16 @@ UNIFIED_SOURCES += [
     'nsSVGAFrame.cpp',
     'nsSVGClipPathFrame.cpp',
     'nsSVGContainerFrame.cpp',
     'nsSVGEffects.cpp',
     'nsSVGFilterFrame.cpp',
     'nsSVGFilterInstance.cpp',
     'nsSVGForeignObjectFrame.cpp',
     'nsSVGGenericContainerFrame.cpp',
-    'nsSVGGeometryFrame.cpp',
     'nsSVGGFrame.cpp',
     'nsSVGGradientFrame.cpp',
     'nsSVGImageFrame.cpp',
     'nsSVGInnerSVGFrame.cpp',
     'nsSVGIntegrationUtils.cpp',
     'nsSVGMarkerFrame.cpp',
     'nsSVGMaskFrame.cpp',
     'nsSVGOuterSVGFrame.cpp',
deleted file mode 100644
--- a/layout/svg/nsSVGGeometryFrame.cpp
+++ /dev/null
@@ -1,43 +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/. */
-
-// Main header first:
-#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 "nsSVGUtils.h"
-
-NS_IMPL_FRAMEARENA_HELPERS(nsSVGGeometryFrame)
-
-//----------------------------------------------------------------------
-// nsIFrame methods
-
-void
-nsSVGGeometryFrame::Init(nsIContent* aContent,
-                         nsIFrame* aParent,
-                         nsIFrame* aPrevInFlow)
-{
-  AddStateBits(aParent->GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD);
-  nsSVGGeometryFrameBase::Init(aContent, aParent, aPrevInFlow);
-}
-
-//----------------------------------------------------------------------
-
-uint16_t
-nsSVGGeometryFrame::GetClipRule()
-{
-  return StyleSVG()->mClipRule;
-}
-
-uint16_t
-nsSVGGeometryFrame::GetHitTestFlags()
-{
-  return nsSVGUtils::GetGeometryHitTestFlags(this);
-}
deleted file mode 100644
--- a/layout/svg/nsSVGGeometryFrame.h
+++ /dev/null
@@ -1,69 +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 __NS_SVGGEOMETRYFRAME_H__
-#define __NS_SVGGEOMETRYFRAME_H__
-
-#include "mozilla/Attributes.h"
-#include "gfxMatrix.h"
-#include "gfxTypes.h"
-#include "nsFrame.h"
-#include "nsIFrame.h"
-#include "nsQueryFrame.h"
-
-class gfxContext;
-class nsIContent;
-class nsStyleContext;
-class nsSVGPaintServerFrame;
-
-struct nsStyleSVGPaint;
-
-typedef nsFrame nsSVGGeometryFrameBase;
-
-/* nsSVGGeometryFrame is a base class for SVG objects that directly
- * have geometry (circle, ellipse, line, polyline, polygon, path, and
- * glyph frames).  It knows how to convert the style information into
- * cairo context information and stores the fill/stroke paint
- * servers. */
-
-class nsSVGGeometryFrame : public nsSVGGeometryFrameBase
-{
-protected:
-  NS_DECL_FRAMEARENA_HELPERS
-
-  nsSVGGeometryFrame(nsStyleContext *aContext)
-    : nsSVGGeometryFrameBase(aContext)
-  {
-    AddStateBits(NS_FRAME_SVG_LAYOUT);
-  }
-
-public:
-  // nsIFrame interface:
-  virtual void Init(nsIContent* aContent,
-		    nsIFrame* aParent,
-		    nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
-
-  virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
-  {
-    return nsSVGGeometryFrameBase::IsFrameOfType(aFlags & ~(nsIFrame::eSVG | nsIFrame::eSVGGeometry));
-  }
-
-  // nsSVGGeometryFrame methods:
-  virtual gfxMatrix GetCanvasTM(uint32_t aFor,
-                                nsIFrame* aTransformRoot = nullptr) = 0;
-  uint16_t GetClipRule();
-
-protected:
-  /**
-   * This function returns a set of bit flags indicating which parts of the
-   * element (fill, stroke, bounds) should intercept pointer events. It takes
-   * into account the type of element and the value of the 'pointer-events'
-   * property on the element.
-   */
-  virtual uint16_t GetHitTestFlags();
-};
-
-#endif // __NS_SVGGEOMETRYFRAME_H__
--- a/layout/svg/nsSVGImageFrame.cpp
+++ b/layout/svg/nsSVGImageFrame.cpp
@@ -58,17 +58,17 @@ public:
 
   // nsISVGChildFrame interface:
   NS_IMETHOD PaintSVG(nsRenderingContext *aContext, const nsIntRect *aDirtyRect,
                       nsIFrame* aTransformRoot) MOZ_OVERRIDE;
   NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint);
   virtual void ReflowSVG();
 
   // nsSVGPathGeometryFrame methods:
-  virtual uint16_t GetHitTestFlags();
+  virtual uint16_t GetHitTestFlags() MOZ_OVERRIDE;
 
   // nsIFrame interface:
   NS_IMETHOD  AttributeChanged(int32_t         aNameSpaceID,
                                nsIAtom*        aAttribute,
                                int32_t         aModType);
   virtual void Init(nsIContent*      aContent,
                     nsIFrame*        aParent,
                     nsIFrame*        aPrevInFlow) MOZ_OVERRIDE;
--- a/layout/svg/nsSVGPaintServerFrame.cpp
+++ b/layout/svg/nsSVGPaintServerFrame.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Main header first:
 #include "nsSVGPaintServerFrame.h"
 
 // Keep others in (case-insensitive) order:
 #include "gfxContext.h"
 #include "nsSVGElement.h"
-#include "nsSVGGeometryFrame.h"
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSVGPaintServerFrame)
 
 bool
 nsSVGPaintServerFrame::SetupPaintServer(gfxContext *aContext,
                                         nsIFrame *aSource,
                                         nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
                                         float aOpacity)
--- a/layout/svg/nsSVGPaintServerFrame.h
+++ b/layout/svg/nsSVGPaintServerFrame.h
@@ -12,17 +12,16 @@
 #include "nsIFrame.h"
 #include "nsQueryFrame.h"
 #include "nsSVGContainerFrame.h"
 #include "nsSVGUtils.h"
 
 class gfxContext;
 class gfxPattern;
 class nsStyleContext;
-class nsSVGGeometryFrame;
 
 struct gfxRect;
 
 typedef nsSVGContainerFrame nsSVGPaintServerFrameBase;
 
 class nsSVGPaintServerFrame : public nsSVGPaintServerFrameBase
 {
 protected:
--- a/layout/svg/nsSVGPathGeometryFrame.cpp
+++ b/layout/svg/nsSVGPathGeometryFrame.cpp
@@ -97,16 +97,25 @@ nsDisplaySVGPathGeometry::Paint(nsDispla
   aCtx->Translate(offset);
   static_cast<nsSVGPathGeometryFrame*>(mFrame)->PaintSVG(aCtx, nullptr);
   aCtx->PopState();
 }
 
 //----------------------------------------------------------------------
 // nsIFrame methods
 
+void
+nsSVGPathGeometryFrame::Init(nsIContent* aContent,
+                             nsIFrame* aParent,
+                             nsIFrame* aPrevInFlow)
+{
+  AddStateBits(aParent->GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD);
+  nsSVGPathGeometryFrameBase::Init(aContent, aParent, aPrevInFlow);
+}
+
 NS_IMETHODIMP
 nsSVGPathGeometryFrame::AttributeChanged(int32_t         aNameSpaceID,
                                          nsIAtom*        aAttribute,
                                          int32_t         aModType)
 {
   // We don't invalidate for transform changes (the layers code does that).
   // Also note that SVGTransformableElement::GetAttributeChangeHint will
   // return nsChangeHint_UpdateOverflow for "transform" attribute changes
@@ -226,17 +235,17 @@ nsSVGPathGeometryFrame::GetFrameForPoint
 {
   gfxMatrix canvasTM = GetCanvasTM(FOR_HIT_TESTING);
   if (canvasTM.IsSingular()) {
     return nullptr;
   }
   uint16_t fillRule, hitTestFlags;
   if (GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD) {
     hitTestFlags = SVG_HIT_TEST_FILL;
-    fillRule = GetClipRule();
+    fillRule = StyleSVG()->mClipRule;
   } else {
     hitTestFlags = GetHitTestFlags();
     // XXX once bug 614732 is fixed, aPoint won't need any conversion in order
     // to compare it with mRect.
     nsPoint point =
       nsSVGUtils::TransformOuterSVGPointToChildFrame(aPoint, canvasTM, PresContext());
     if (!hitTestFlags || ((hitTestFlags & SVG_HIT_TEST_CHECK_MRECT) &&
                           !mRect.Contains(point)))
@@ -491,17 +500,17 @@ nsSVGPathGeometryFrame::GetBBoxContribut
       }
     }
   }
 
   return bbox;
 }
 
 //----------------------------------------------------------------------
-// nsSVGGeometryFrame methods:
+// nsSVGPathGeometryFrame methods:
 
 gfxMatrix
 nsSVGPathGeometryFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot)
 {
   if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY) && !aTransformRoot) {
     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
@@ -513,19 +522,16 @@ nsSVGPathGeometryFrame::GetCanvasTM(uint
   nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(mParent);
   dom::SVGGraphicsElement *content = static_cast<dom::SVGGraphicsElement*>(mContent);
 
   return content->PrependLocalTransformsTo(
       this == aTransformRoot ? gfxMatrix() :
                                parent->GetCanvasTM(aFor, aTransformRoot));
 }
 
-//----------------------------------------------------------------------
-// nsSVGPathGeometryFrame methods:
-
 nsSVGPathGeometryFrame::MarkerProperties
 nsSVGPathGeometryFrame::GetMarkerProperties(nsSVGPathGeometryFrame *aFrame)
 {
   NS_ASSERTION(!aFrame->GetPrevContinuation(), "aFrame should be first continuation");
 
   MarkerProperties result;
   const nsStyleSVG *style = aFrame->StyleSVG();
   result.mMarkerStart =
@@ -615,17 +621,17 @@ nsSVGPathGeometryFrame::Render(nsRenderi
     // that we set below untouched so that the value is still set when return
     // to gfxContext::Clip() further up the call stack. Since we no longer
     // call gfx->Save() in the SVGAutoRenderState::CLIP case we don't need to
     // worry that autoSaveRestore will delay the Restore() call for the
     // CLIP_MASK case until we exit this function.
 
     gfxContext::FillRule oldFillRull = gfx->CurrentFillRule();
 
-    if (GetClipRule() == NS_STYLE_FILL_RULE_EVENODD)
+    if (StyleSVG()->mClipRule == NS_STYLE_FILL_RULE_EVENODD)
       gfx->SetFillRule(gfxContext::FILL_RULE_EVEN_ODD);
     else
       gfx->SetFillRule(gfxContext::FILL_RULE_WINDING);
 
     if (renderMode == SVGAutoRenderState::CLIP_MASK) {
       gfx->SetColor(gfxRGBA(1.0f, 1.0f, 1.0f, 1.0f));
       gfx->Fill();
       gfx->SetFillRule(oldFillRull); // restore, but only for CLIP_MASK
@@ -709,8 +715,14 @@ nsSVGPathGeometryFrame::PaintMarkers(nsR
           if (frame) {
             frame->PaintMark(aContext, this, &mark, strokeWidth);
           }
         }
       }
     }
   }
 }
+
+uint16_t
+nsSVGPathGeometryFrame::GetHitTestFlags()
+{
+  return nsSVGUtils::GetGeometryHitTestFlags(this);
+}
--- a/layout/svg/nsSVGPathGeometryFrame.h
+++ b/layout/svg/nsSVGPathGeometryFrame.h
@@ -8,56 +8,64 @@
 
 #include "mozilla/Attributes.h"
 #include "gfxMatrix.h"
 #include "gfxRect.h"
 #include "nsFrame.h"
 #include "nsISVGChildFrame.h"
 #include "nsLiteralString.h"
 #include "nsQueryFrame.h"
-#include "nsSVGGeometryFrame.h"
 #include "nsSVGUtils.h"
 
 class gfxContext;
 class nsDisplaySVGPathGeometry;
 class nsIAtom;
 class nsIFrame;
 class nsIPresShell;
 class nsRenderingContext;
 class nsStyleContext;
 class nsSVGMarkerFrame;
 class nsSVGMarkerProperty;
 
 struct nsPoint;
 struct nsRect;
 struct nsIntRect;
 
-typedef nsSVGGeometryFrame nsSVGPathGeometryFrameBase;
+typedef nsFrame nsSVGPathGeometryFrameBase;
 
 class nsSVGPathGeometryFrame : public nsSVGPathGeometryFrameBase,
                                public nsISVGChildFrame
 {
   friend nsIFrame*
   NS_NewSVGPathGeometryFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
   friend class nsDisplaySVGPathGeometry;
 
 protected:
   nsSVGPathGeometryFrame(nsStyleContext* aContext)
     : nsSVGPathGeometryFrameBase(aContext)
   {
-     AddStateBits(NS_FRAME_MAY_BE_TRANSFORMED);
+     AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_MAY_BE_TRANSFORMED);
   }
 
 public:
   NS_DECL_QUERYFRAME_TARGET(nsSVGPathGeometryFrame)
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
   // nsIFrame interface:
+  virtual void Init(nsIContent* aContent,
+                    nsIFrame* aParent,
+                    nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
+
+  virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
+  {
+    return nsSVGPathGeometryFrameBase::IsFrameOfType(aFlags & ~(nsIFrame::eSVG | nsIFrame::eSVGGeometry));
+  }
+
   NS_IMETHOD  AttributeChanged(int32_t         aNameSpaceID,
                                nsIAtom*        aAttribute,
                                int32_t         aModType) MOZ_OVERRIDE;
 
   virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext);
 
   /**
    * Get the "type" of the frame
@@ -75,36 +83,40 @@ public:
     return MakeFrameName(NS_LITERAL_STRING("SVGPathGeometry"), aResult);
   }
 #endif
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
                                 const nsDisplayListSet& aLists) MOZ_OVERRIDE;
 
-  // nsSVGGeometryFrame methods
+  // nsSVGPathGeometryFrame methods
   gfxMatrix GetCanvasTM(uint32_t aFor,
-                        nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
-
+                        nsIFrame* aTransformRoot = nullptr);
 protected:
   // nsISVGChildFrame interface:
   NS_IMETHOD PaintSVG(nsRenderingContext *aContext,
                       const nsIntRect *aDirtyRect,
                       nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
   NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
   NS_IMETHOD_(nsRect) GetCoveredRegion() MOZ_OVERRIDE;
   virtual void ReflowSVG() MOZ_OVERRIDE;
   virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE;
   virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace,
                                       uint32_t aFlags) MOZ_OVERRIDE;
   NS_IMETHOD_(bool) IsDisplayContainer() MOZ_OVERRIDE { return false; }
 
-protected:
   void GeneratePath(gfxContext *aContext, const Matrix &aTransform);
-
+  /**
+   * This function returns a set of bit flags indicating which parts of the
+   * element (fill, stroke, bounds) should intercept pointer events. It takes
+   * into account the type of element and the value of the 'pointer-events'
+   * property on the element.
+   */
+  virtual uint16_t GetHitTestFlags();
 private:
   enum { eRenderFill = 1, eRenderStroke = 2 };
   void Render(nsRenderingContext *aContext, uint32_t aRenderComponents,
               nsIFrame* aTransformRoot);
   void PaintMarkers(nsRenderingContext *aContext);
 
   struct MarkerProperties {
     nsSVGMarkerProperty* mMarkerStart;
--- a/layout/svg/nsSVGPatternFrame.cpp
+++ b/layout/svg/nsSVGPatternFrame.cpp
@@ -14,17 +14,17 @@
 #include "gfxPlatform.h"
 #include "mozilla/gfx/2D.h"
 #include "nsContentUtils.h"
 #include "nsGkAtoms.h"
 #include "nsISVGChildFrame.h"
 #include "nsRenderingContext.h"
 #include "nsStyleContext.h"
 #include "nsSVGEffects.h"
-#include "nsSVGGeometryFrame.h"
+#include "nsSVGPathGeometryFrame.h"
 #include "mozilla/dom/SVGPatternElement.h"
 #include "nsSVGUtils.h"
 #include "nsSVGAnimatedTransformList.h"
 #include "SVGContentUtils.h"
 #include "gfxColor.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
@@ -384,17 +384,17 @@ nsSVGPatternFrame::PaintPattern(gfxASurf
   }
 
   // OK, now render -- note that we use "firstKid", which
   // we got at the beginning because it takes care of the
   // referenced pattern situation for us
 
   if (aSource->IsFrameOfType(nsIFrame::eSVGGeometry)) {
     // Set the geometrical parent of the pattern we are rendering
-    patternFrame->mSource = static_cast<nsSVGGeometryFrame*>(aSource);
+    patternFrame->mSource = static_cast<nsSVGPathGeometryFrame*>(aSource);
   }
 
   // Delay checking NS_FRAME_DRAWING_AS_PAINTSERVER bit until here so we can
   // give back a clear surface if there's a loop
   if (!(patternFrame->GetStateBits() & NS_FRAME_DRAWING_AS_PAINTSERVER)) {
     patternFrame->AddStateBits(NS_FRAME_DRAWING_AS_PAINTSERVER);
     for (nsIFrame* kid = firstKid; kid;
          kid = kid->GetNextSibling()) {
--- a/layout/svg/nsSVGPatternFrame.h
+++ b/layout/svg/nsSVGPatternFrame.h
@@ -11,16 +11,17 @@
 #include "mozilla/gfx/2D.h"
 #include "nsSVGPaintServerFrame.h"
 
 class gfxASurface;
 class gfxContext;
 class nsIFrame;
 class nsSVGElement;
 class nsSVGLength2;
+class nsSVGPathGeometryFrame;
 class nsSVGViewBox;
 
 namespace mozilla {
 class SVGAnimatedPreserveAspectRatio;
 class nsSVGAnimatedTransformList;
 } // namespace mozilla
 
 typedef nsSVGPaintServerFrame  nsSVGPatternFrameBase;
@@ -126,17 +127,17 @@ protected:
                           const gfxRect &callerBBox,
                           const Matrix &callerCTM,
                           nsIFrame *aTarget);
 
 private:
   // this is a *temporary* reference to the frame of the element currently
   // referencing our pattern.  This must be temporary because different
   // referencing frames will all reference this one frame
-  nsSVGGeometryFrame               *mSource;
+  nsSVGPathGeometryFrame           *mSource;
   nsAutoPtr<gfxMatrix>              mCTM;
 
 protected:
   // This flag is used to detect loops in xlink:href processing
   bool                              mLoopFlag;
   bool                              mNoHRefURI;
 };
 
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -33,17 +33,16 @@
 #include "nsStyleCoord.h"
 #include "nsStyleStruct.h"
 #include "nsSVGClipPathFrame.h"
 #include "nsSVGContainerFrame.h"
 #include "nsSVGEffects.h"
 #include "nsSVGFilterFrame.h"
 #include "nsSVGFilterPaintCallback.h"
 #include "nsSVGForeignObjectFrame.h"
-#include "nsSVGGeometryFrame.h"
 #include "gfxSVGGlyphs.h"
 #include "nsSVGInnerSVGFrame.h"
 #include "nsSVGIntegrationUtils.h"
 #include "nsSVGLength2.h"
 #include "nsSVGMaskFrame.h"
 #include "nsSVGOuterSVGFrame.h"
 #include "mozilla/dom/SVGPathElement.h"
 #include "nsSVGPathGeometryElement.h"
@@ -381,17 +380,17 @@ nsSVGUtils::GetCanvasTM(nsIFrame *aFrame
     return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(aFrame);
   }
 
   nsSVGContainerFrame *containerFrame = do_QueryFrame(aFrame);
   if (containerFrame) {
     return containerFrame->GetCanvasTM(aFor, aTransformRoot);
   }
 
-  return static_cast<nsSVGGeometryFrame*>(aFrame)->
+  return static_cast<nsSVGPathGeometryFrame*>(aFrame)->
       GetCanvasTM(aFor, aTransformRoot);
 }
 
 gfxMatrix
 nsSVGUtils::GetUserToCanvasTM(nsIFrame *aFrame, uint32_t aFor)
 {
   NS_ASSERTION(aFor == nsISVGChildFrame::FOR_OUTERSVG_TM,
                "Unexpected aFor?");