Bug 827172: Move SVGPathElement to mozilla::dom r=bz

--HG--
rename : content/svg/content/src/nsSVGPathElement.cpp => content/svg/content/src/SVGPathElement.cpp
rename : content/svg/content/src/nsSVGPathElement.h => content/svg/content/src/SVGPathElement.h
This commit is contained in:
David Zbarsky 2013-01-12 17:22:31 -05:00
parent 5d03b3664d
commit 27fefcce81
12 changed files with 94 additions and 81 deletions

View File

@ -54,7 +54,6 @@ CPPSRCS = \
nsSVGNumber2.cpp \
nsSVGNumberPair.cpp \
nsSVGPathDataParser.cpp \
nsSVGPathElement.cpp \
nsSVGPathGeometryElement.cpp \
nsSVGPatternElement.cpp \
nsSVGPolyElement.cpp \
@ -109,6 +108,7 @@ CPPSRCS = \
SVGNumberPairSMILType.cpp \
SVGOrientSMILType.cpp \
SVGPathData.cpp \
SVGPathElement.cpp \
SVGPathSegUtils.cpp \
SVGPathSegListSMILType.cpp \
SVGPointList.cpp \
@ -176,6 +176,7 @@ EXPORTS_mozilla/dom = \
SVGMatrix.h \
SVGMetadataElement.h \
SVGMPathElement.h \
SVGPathElement.h \
SVGPolygonElement.h \
SVGPolylineElement.h \
SVGRectElement.h \

View File

