Bug 886289 - Move SVGAnimatedNumber to WebIDL; r=dzbarsky

This commit is contained in:
Ms2ger 2013-07-01 09:03:04 +02:00
parent 6fa75b2d82
commit c477a69e4e
54 changed files with 240 additions and 229 deletions

View File

@ -0,0 +1,32 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 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/. */
#include "mozilla/dom/SVGAnimatedNumber.h"
#include "mozilla/dom/SVGAnimatedNumberBinding.h"
namespace mozilla {
namespace dom {
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedNumber,
mSVGElement)
NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedNumber)
NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedNumber)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedNumber)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
JSObject*
SVGAnimatedNumber::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
return SVGAnimatedNumberBinding::Wrap(aCx, aScope, this);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 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 mozilla_dom_SVGAnimatedNumber_h
#define mozilla_dom_SVGAnimatedNumber_h
#include "nsISupports.h"
#include "nsWrapperCache.h"
#include "nsSVGElement.h"
namespace mozilla {
namespace dom {
class SVGAnimatedNumber : public nsISupports
, public nsWrapperCache
{
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SVGAnimatedNumber)
nsSVGElement* GetParentObject() const
{
return mSVGElement;
}
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
MOZ_OVERRIDE MOZ_FINAL;
virtual float BaseVal() = 0;
virtual void SetBaseVal(float aBaseVal) = 0;
virtual float AnimVal() = 0;
protected:
explicit SVGAnimatedNumber(nsSVGElement* aSVGElement)
: mSVGElement(aSVGElement)
{
SetIsDOMBinding();
}
virtual ~SVGAnimatedNumber() {};
nsRefPtr<nsSVGElement> mSVGElement;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_SVGAnimatedNumber_h

View File

@ -49,11 +49,11 @@ public:
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE = 0;
already_AddRefed<SVGAnimatedEnumeration> Type();
already_AddRefed<DOMSVGAnimatedNumberList> TableValues();
already_AddRefed<nsIDOMSVGAnimatedNumber> Slope();
already_AddRefed<nsIDOMSVGAnimatedNumber> Intercept();
already_AddRefed<nsIDOMSVGAnimatedNumber> Amplitude();
already_AddRefed<nsIDOMSVGAnimatedNumber> Exponent();
already_AddRefed<nsIDOMSVGAnimatedNumber> Offset();
already_AddRefed<SVGAnimatedNumber> Slope();
already_AddRefed<SVGAnimatedNumber> Intercept();
already_AddRefed<SVGAnimatedNumber> Amplitude();
already_AddRefed<SVGAnimatedNumber> Exponent();
already_AddRefed<SVGAnimatedNumber> Offset();
protected:
virtual NumberAttributesInfo GetNumberInfo() MOZ_OVERRIDE;

View File

@ -73,25 +73,25 @@ SVGFECompositeElement::Operator()
return mEnumAttributes[OPERATOR].ToDOMAnimatedEnum(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFECompositeElement::K1()
{
return mNumberAttributes[ATTR_K1].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFECompositeElement::K2()
{
return mNumberAttributes[ATTR_K2].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFECompositeElement::K3()
{
return mNumberAttributes[ATTR_K3].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFECompositeElement::K4()
{
return mNumberAttributes[ATTR_K4].ToDOMAnimatedNumber(this);

View File

@ -58,10 +58,10 @@ public:
already_AddRefed<SVGAnimatedString> In1();
already_AddRefed<SVGAnimatedString> In2();
already_AddRefed<SVGAnimatedEnumeration> Operator();
already_AddRefed<nsIDOMSVGAnimatedNumber> K1();
already_AddRefed<nsIDOMSVGAnimatedNumber> K2();
already_AddRefed<nsIDOMSVGAnimatedNumber> K3();
already_AddRefed<nsIDOMSVGAnimatedNumber> K4();
already_AddRefed<SVGAnimatedNumber> K1();
already_AddRefed<SVGAnimatedNumber> K2();
already_AddRefed<SVGAnimatedNumber> K3();
already_AddRefed<SVGAnimatedNumber> K4();
void SetK(float k1, float k2, float k3, float k4);
protected:

View File

@ -134,26 +134,26 @@ SVGFEConvolveMatrixElement::PreserveAlpha()
return mBooleanAttributes[PRESERVEALPHA].ToDOMAnimatedBoolean(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEConvolveMatrixElement::Divisor()
{
return mNumberAttributes[DIVISOR].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEConvolveMatrixElement::Bias()
{
return mNumberAttributes[BIAS].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEConvolveMatrixElement::KernelUnitLengthX()
{
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(nsSVGNumberPair::eFirst,
this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEConvolveMatrixElement::KernelUnitLengthY()
{
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(nsSVGNumberPair::eSecond,

View File

@ -66,10 +66,10 @@ public:
already_AddRefed<SVGAnimatedInteger> TargetY();
already_AddRefed<SVGAnimatedEnumeration> EdgeMode();
already_AddRefed<SVGAnimatedBoolean> PreserveAlpha();
already_AddRefed<nsIDOMSVGAnimatedNumber> Divisor();
already_AddRefed<nsIDOMSVGAnimatedNumber> Bias();
already_AddRefed<nsIDOMSVGAnimatedNumber> KernelUnitLengthX();
already_AddRefed<nsIDOMSVGAnimatedNumber> KernelUnitLengthY();
already_AddRefed<SVGAnimatedNumber> Divisor();
already_AddRefed<SVGAnimatedNumber> Bias();
already_AddRefed<SVGAnimatedNumber> KernelUnitLengthX();
already_AddRefed<SVGAnimatedNumber> KernelUnitLengthY();
protected:
virtual bool OperatesOnPremultipledAlpha(int32_t) MOZ_OVERRIDE {

View File

@ -31,26 +31,26 @@ SVGFEDiffuseLightingElement::In1()
return mStringAttributes[IN1].ToDOMAnimatedString(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEDiffuseLightingElement::SurfaceScale()
{
return mNumberAttributes[SURFACE_SCALE].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEDiffuseLightingElement::DiffuseConstant()
{
return mNumberAttributes[DIFFUSE_CONSTANT].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEDiffuseLightingElement::KernelUnitLengthX()
{
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
nsSVGNumberPair::eFirst, this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEDiffuseLightingElement::KernelUnitLengthY()
{
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(

View File

@ -36,10 +36,10 @@ public:
// WebIDL
already_AddRefed<SVGAnimatedString> In1();
already_AddRefed<nsIDOMSVGAnimatedNumber> SurfaceScale();
already_AddRefed<nsIDOMSVGAnimatedNumber> DiffuseConstant();
already_AddRefed<nsIDOMSVGAnimatedNumber> KernelUnitLengthX();
already_AddRefed<nsIDOMSVGAnimatedNumber> KernelUnitLengthY();
already_AddRefed<SVGAnimatedNumber> SurfaceScale();
already_AddRefed<SVGAnimatedNumber> DiffuseConstant();
already_AddRefed<SVGAnimatedNumber> KernelUnitLengthX();
already_AddRefed<SVGAnimatedNumber> KernelUnitLengthY();
protected:
virtual void LightPixel(const float *N, const float *L,

View File

@ -77,7 +77,7 @@ SVGFEDisplacementMapElement::In2()
return mStringAttributes[IN2].ToDOMAnimatedString(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEDisplacementMapElement::Scale()
{
return mNumberAttributes[SCALE].ToDOMAnimatedNumber(this);

View File

@ -51,7 +51,7 @@ public:
// WebIDL
already_AddRefed<SVGAnimatedString> In1();
already_AddRefed<SVGAnimatedString> In2();
already_AddRefed<nsIDOMSVGAnimatedNumber> Scale();
already_AddRefed<SVGAnimatedNumber> Scale();
already_AddRefed<SVGAnimatedEnumeration> XChannelSelector();
already_AddRefed<SVGAnimatedEnumeration> YChannelSelector();

View File

@ -40,13 +40,13 @@ SVGFEDistantLightElement::AttributeAffectsRendering(int32_t aNameSpaceID,
aAttribute == nsGkAtoms::elevation);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEDistantLightElement::Azimuth()
{
return mNumberAttributes[AZIMUTH].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEDistantLightElement::Elevation()
{
return mNumberAttributes[ELEVATION].ToDOMAnimatedNumber(this);

View File

@ -36,8 +36,8 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
// WebIDL
already_AddRefed<nsIDOMSVGAnimatedNumber> Azimuth();
already_AddRefed<nsIDOMSVGAnimatedNumber> Elevation();
already_AddRefed<SVGAnimatedNumber> Azimuth();
already_AddRefed<SVGAnimatedNumber> Elevation();
protected:
virtual NumberAttributesInfo GetNumberInfo() MOZ_OVERRIDE;

View File

@ -43,13 +43,13 @@ SVGFEGaussianBlurElement::In1()
return mStringAttributes[IN1].ToDOMAnimatedString(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEGaussianBlurElement::StdDeviationX()
{
return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(nsSVGNumberPair::eFirst, this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEGaussianBlurElement::StdDeviationY()
{
return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(nsSVGNumberPair::eSecond, this);

View File

@ -51,8 +51,8 @@ public:
// WebIDL
already_AddRefed<SVGAnimatedString> In1();
already_AddRefed<nsIDOMSVGAnimatedNumber> StdDeviationX();
already_AddRefed<nsIDOMSVGAnimatedNumber> StdDeviationY();
already_AddRefed<SVGAnimatedNumber> StdDeviationX();
already_AddRefed<SVGAnimatedNumber> StdDeviationY();
void SetStdDeviation(float stdDeviationX, float stdDeviationY);
protected:

View File

@ -70,13 +70,13 @@ SVGFEMorphologyElement::Operator()
return mEnumAttributes[OPERATOR].ToDOMAnimatedEnum(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEMorphologyElement::RadiusX()
{
return mNumberPairAttributes[RADIUS].ToDOMAnimatedNumber(nsSVGNumberPair::eFirst, this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEMorphologyElement::RadiusY()
{
return mNumberPairAttributes[RADIUS].ToDOMAnimatedNumber(nsSVGNumberPair::eSecond, this);

View File

@ -52,8 +52,8 @@ public:
// WebIDL
already_AddRefed<SVGAnimatedString> In1();
already_AddRefed<SVGAnimatedEnumeration> Operator();
already_AddRefed<nsIDOMSVGAnimatedNumber> RadiusX();
already_AddRefed<nsIDOMSVGAnimatedNumber> RadiusY();
already_AddRefed<SVGAnimatedNumber> RadiusX();
already_AddRefed<SVGAnimatedNumber> RadiusY();
void SetRadius(float rx, float ry);
protected:

View File

@ -45,13 +45,13 @@ SVGFEOffsetElement::In1()
return mStringAttributes[IN1].ToDOMAnimatedString(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEOffsetElement::Dx()
{
return mNumberAttributes[DX].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEOffsetElement::Dy()
{
return mNumberAttributes[DY].ToDOMAnimatedNumber(this);

View File

@ -50,8 +50,8 @@ public:
// WebIDL
already_AddRefed<SVGAnimatedString> In1();
already_AddRefed<nsIDOMSVGAnimatedNumber> Dx();
already_AddRefed<nsIDOMSVGAnimatedNumber> Dy();
already_AddRefed<SVGAnimatedNumber> Dx();
already_AddRefed<SVGAnimatedNumber> Dy();
protected:
nsIntPoint GetOffset(const nsSVGFilterInstance& aInstance);

View File

@ -44,19 +44,19 @@ SVGFEPointLightElement::AttributeAffectsRendering(int32_t aNameSpaceID,
//----------------------------------------------------------------------
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEPointLightElement::X()
{
return mNumberAttributes[ATTR_X].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEPointLightElement::Y()
{
return mNumberAttributes[ATTR_Y].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFEPointLightElement::Z()
{
return mNumberAttributes[ATTR_Z].ToDOMAnimatedNumber(this);

View File

@ -36,9 +36,9 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
// WebIDL
already_AddRefed<nsIDOMSVGAnimatedNumber> X();
already_AddRefed<nsIDOMSVGAnimatedNumber> Y();
already_AddRefed<nsIDOMSVGAnimatedNumber> Z();
already_AddRefed<SVGAnimatedNumber> X();
already_AddRefed<SVGAnimatedNumber> Y();
already_AddRefed<SVGAnimatedNumber> Z();
protected:
virtual NumberAttributesInfo GetNumberInfo() MOZ_OVERRIDE;

View File

@ -29,32 +29,32 @@ SVGFESpecularLightingElement::In1()
return mStringAttributes[IN1].ToDOMAnimatedString(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpecularLightingElement::SurfaceScale()
{
return mNumberAttributes[SURFACE_SCALE].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpecularLightingElement::SpecularConstant()
{
return mNumberAttributes[SPECULAR_CONSTANT].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpecularLightingElement::SpecularExponent()
{
return mNumberAttributes[SPECULAR_EXPONENT].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpecularLightingElement::KernelUnitLengthX()
{
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
nsSVGNumberPair::eFirst, this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpecularLightingElement::KernelUnitLengthY()
{
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(

View File

@ -42,11 +42,11 @@ public:
// WebIDL
already_AddRefed<SVGAnimatedString> In1();
already_AddRefed<nsIDOMSVGAnimatedNumber> SurfaceScale();
already_AddRefed<nsIDOMSVGAnimatedNumber> SpecularConstant();
already_AddRefed<nsIDOMSVGAnimatedNumber> SpecularExponent();
already_AddRefed<nsIDOMSVGAnimatedNumber> KernelUnitLengthX();
already_AddRefed<nsIDOMSVGAnimatedNumber> KernelUnitLengthY();
already_AddRefed<SVGAnimatedNumber> SurfaceScale();
already_AddRefed<SVGAnimatedNumber> SpecularConstant();
already_AddRefed<SVGAnimatedNumber> SpecularExponent();
already_AddRefed<SVGAnimatedNumber> KernelUnitLengthX();
already_AddRefed<SVGAnimatedNumber> KernelUnitLengthY();
protected:
virtual void LightPixel(const float *N, const float *L,

View File

@ -54,49 +54,49 @@ SVGFESpotLightElement::AttributeAffectsRendering(int32_t aNameSpaceID,
//----------------------------------------------------------------------
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpotLightElement::X()
{
return mNumberAttributes[ATTR_X].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpotLightElement::Y()
{
return mNumberAttributes[ATTR_Y].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpotLightElement::Z()
{
return mNumberAttributes[ATTR_Z].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpotLightElement::PointsAtX()
{
return mNumberAttributes[POINTS_AT_X].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpotLightElement::PointsAtY()
{
return mNumberAttributes[POINTS_AT_Y].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpotLightElement::PointsAtZ()
{
return mNumberAttributes[POINTS_AT_Z].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpotLightElement::SpecularExponent()
{
return mNumberAttributes[SPECULAR_EXPONENT].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFESpotLightElement::LimitingConeAngle()
{
return mNumberAttributes[LIMITING_CONE_ANGLE].ToDOMAnimatedNumber(this);

View File

@ -39,14 +39,14 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
// WebIDL
already_AddRefed<nsIDOMSVGAnimatedNumber> X();
already_AddRefed<nsIDOMSVGAnimatedNumber> Y();
already_AddRefed<nsIDOMSVGAnimatedNumber> Z();
already_AddRefed<nsIDOMSVGAnimatedNumber> PointsAtX();
already_AddRefed<nsIDOMSVGAnimatedNumber> PointsAtY();
already_AddRefed<nsIDOMSVGAnimatedNumber> PointsAtZ();
already_AddRefed<nsIDOMSVGAnimatedNumber> SpecularExponent();
already_AddRefed<nsIDOMSVGAnimatedNumber> LimitingConeAngle();
already_AddRefed<SVGAnimatedNumber> X();
already_AddRefed<SVGAnimatedNumber> Y();
already_AddRefed<SVGAnimatedNumber> Z();
already_AddRefed<SVGAnimatedNumber> PointsAtX();
already_AddRefed<SVGAnimatedNumber> PointsAtY();
already_AddRefed<SVGAnimatedNumber> PointsAtZ();
already_AddRefed<SVGAnimatedNumber> SpecularExponent();
already_AddRefed<SVGAnimatedNumber> LimitingConeAngle();
protected:
virtual NumberAttributesInfo GetNumberInfo() MOZ_OVERRIDE;

View File

@ -86,13 +86,13 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFETurbulenceElement)
//----------------------------------------------------------------------
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFETurbulenceElement::BaseFrequencyX()
{
return mNumberPairAttributes[BASE_FREQ].ToDOMAnimatedNumber(nsSVGNumberPair::eFirst, this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFETurbulenceElement::BaseFrequencyY()
{
return mNumberPairAttributes[BASE_FREQ].ToDOMAnimatedNumber(nsSVGNumberPair::eSecond, this);
@ -104,7 +104,7 @@ SVGFETurbulenceElement::NumOctaves()
return mIntegerAttributes[OCTAVES].ToDOMAnimatedInteger(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGFETurbulenceElement::Seed()
{
return mNumberAttributes[SEED].ToDOMAnimatedNumber(this);

View File

@ -48,10 +48,10 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
// WebIDL
already_AddRefed<nsIDOMSVGAnimatedNumber> BaseFrequencyX();
already_AddRefed<nsIDOMSVGAnimatedNumber> BaseFrequencyY();
already_AddRefed<SVGAnimatedNumber> BaseFrequencyX();
already_AddRefed<SVGAnimatedNumber> BaseFrequencyY();
already_AddRefed<SVGAnimatedInteger> NumOctaves();
already_AddRefed<nsIDOMSVGAnimatedNumber> Seed();
already_AddRefed<SVGAnimatedNumber> Seed();
already_AddRefed<SVGAnimatedEnumeration> StitchTiles();
already_AddRefed<SVGAnimatedEnumeration> Type();

View File

@ -42,12 +42,10 @@ SVGPathElement::SVGPathElement(already_AddRefed<nsINodeInfo> aNodeInfo)
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPathElement)
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGPathElement::PathLength()
{
nsCOMPtr<nsIDOMSVGAnimatedNumber> number;
mPathLength.ToDOMAnimatedNumber(getter_AddRefs(number), this);
return number.forget();
return mPathLength.ToDOMAnimatedNumber(this);
}
float

View File

@ -74,7 +74,7 @@ public:
gfxFloat GetPathLengthScale(PathLengthScaleForType aFor);
// WebIDL
already_AddRefed<nsIDOMSVGAnimatedNumber> PathLength();
already_AddRefed<SVGAnimatedNumber> PathLength();
float GetTotalLength(ErrorResult& rv);
already_AddRefed<nsISVGPoint> GetPointAtLength(float distance, ErrorResult& rv);
uint32_t GetPathSegAtLength(float distance);

View File

@ -35,12 +35,10 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGStopElement)
//----------------------------------------------------------------------
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGStopElement::Offset()
{
nsCOMPtr<nsIDOMSVGAnimatedNumber> offset;
mOffset.ToDOMAnimatedNumber(getter_AddRefs(offset), this);
return offset.forget();
return mOffset.ToDOMAnimatedNumber(this);
}
//----------------------------------------------------------------------

View File

@ -33,7 +33,7 @@ public:
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
// WebIDL
already_AddRefed<nsIDOMSVGAnimatedNumber> Offset();
already_AddRefed<SVGAnimatedNumber> Offset();
protected:

View File

@ -26,6 +26,7 @@ EXPORTS.mozilla.dom += [
'SVGAnimatedEnumeration.h',
'SVGAnimatedInteger.h',
'SVGAnimatedLength.h',
'SVGAnimatedNumber.h',
'SVGAnimatedRect.h',
'SVGAnimatedString.h',
'SVGAnimatedTransformList.h',
@ -122,6 +123,7 @@ CPP_SOURCES += [
'SVGAnimatedInteger.cpp',
'SVGAnimatedLength.cpp',
'SVGAnimatedLengthList.cpp',
'SVGAnimatedNumber.cpp',
'SVGAnimatedNumberList.cpp',
'SVGAnimatedPathSegList.cpp',
'SVGAnimatedPointList.cpp',

View File

@ -400,31 +400,31 @@ SVGComponentTransferFunctionElement::TableValues()
&mNumberListAttributes[TABLEVALUES], this, TABLEVALUES);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGComponentTransferFunctionElement::Slope()
{
return mNumberAttributes[SLOPE].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGComponentTransferFunctionElement::Intercept()
{
return mNumberAttributes[INTERCEPT].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGComponentTransferFunctionElement::Amplitude()
{
return mNumberAttributes[AMPLITUDE].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGComponentTransferFunctionElement::Exponent()
{
return mNumberAttributes[EXPONENT].ToDOMAnimatedNumber(this);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
SVGComponentTransferFunctionElement::Offset()
{
return mNumberAttributes[OFFSET].ToDOMAnimatedNumber(this);

View File

@ -14,6 +14,9 @@
#include "nsIDOMSVGNumber.h"
#include "mozilla/Attributes.h"
using namespace mozilla;
using namespace mozilla::dom;
class DOMSVGNumber MOZ_FINAL : public nsIDOMSVGNumber
{
public:
@ -33,22 +36,9 @@ private:
float mVal;
};
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGNumber2::DOMAnimatedNumber, mSVGElement)
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGNumber2::DOMAnimatedNumber)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGNumber2::DOMAnimatedNumber)
NS_IMPL_ADDREF(DOMSVGNumber)
NS_IMPL_RELEASE(DOMSVGNumber)
DOMCI_DATA(SVGAnimatedNumber, nsSVGNumber2::DOMAnimatedNumber)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGNumber2::DOMAnimatedNumber)
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedNumber)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimatedNumber)
NS_INTERFACE_MAP_END
NS_INTERFACE_MAP_BEGIN(DOMSVGNumber)
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGNumber)
NS_INTERFACE_MAP_ENTRY(nsISupports)
@ -150,7 +140,7 @@ nsSVGNumber2::SetAnimValue(float aValue, nsSVGElement *aSVGElement)
aSVGElement->DidAnimateNumber(mAttrEnum);
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
nsSVGNumber2::ToDOMAnimatedNumber(nsSVGElement* aSVGElement)
{
nsRefPtr<DOMAnimatedNumber> domAnimatedNumber =
@ -163,14 +153,6 @@ nsSVGNumber2::ToDOMAnimatedNumber(nsSVGElement* aSVGElement)
return domAnimatedNumber.forget();
}
nsresult
nsSVGNumber2::ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult,
nsSVGElement *aSVGElement)
{
*aResult = ToDOMAnimatedNumber(aSVGElement).get();
return NS_OK;
}
nsSVGNumber2::DOMAnimatedNumber::~DOMAnimatedNumber()
{
sSVGAnimatedNumberTearoffTable.RemoveTearoff(mVal);

View File

@ -9,11 +9,11 @@
#include "nsAutoPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsError.h"
#include "nsIDOMSVGAnimatedNumber.h"
#include "nsISMILAttr.h"
#include "nsMathUtils.h"
#include "nsSVGElement.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/SVGAnimatedNumber.h"
class nsSMILValue;
@ -53,10 +53,8 @@ public:
bool IsExplicitlySet() const
{ return mIsAnimated || mIsBaseSet; }
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<mozilla::dom::SVGAnimatedNumber>
ToDOMAnimatedNumber(nsSVGElement* aSVGElement);
nsresult ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult,
nsSVGElement* aSVGElement);
// Returns a new nsISMILAttr object that the caller must delete
nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
@ -69,36 +67,32 @@ private:
bool mIsBaseSet;
public:
struct DOMAnimatedNumber MOZ_FINAL : public nsIDOMSVGAnimatedNumber
struct DOMAnimatedNumber MOZ_FINAL : public mozilla::dom::SVGAnimatedNumber
{
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedNumber)
DOMAnimatedNumber(nsSVGNumber2* aVal, nsSVGElement *aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement) {}
DOMAnimatedNumber(nsSVGNumber2* aVal, nsSVGElement* aSVGElement)
: mozilla::dom::SVGAnimatedNumber(aSVGElement)
, mVal(aVal)
{}
virtual ~DOMAnimatedNumber();
nsSVGNumber2* mVal; // kept alive because it belongs to content
nsRefPtr<nsSVGElement> mSVGElement;
NS_IMETHOD GetBaseVal(float* aResult) MOZ_OVERRIDE
{ *aResult = mVal->GetBaseValue(); return NS_OK; }
NS_IMETHOD SetBaseVal(float aValue) MOZ_OVERRIDE
{
if (!NS_finite(aValue)) {
return NS_ERROR_ILLEGAL_VALUE;
}
mVal->SetBaseValue(aValue, mSVGElement);
return NS_OK;
}
virtual float BaseVal() MOZ_OVERRIDE
{
return mVal->GetBaseValue();
}
virtual void SetBaseVal(float aValue) MOZ_OVERRIDE
{
MOZ_ASSERT(NS_finite(aValue));
mVal->SetBaseValue(aValue, mSVGElement);
}
// Script may have modified animation parameters or timeline -- DOM getters
// need to flush any resample requests to reflect these modifications.
NS_IMETHOD GetAnimVal(float* aResult) MOZ_OVERRIDE
virtual float AnimVal() MOZ_OVERRIDE
{
mSVGElement->FlushAnimations();
*aResult = mVal->GetAnimValue();
return NS_OK;
return mVal->GetAnimValue();
}
};

View File

@ -14,21 +14,7 @@
#include "SVGNumberPairSMILType.h"
using namespace mozilla;
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGNumberPair::DOMAnimatedNumber, mSVGElement)
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGNumberPair::DOMAnimatedNumber)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGNumberPair::DOMAnimatedNumber)
DOMCI_DATA(SVGAnimatedNumberPair, nsSVGNumberPair::DOMAnimatedNumber)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGNumberPair::DOMAnimatedNumber)
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedNumber)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimatedNumber)
NS_INTERFACE_MAP_END
/* Implementation */
using namespace mozilla::dom;
static nsSVGAttrTearoffTable<nsSVGNumberPair, nsSVGNumberPair::DOMAnimatedNumber>
sSVGFirstAnimatedNumberTearoffTable;
@ -166,16 +152,7 @@ nsSVGNumberPair::SetAnimValue(const float aValue[2], nsSVGElement *aSVGElement)
aSVGElement->DidAnimateNumberPair(mAttrEnum);
}
nsresult
nsSVGNumberPair::ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber** aResult,
PairIndex aIndex,
nsSVGElement* aSVGElement)
{
*aResult = ToDOMAnimatedNumber(aIndex, aSVGElement).get();
return NS_OK;
}
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<SVGAnimatedNumber>
nsSVGNumberPair::ToDOMAnimatedNumber(PairIndex aIndex,
nsSVGElement* aSVGElement)
{

View File

@ -9,11 +9,11 @@
#include "nsAutoPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsError.h"
#include "nsIDOMSVGAnimatedNumber.h"
#include "nsISMILAttr.h"
#include "nsMathUtils.h"
#include "nsSVGElement.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/SVGAnimatedNumber.h"
class nsSMILValue;
@ -60,10 +60,7 @@ public:
bool IsExplicitlySet() const
{ return mIsAnimated || mIsBaseSet; }
nsresult ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber** aResult,
PairIndex aIndex,
nsSVGElement* aSVGElement);
already_AddRefed<nsIDOMSVGAnimatedNumber>
already_AddRefed<mozilla::dom::SVGAnimatedNumber>
ToDOMAnimatedNumber(PairIndex aIndex,
nsSVGElement* aSVGElement);
// Returns a new nsISMILAttr object that the caller must delete
@ -78,37 +75,34 @@ private:
bool mIsBaseSet;
public:
struct DOMAnimatedNumber MOZ_FINAL : public nsIDOMSVGAnimatedNumber
struct DOMAnimatedNumber MOZ_FINAL : public mozilla::dom::SVGAnimatedNumber
{
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedNumber)
DOMAnimatedNumber(nsSVGNumberPair* aVal, PairIndex aIndex, nsSVGElement *aSVGElement)
: mVal(aVal), mSVGElement(aSVGElement), mIndex(aIndex) {}
: mozilla::dom::SVGAnimatedNumber(aSVGElement)
, mVal(aVal)
, mIndex(aIndex)
{}
virtual ~DOMAnimatedNumber();
nsSVGNumberPair* mVal; // kept alive because it belongs to content
nsRefPtr<nsSVGElement> mSVGElement;
PairIndex mIndex; // are we the first or second number
NS_IMETHOD GetBaseVal(float* aResult) MOZ_OVERRIDE
{ *aResult = mVal->GetBaseValue(mIndex); return NS_OK; }
NS_IMETHOD SetBaseVal(float aValue) MOZ_OVERRIDE
{
if (!NS_finite(aValue)) {
return NS_ERROR_ILLEGAL_VALUE;
}
mVal->SetBaseValue(aValue, mIndex, mSVGElement);
return NS_OK;
}
virtual float BaseVal() MOZ_OVERRIDE
{
return mVal->GetBaseValue(mIndex);
}
virtual void SetBaseVal(float aValue) MOZ_OVERRIDE
{
MOZ_ASSERT(NS_finite(aValue));
mVal->SetBaseValue(aValue, mIndex, mSVGElement);
}
// Script may have modified animation parameters or timeline -- DOM getters
// need to flush any resample requests to reflect these modifications.
NS_IMETHOD GetAnimVal(float* aResult) MOZ_OVERRIDE
virtual float AnimVal() MOZ_OVERRIDE
{
mSVGElement->FlushAnimations();
*aResult = mVal->GetAnimValue(mIndex);
return NS_OK;
return mVal->GetAnimValue(mIndex);
}
};

View File

@ -183,7 +183,6 @@
#include "nsIDOMXPathResult.h"
#include "nsIDOMMozBrowserFrame.h"
#include "nsIDOMSVGAnimatedNumber.h"
#include "nsIDOMSVGLength.h"
#include "nsIDOMSVGNumber.h"
@ -569,8 +568,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS)
// other SVG classes
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedNumber, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(SVGLength, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(SVGNumber, nsDOMGenericSH,
@ -1505,10 +1502,6 @@ nsDOMClassInfo::Init()
// The SVG document
// other SVG classes
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedNumber, nsIDOMSVGAnimatedNumber)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedNumber)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(SVGLength, nsIDOMSVGLength)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLength)
DOM_CLASSINFO_MAP_END

View File

@ -74,7 +74,6 @@ DOMCI_CLASS(CSSMozDocumentRule)
DOMCI_CLASS(CSSSupportsRule)
// other SVG classes
DOMCI_CLASS(SVGAnimatedNumber)
DOMCI_CLASS(SVGLength)
DOMCI_CLASS(SVGNumber)

View File

@ -0,0 +1,16 @@
/* -*- 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/.
*
* The origin of this IDL file is
* https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedNumber
*
* Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
* W3C liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber {
attribute float baseVal;
readonly attribute float animVal;
};

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFECompositeElement : SVGElement {
// Composite Operators

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFEConvolveMatrixElement : SVGElement {
// Edge Mode Values

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFEDiffuseLightingElement : SVGElement {
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedNumber surfaceScale;

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFEDisplacementMapElement : SVGElement {
// Channel Selectors

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFEDistantLightElement : SVGElement {
readonly attribute SVGAnimatedNumber azimuth;
readonly attribute SVGAnimatedNumber elevation;

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFEGaussianBlurElement : SVGElement {
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedNumber stdDeviationX;

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFEMorphologyElement : SVGElement {
// Morphology Operators

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFEOffsetElement : SVGElement {
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedNumber dx;

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFEPointLightElement : SVGElement {
readonly attribute SVGAnimatedNumber x;
readonly attribute SVGAnimatedNumber y;

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFESpecularLightingElement : SVGElement {
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedNumber surfaceScale;

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFESpotLightElement : SVGElement {
readonly attribute SVGAnimatedNumber x;
readonly attribute SVGAnimatedNumber y;

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGFETurbulenceElement : SVGElement {
// Turbulence Types

View File

@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
interface SVGAnimatedNumber;
interface SVGStopElement : SVGElement {
readonly attribute SVGAnimatedNumber offset;
};

View File

@ -232,6 +232,7 @@ webidl_files = \
SVGAnimatedInteger.webidl \
SVGAnimatedLength.webidl \
SVGAnimatedLengthList.webidl \
SVGAnimatedNumber.webidl \
SVGAnimatedNumberList.webidl \
SVGAnimatedPathData.webidl \
SVGAnimatedPoints.webidl \