From 8b3428ca1a90914ef286a2b6d7d4defaf338236f Mon Sep 17 00:00:00 2001 From: "tor%cs.brown.edu" Date: Tue, 27 Jun 2006 22:54:31 +0000 Subject: [PATCH] Bug 342542 - Repair textPath from bug 342200. r=longsonr, sr=roc --- content/base/src/nsGkAtomList.h | 7 ------- content/svg/content/src/nsSVGPathElement.h | 2 +- content/svg/content/src/nsSVGPathGeometryElement.cpp | 6 ++++++ content/svg/content/src/nsSVGPathGeometryElement.h | 3 +++ layout/svg/base/src/nsSVGTextPathFrame.cpp | 8 ++++---- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index a54b7e3dafc0..261d2c1c3740 100755 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -1312,10 +1312,8 @@ GK_ATOM(textInputFrame,"TextInputFrame") GK_ATOM(textFrame, "TextFrame") GK_ATOM(viewportFrame, "ViewportFrame") #ifdef MOZ_SVG -GK_ATOM(svgCircleFrame, "SVGCircleFrame") GK_ATOM(svgClipPathFrame, "SVGClipPathFrame") GK_ATOM(svgDefsFrame, "SVGDefsFrame") -GK_ATOM(svgEllipseFrame, "SVGEllipseFrame") GK_ATOM(svgFilterFrame, "SVGFilterFrame") #ifdef MOZ_SVG_FOREIGNOBJECT GK_ATOM(svgForeignObjectFrame, "SVGForeignObjectFrame") @@ -1327,17 +1325,12 @@ GK_ATOM(svgGradientFrame, "SVGGradientFrame") GK_ATOM(svgImageFrame, "SVGImageFrame") GK_ATOM(svgInnerSVGFrame, "SVGInnerSVGFrame") GK_ATOM(svgLinearGradientFrame, "SVGLinearGradientFrame") -GK_ATOM(svgLineFrame, "SVGLineFrame") GK_ATOM(svgMarkerFrame, "SVGMarkerFrame") GK_ATOM(svgMaskFrame, "SVGMaskFrame") GK_ATOM(svgOuterSVGFrame, "SVGOuterSVGFrame") -GK_ATOM(svgPathFrame, "SVGPathFrame") GK_ATOM(svgPathGeometryFrame, "SVGPathGeometryFrame") GK_ATOM(svgPatternFrame, "SVGPatternFrame") -GK_ATOM(svgPolygonFrame, "SVGPolygonFrame") -GK_ATOM(svgPolylineFrame, "SVGPolylineFrame") GK_ATOM(svgRadialGradientFrame, "SVGRadialGradientFrame") -GK_ATOM(svgRectFrame, "SVGRectFrame") GK_ATOM(svgStopFrame, "SVGStopFrame") GK_ATOM(svgTextFrame, "SVGTextFrame") GK_ATOM(svgTextPathFrame, "SVGTextPathFrame") diff --git a/content/svg/content/src/nsSVGPathElement.h b/content/svg/content/src/nsSVGPathElement.h index 40801840bafc..ccd6a1ac1a11 100644 --- a/content/svg/content/src/nsSVGPathElement.h +++ b/content/svg/content/src/nsSVGPathElement.h @@ -119,7 +119,7 @@ public: virtual void GetMarkPoints(nsTArray *aMarks); virtual void ConstructPath(cairo_t *aCtx); - nsSVGFlattenedPath *GetFlattenedPath(); + virtual nsSVGFlattenedPath *GetFlattenedPath(); protected: diff --git a/content/svg/content/src/nsSVGPathGeometryElement.cpp b/content/svg/content/src/nsSVGPathGeometryElement.cpp index bcdde97e6a08..cc7372597876 100644 --- a/content/svg/content/src/nsSVGPathGeometryElement.cpp +++ b/content/svg/content/src/nsSVGPathGeometryElement.cpp @@ -65,3 +65,9 @@ void nsSVGPathGeometryElement::GetMarkPoints(nsTArray *aMarks) { } + +nsSVGFlattenedPath * +nsSVGPathGeometryElement::GetFlattenedPath() +{ + return nsnull; +} diff --git a/content/svg/content/src/nsSVGPathGeometryElement.h b/content/svg/content/src/nsSVGPathGeometryElement.h index 571302cec20a..e92a45dbeb91 100644 --- a/content/svg/content/src/nsSVGPathGeometryElement.h +++ b/content/svg/content/src/nsSVGPathGeometryElement.h @@ -47,6 +47,8 @@ struct nsSVGMark { x(aX), y(aY), angle(aAngle) {} }; +class nsSVGFlattenedPath; + typedef nsSVGGraphicElement nsSVGPathGeometryElementBase; class nsSVGPathGeometryElement : public nsSVGPathGeometryElementBase @@ -58,6 +60,7 @@ public: virtual PRBool IsMarkable(); virtual void GetMarkPoints(nsTArray *aMarks); virtual void ConstructPath(cairo_t *aCtx) = 0; + virtual nsSVGFlattenedPath *GetFlattenedPath(); }; #endif diff --git a/layout/svg/base/src/nsSVGTextPathFrame.cpp b/layout/svg/base/src/nsSVGTextPathFrame.cpp index 7f751a949b44..0700752ff995 100644 --- a/layout/svg/base/src/nsSVGTextPathFrame.cpp +++ b/layout/svg/base/src/nsSVGTextPathFrame.cpp @@ -178,7 +178,7 @@ nsSVGTextPathFrame::GetFlattenedPath() { nsSVGUtils::GetReferencedFrame(&path, targetURI, mContent, GetPresContext()->PresShell()); - if (!path || (path->GetType() != nsGkAtoms::svgPathFrame)) + if (!path || (path->GetType() != nsGkAtoms::svgPathGeometryFrame)) return nsnull; if (!mSegments) { @@ -190,10 +190,10 @@ nsSVGTextPathFrame::GetFlattenedPath() { } } - nsSVGPathElement *pathElement = NS_STATIC_CAST(nsSVGPathElement*, - path->GetContent()); + nsSVGPathGeometryElement *element = NS_STATIC_CAST(nsSVGPathGeometryElement*, + path->GetContent()); - return pathElement->GetFlattenedPath(); + return element->GetFlattenedPath(); } //----------------------------------------------------------------------