@ -8,8 +8,8 @@
#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"
@ -203,7 +203,7 @@ SVGMPathElement::AttributeChanged(nsIDocument* aDocument,
//----------------------------------------------------------------------
// Public helper methods
nsSVGPathElement*
SVGPathElement*
SVGMPathElement::GetReferencedPath()
{
if (!HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
@ -215,7 +215,7 @@ SVGMPathElement::GetReferencedPath()
nsIContent* genericTarget = mHrefTarget.get();
if (genericTarget && genericTarget->IsSVG(nsGkAtoms::path)) {
return static_cast<nsSVGPathElement*>(genericTarget);
return static_cast<SVGPathElement*>(genericTarget);
}
return nullptr;
}

View File

@ -10,7 +10,6 @@
#include "nsIDOMSVGURIReference.h"
#include "nsSVGElement.h"
#include "nsStubMutationObserver.h"
#include "nsSVGPathElement.h"
#include "nsSVGString.h"
#include "nsReferencedElement.h"
@ -21,6 +20,7 @@ typedef nsSVGElement SVGMPathElementBase;
namespace mozilla {
namespace dom {
class SVGPathElement;
class SVGMPathElement MOZ_FINAL : public SVGMPathElementBase,
public nsIDOMSVGMpathElement,
@ -69,7 +69,7 @@ public:
// 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.
nsSVGPathElement* GetReferencedPath();
SVGPathElement* GetReferencedPath();
virtual nsXPCClassInfo* GetClassInfo();

View File

@ -10,8 +10,8 @@
#include "SVGMotionSMILType.h"
#include "SVGMotionSMILPathUtils.h"
#include "nsSVGPathDataParser.h"
#include "nsSVGPathElement.h" // for nsSVGPathList
#include "SVGMPathElement.h"
#include "mozilla/dom/SVGPathElement.h" // for nsSVGPathList
#include "mozilla/dom/SVGMPathElement.h"
#include "nsAttrValueInlines.h"
namespace mozilla {
@ -217,7 +217,7 @@ SVGMotionSMILAnimationFunction::
mPathSourceType = ePathSourceType_Mpath;
// Use the path that's the target of our chosen <mpath> child.
nsSVGPathElement* pathElem = aMpathElem->GetReferencedPath();
SVGPathElement* 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

View File

@ -8,8 +8,10 @@
#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 {

View File

@ -10,58 +10,59 @@
#include "DOMSVGPathSegList.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
#include "nsSVGPathElement.h"
#include "mozilla/dom/SVGPathElement.h"
#include "DOMSVGPoint.h"
#include "gfxContext.h"
using namespace mozilla;
DOMCI_NODE_DATA(SVGPathElement, mozilla::dom::SVGPathElement)
nsSVGElement::NumberInfo nsSVGPathElement::sNumberInfo =
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Path)
namespace mozilla {
namespace dom {
nsSVGElement::NumberInfo SVGPathElement::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)
NS_IMPL_ADDREF_INHERITED(SVGPathElement,SVGPathElementBase)
NS_IMPL_RELEASE_INHERITED(SVGPathElement,SVGPathElementBase)
DOMCI_NODE_DATA(SVGPathElement, nsSVGPathElement)
NS_INTERFACE_TABLE_HEAD(nsSVGPathElement)
NS_NODE_INTERFACE_TABLE5(nsSVGPathElement, nsIDOMNode, nsIDOMElement,
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(nsSVGPathElementBase)
NS_INTERFACE_MAP_END_INHERITING(SVGPathElementBase)
//----------------------------------------------------------------------
// Implementation
nsSVGPathElement::nsSVGPathElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGPathElementBase(aNodeInfo)
SVGPathElement::SVGPathElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: SVGPathElementBase(aNodeInfo)
{
}
//----------------------------------------------------------------------
// nsIDOMNode methods
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGPathElement)
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPathElement)
//----------------------------------------------------------------------
// nsIDOMSVGPathElement methods:
/* readonly attribute nsIDOMSVGAnimatedNumber pathLength; */
NS_IMETHODIMP
nsSVGPathElement::GetPathLength(nsIDOMSVGAnimatedNumber * *aPathLength)
SVGPathElement::GetPathLength(nsIDOMSVGAnimatedNumber * *aPathLength)
{
return mPathLength.ToDOMAnimatedNumber(aPathLength, this);
}
/* float getTotalLength (); */
NS_IMETHODIMP
nsSVGPathElement::GetTotalLength(float *_retval)
SVGPathElement::GetTotalLength(float *_retval)
{
*_retval = 0;
@ -77,7 +78,7 @@ nsSVGPathElement::GetTotalLength(float *_retval)
/* DOMSVGPoint getPointAtLength (in float distance); */
NS_IMETHODIMP
nsSVGPathElement::GetPointAtLength(float distance, nsISupports **_retval)
SVGPathElement::GetPointAtLength(float distance, nsISupports **_retval)
{
NS_ENSURE_FINITE(distance, NS_ERROR_ILLEGAL_VALUE);
@ -102,7 +103,7 @@ nsSVGPathElement::GetPointAtLength(float distance, nsISupports **_retval)
/* unsigned long getPathSegAtLength (in float distance); */
NS_IMETHODIMP
nsSVGPathElement::GetPathSegAtLength(float distance, uint32_t *_retval)
SVGPathElement::GetPathSegAtLength(float distance, uint32_t *_retval)
{
NS_ENSURE_FINITE(distance, NS_ERROR_ILLEGAL_VALUE);
*_retval = mD.GetAnimValue().GetPathSegAtLength(distance);
@ -111,7 +112,7 @@ nsSVGPathElement::GetPathSegAtLength(float distance, uint32_t *_retval)
/* nsISupports createSVGPathSegClosePath (); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegClosePath(nsISupports **_retval)
SVGPathElement::CreateSVGPathSegClosePath(nsISupports **_retval)
{
nsISupports* seg = NS_NewSVGPathSegClosePath();
NS_ENSURE_TRUE(seg, NS_ERROR_OUT_OF_MEMORY);
@ -120,7 +121,7 @@ nsSVGPathElement::CreateSVGPathSegClosePath(nsISupports **_retval)
/* nsISupports createSVGPathSegMovetoAbs (in float x, in float y); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegMovetoAbs(float x, float y, nsISupports **_retval)
SVGPathElement::CreateSVGPathSegMovetoAbs(float x, float y, nsISupports **_retval)
{
NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
nsISupports* seg = NS_NewSVGPathSegMovetoAbs(x, y);
@ -130,7 +131,7 @@ nsSVGPathElement::CreateSVGPathSegMovetoAbs(float x, float y, nsISupports **_ret
/* nsISupports createSVGPathSegMovetoRel (in float x, in float y); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegMovetoRel(float x, float y, nsISupports **_retval)
SVGPathElement::CreateSVGPathSegMovetoRel(float x, float y, nsISupports **_retval)
{
NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
nsISupports* seg = NS_NewSVGPathSegMovetoRel(x, y);
@ -140,7 +141,7 @@ nsSVGPathElement::CreateSVGPathSegMovetoRel(float x, float y, nsISupports **_ret
/* nsISupports createSVGPathSegLinetoAbs (in float x, in float y); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegLinetoAbs(float x, float y, nsISupports **_retval)
SVGPathElement::CreateSVGPathSegLinetoAbs(float x, float y, nsISupports **_retval)
{
NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
nsISupports* seg = NS_NewSVGPathSegLinetoAbs(x, y);
@ -150,7 +151,7 @@ nsSVGPathElement::CreateSVGPathSegLinetoAbs(float x, float y, nsISupports **_ret
/* nsISupports createSVGPathSegLinetoRel (in float x, in float y); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegLinetoRel(float x, float y, nsISupports **_retval)
SVGPathElement::CreateSVGPathSegLinetoRel(float x, float y, nsISupports **_retval)
{
NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
nsISupports* seg = NS_NewSVGPathSegLinetoRel(x, y);
@ -160,7 +161,7 @@ nsSVGPathElement::CreateSVGPathSegLinetoRel(float x, float y, nsISupports **_ret
/* 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)
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);
@ -170,7 +171,7 @@ nsSVGPathElement::CreateSVGPathSegCurvetoCubicAbs(float x, float y, float x1, fl
/* 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)
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);
@ -180,7 +181,7 @@ nsSVGPathElement::CreateSVGPathSegCurvetoCubicRel(float x, float y, float x1, fl
/* 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)
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);
@ -190,7 +191,7 @@ nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1
/* 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)
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);
@ -200,7 +201,7 @@ nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticRel(float x, float y, float x1
/* 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)
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,
@ -211,7 +212,7 @@ nsSVGPathElement::CreateSVGPathSegArcAbs(float x, float y, float r1, float r2, f
/* 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)
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,
@ -222,7 +223,7 @@ nsSVGPathElement::CreateSVGPathSegArcRel(float x, float y, float r1, float r2, f
/* nsISupports createSVGPathSegLinetoHorizontalAbs (in float x); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegLinetoHorizontalAbs(float x, nsISupports **_retval)
SVGPathElement::CreateSVGPathSegLinetoHorizontalAbs(float x, nsISupports **_retval)
{
NS_ENSURE_FINITE(x, NS_ERROR_ILLEGAL_VALUE);
nsISupports* seg = NS_NewSVGPathSegLinetoHorizontalAbs(x);
@ -232,7 +233,7 @@ nsSVGPathElement::CreateSVGPathSegLinetoHorizontalAbs(float x, nsISupports **_re
/* nsISupports createSVGPathSegLinetoHorizontalRel (in float x); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegLinetoHorizontalRel(float x, nsISupports **_retval)
SVGPathElement::CreateSVGPathSegLinetoHorizontalRel(float x, nsISupports **_retval)
{
NS_ENSURE_FINITE(x, NS_ERROR_ILLEGAL_VALUE);
nsISupports* seg = NS_NewSVGPathSegLinetoHorizontalRel(x);
@ -242,7 +243,7 @@ nsSVGPathElement::CreateSVGPathSegLinetoHorizontalRel(float x, nsISupports **_re
/* nsISupports createSVGPathSegLinetoVerticalAbs (in float y); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegLinetoVerticalAbs(float y, nsISupports **_retval)
SVGPathElement::CreateSVGPathSegLinetoVerticalAbs(float y, nsISupports **_retval)
{
NS_ENSURE_FINITE(y, NS_ERROR_ILLEGAL_VALUE);
nsISupports* seg = NS_NewSVGPathSegLinetoVerticalAbs(y);
@ -252,7 +253,7 @@ nsSVGPathElement::CreateSVGPathSegLinetoVerticalAbs(float y, nsISupports **_retv
/* nsISupports createSVGPathSegLinetoVerticalRel (in float y); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegLinetoVerticalRel(float y, nsISupports **_retval)
SVGPathElement::CreateSVGPathSegLinetoVerticalRel(float y, nsISupports **_retval)
{
NS_ENSURE_FINITE(y, NS_ERROR_ILLEGAL_VALUE);
nsISupports* seg = NS_NewSVGPathSegLinetoVerticalRel(y);
@ -262,7 +263,7 @@ nsSVGPathElement::CreateSVGPathSegLinetoVerticalRel(float y, nsISupports **_retv
/* 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)
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);
@ -272,7 +273,7 @@ nsSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float
/* 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)
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);
@ -282,7 +283,7 @@ nsSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRel(float x, float y, float
/* nsISupports createSVGPathSegCurvetoQuadraticSmoothAbs (in float x, in float y); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, nsISupports **_retval)
SVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, nsISupports **_retval)
{
NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
@ -292,7 +293,7 @@ nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, ns
/* nsISupports createSVGPathSegCurvetoQuadraticSmoothRel (in float x, in float y); */
NS_IMETHODIMP
nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, nsISupports **_retval)
SVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, nsISupports **_retval)
{
NS_ENSURE_FINITE2(x, y, NS_ERROR_ILLEGAL_VALUE);
nsISupports* seg = NS_NewSVGPathSegCurvetoQuadraticSmoothRel(x, y);
@ -304,13 +305,13 @@ nsSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, ns
// nsSVGElement methods
/* virtual */ bool
nsSVGPathElement::HasValidDimensions() const
SVGPathElement::HasValidDimensions() const
{
return !mD.GetAnimValue().IsEmpty();
}
nsSVGElement::NumberAttributesInfo
nsSVGPathElement::GetNumberInfo()
SVGPathElement::GetNumberInfo()
{
return NumberAttributesInfo(&mPathLength, &sNumberInfo, 1);
}
@ -319,7 +320,7 @@ nsSVGPathElement::GetNumberInfo()
// nsIDOMSVGAnimatedPathData methods:
/* readonly attribute DOMSVGPathSegList pathSegList; */
NS_IMETHODIMP nsSVGPathElement::GetPathSegList(nsISupports * *aPathSegList)
NS_IMETHODIMP SVGPathElement::GetPathSegList(nsISupports * *aPathSegList)
{
void *key = mD.GetBaseValKey();
*aPathSegList = DOMSVGPathSegList::GetDOMWrapper(key, this, false).get();
@ -327,7 +328,7 @@ NS_IMETHODIMP nsSVGPathElement::GetPathSegList(nsISupports * *aPathSegList)
}
/* readonly attribute DOMSVGPathSegList animatedPathSegList; */
NS_IMETHODIMP nsSVGPathElement::GetAnimatedPathSegList(nsISupports * *aAnimatedPathSegList)
NS_IMETHODIMP SVGPathElement::GetAnimatedPathSegList(nsISupports * *aAnimatedPathSegList)
{
void *key = mD.GetAnimValKey();
*aAnimatedPathSegList =
@ -339,18 +340,18 @@ NS_IMETHODIMP nsSVGPathElement::GetAnimatedPathSegList(nsISupports * *aAnimatedP
// nsIContent methods
NS_IMETHODIMP_(bool)
nsSVGPathElement::IsAttributeMapped(const nsIAtom* name) const
SVGPathElement::IsAttributeMapped(const nsIAtom* name) const
{
static const MappedAttributeEntry* const map[] = {
sMarkersMap
};
return FindAttributeDependence(name, map) ||
nsSVGPathElementBase::IsAttributeMapped(name);
SVGPathElementBase::IsAttributeMapped(name);
}
already_AddRefed<gfxFlattenedPath>
nsSVGPathElement::GetFlattenedPath(const gfxMatrix &aMatrix)
SVGPathElement::GetFlattenedPath(const gfxMatrix &aMatrix)
{
return mD.GetAnimValue().ToFlattenedPath(aMatrix);
}
@ -359,32 +360,32 @@ nsSVGPathElement::GetFlattenedPath(const gfxMatrix &aMatrix)
// nsSVGPathGeometryElement methods
bool
nsSVGPathElement::AttributeDefinesGeometry(const nsIAtom *aName)
SVGPathElement::AttributeDefinesGeometry(const nsIAtom *aName)
{
return aName == nsGkAtoms::d ||
aName == nsGkAtoms::pathLength;
}
bool
nsSVGPathElement::IsMarkable()
SVGPathElement::IsMarkable()
{
return true;
}
void
nsSVGPathElement::GetMarkPoints(nsTArray<nsSVGMark> *aMarks)
SVGPathElement::GetMarkPoints(nsTArray<nsSVGMark> *aMarks)
{
mD.GetAnimValue().GetMarkerPositioningData(aMarks);
}
void
nsSVGPathElement::ConstructPath(gfxContext *aCtx)
SVGPathElement::ConstructPath(gfxContext *aCtx)
{
mD.GetAnimValue().ConstructPath(aCtx);
}
gfxFloat
nsSVGPathElement::GetPathLengthScale(PathLengthScaleForType aFor)
SVGPathElement::GetPathLengthScale(PathLengthScaleForType aFor)
{
NS_ABORT_IF_FALSE(aFor == eForTextPath || aFor == eForStroking,
"Unknown enum");
@ -406,3 +407,6 @@ nsSVGPathElement::GetPathLengthScale(PathLengthScaleForType aFor)
}
return 1.0;
}
} // namespace dom
} // namespace mozilla

View File

@ -3,8 +3,8 @@
* 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__
#ifndef mozilla_dom_SVGPathElement_h
#define mozilla_dom_SVGPathElement_h
#include "nsIDOMSVGAnimatedPathData.h"
#include "nsIDOMSVGPathElement.h"
@ -12,23 +12,29 @@
#include "nsSVGPathGeometryElement.h"
#include "SVGAnimatedPathSegList.h"
nsresult NS_NewSVGPathElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
class gfxContext;
typedef nsSVGPathGeometryElement nsSVGPathElementBase;
typedef nsSVGPathGeometryElement SVGPathElementBase;
class nsSVGPathElement : public nsSVGPathElementBase,
public nsIDOMSVGPathElement,
public nsIDOMSVGAnimatedPathData
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);
nsSVGPathElement(already_AddRefed<nsINodeInfo> aNodeInfo);
friend nsresult (::NS_NewSVGPathElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo));
SVGPathElement(already_AddRefed<nsINodeInfo> aNodeInfo);
public:
typedef mozilla::SVGAnimatedPathSegList SVGAnimatedPathSegList;
typedef SVGAnimatedPathSegList SVGAnimatedPathSegList;
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
@ -38,7 +44,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGPathElementBase::)
NS_FORWARD_NSIDOMSVGELEMENT(SVGPathElementBase::)
// nsIContent interface
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* name) const;
@ -91,4 +97,7 @@ protected:
static NumberInfo sNumberInfo;
};
#endif
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_SVGPathElement_h

