|
|
|
@ -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
|