View File

@ -5,7 +5,6 @@
#include "nsSVGPathDataParser.h"
#include "nsSVGDataParser.h"
#include "nsSVGPathElement.h"
#include "prdtoa.h"
#include "DOMSVGPathSeg.h"
#include <stdlib.h>

View File

@ -12,7 +12,6 @@
#include "nsPresContext.h"
#include "nsSVGEffects.h"
#include "nsSVGPaintServerFrame.h"
#include "nsSVGPathElement.h"
#include "nsSVGUtils.h"
NS_IMPL_FRAMEARENA_HELPERS(nsSVGGeometryFrame)

View File

@ -12,7 +12,6 @@
#include "nsISVGGlyphFragmentNode.h"
#include "nsSVGGlyphFrame.h"
#include "nsSVGIntegrationUtils.h"
#include "nsSVGPathElement.h"
#include "nsSVGTextPathFrame.h"
#include "nsSVGUtils.h"
#include "SVGGraphicsElement.h"

View File

@ -10,7 +10,7 @@
#include "nsContentUtils.h"
#include "nsSVGEffects.h"
#include "nsSVGLength2.h"
#include "nsSVGPathElement.h"
#include "mozilla/dom/SVGPathElement.h"
#include "mozilla/dom/SVGTextPathElement.h"
#include "SVGLengthList.h"
@ -144,8 +144,8 @@ nsSVGTextPathFrame::GetOffsetScale()
if (!pathFrame)
return 1.0;
return static_cast<nsSVGPathElement*>(pathFrame->GetContent())->
GetPathLengthScale(nsSVGPathElement::eForTextPath);
return static_cast<SVGPathElement*>(pathFrame->GetContent())->
GetPathLengthScale(SVGPathElement::eForTextPath);
}
//----------------------------------------------------------------------

View File

@ -44,7 +44,7 @@
#include "nsSVGLength2.h"
#include "nsSVGMaskFrame.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsSVGPathElement.h"
#include "mozilla/dom/SVGPathElement.h"
#include "nsSVGPathGeometryElement.h"
#include "nsSVGPathGeometryFrame.h"
#include "nsSVGPaintServerFrame.h"
@ -1733,8 +1733,8 @@ GetStrokeDashData(nsIFrame* aFrame,
gfxFloat pathScale = 1.0;
if (content->Tag() == nsGkAtoms::path) {
pathScale = static_cast<nsSVGPathElement*>(content)->
GetPathLengthScale(nsSVGPathElement::eForStroking);
pathScale = static_cast<SVGPathElement*>(content)->
GetPathLengthScale(SVGPathElement::eForStroking);
if (pathScale <= 0) {
return false;
}