mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Bug 1540408 Part 1 - Move most internal attribute representation classes to be of the form SVGAnimated. r=dholbert
--HG-- rename : dom/svg/SVGBoolean.cpp => dom/svg/SVGAnimatedBoolean.cpp rename : dom/svg/SVGBoolean.h => dom/svg/SVGAnimatedBoolean.h rename : dom/svg/SVGClass.cpp => dom/svg/SVGAnimatedClass.cpp rename : dom/svg/SVGClass.h => dom/svg/SVGAnimatedClass.h rename : dom/svg/SVGEnum.cpp => dom/svg/SVGAnimatedEnumeration.cpp rename : dom/svg/SVGEnum.h => dom/svg/SVGAnimatedEnumeration.h rename : dom/svg/SVGInteger.cpp => dom/svg/SVGAnimatedInteger.cpp rename : dom/svg/SVGInteger.h => dom/svg/SVGAnimatedInteger.h rename : dom/svg/SVGIntegerPair.cpp => dom/svg/SVGAnimatedIntegerPair.cpp rename : dom/svg/SVGIntegerPair.h => dom/svg/SVGAnimatedIntegerPair.h rename : dom/svg/SVGNumberPair.cpp => dom/svg/SVGAnimatedNumberPair.cpp rename : dom/svg/SVGNumberPair.h => dom/svg/SVGAnimatedNumberPair.h rename : dom/svg/SVGOrient.cpp => dom/svg/SVGAnimatedOrient.cpp rename : dom/svg/SVGOrient.h => dom/svg/SVGAnimatedOrient.h rename : dom/svg/SVGString.cpp => dom/svg/SVGAnimatedString.cpp rename : dom/svg/SVGString.h => dom/svg/SVGAnimatedString.h rename : dom/svg/SVGViewBox.cpp => dom/svg/SVGAnimatedViewBox.cpp rename : dom/svg/SVGViewBox.h => dom/svg/SVGAnimatedViewBox.h
This commit is contained in:
parent
4286c73927
commit
bff06425af
@ -400,11 +400,12 @@ void nsAttrValue::SetToSerialized(const nsAttrValue& aOther) {
|
||||
}
|
||||
}
|
||||
|
||||
void nsAttrValue::SetTo(const SVGOrient& aValue, const nsAString* aSerialized) {
|
||||
void nsAttrValue::SetTo(const SVGAnimatedOrient& aValue,
|
||||
const nsAString* aSerialized) {
|
||||
SetSVGType(eSVGOrient, &aValue, aSerialized);
|
||||
}
|
||||
|
||||
void nsAttrValue::SetTo(const SVGIntegerPair& aValue,
|
||||
void nsAttrValue::SetTo(const SVGAnimatedIntegerPair& aValue,
|
||||
const nsAString* aSerialized) {
|
||||
SetSVGType(eSVGIntegerPair, &aValue, aSerialized);
|
||||
}
|
||||
@ -434,7 +435,7 @@ void nsAttrValue::SetTo(const SVGNumberList& aValue,
|
||||
SetSVGType(eSVGNumberList, &aValue, aSerialized);
|
||||
}
|
||||
|
||||
void nsAttrValue::SetTo(const SVGNumberPair& aValue,
|
||||
void nsAttrValue::SetTo(const SVGAnimatedNumberPair& aValue,
|
||||
const nsAString* aSerialized) {
|
||||
SetSVGType(eSVGNumberPair, &aValue, aSerialized);
|
||||
}
|
||||
@ -484,7 +485,7 @@ void nsAttrValue::SetTo(const SVGTransformList& aValue,
|
||||
SetSVGType(eSVGTransformList, &aValue, aSerialized);
|
||||
}
|
||||
|
||||
void nsAttrValue::SetTo(const SVGViewBox& aValue,
|
||||
void nsAttrValue::SetTo(const SVGAnimatedViewBox& aValue,
|
||||
const nsAString* aSerialized) {
|
||||
SetSVGType(eSVGViewBox, &aValue, aSerialized);
|
||||
}
|
||||
@ -566,13 +567,13 @@ void nsAttrValue::ToString(nsAString& aResult) const {
|
||||
break;
|
||||
}
|
||||
case eSVGIntegerPair: {
|
||||
SVGAttrValueWrapper::ToString(GetMiscContainer()->mValue.mSVGIntegerPair,
|
||||
aResult);
|
||||
SVGAttrValueWrapper::ToString(
|
||||
GetMiscContainer()->mValue.mSVGAnimatedIntegerPair, aResult);
|
||||
break;
|
||||
}
|
||||
case eSVGOrient: {
|
||||
SVGAttrValueWrapper::ToString(GetMiscContainer()->mValue.mSVGOrient,
|
||||
aResult);
|
||||
SVGAttrValueWrapper::ToString(
|
||||
GetMiscContainer()->mValue.mSVGAnimatedOrient, aResult);
|
||||
break;
|
||||
}
|
||||
case eSVGLength: {
|
||||
@ -591,8 +592,8 @@ void nsAttrValue::ToString(nsAString& aResult) const {
|
||||
break;
|
||||
}
|
||||
case eSVGNumberPair: {
|
||||
SVGAttrValueWrapper::ToString(GetMiscContainer()->mValue.mSVGNumberPair,
|
||||
aResult);
|
||||
SVGAttrValueWrapper::ToString(
|
||||
GetMiscContainer()->mValue.mSVGAnimatedNumberPair, aResult);
|
||||
break;
|
||||
}
|
||||
case eSVGPathData: {
|
||||
@ -607,7 +608,7 @@ void nsAttrValue::ToString(nsAString& aResult) const {
|
||||
}
|
||||
case eSVGPreserveAspectRatio: {
|
||||
SVGAttrValueWrapper::ToString(
|
||||
GetMiscContainer()->mValue.mSVGPreserveAspectRatio, aResult);
|
||||
GetMiscContainer()->mValue.mSVGAnimatedPreserveAspectRatio, aResult);
|
||||
break;
|
||||
}
|
||||
case eSVGStringList: {
|
||||
@ -621,8 +622,8 @@ void nsAttrValue::ToString(nsAString& aResult) const {
|
||||
break;
|
||||
}
|
||||
case eSVGViewBox: {
|
||||
SVGAttrValueWrapper::ToString(GetMiscContainer()->mValue.mSVGViewBox,
|
||||
aResult);
|
||||
SVGAttrValueWrapper::ToString(
|
||||
GetMiscContainer()->mValue.mSVGAnimatedViewBox, aResult);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
@ -151,25 +151,27 @@ class nsAttrValue {
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(nsIURI* aValue, const nsAString* aSerialized);
|
||||
void SetTo(const nsIntMargin& aValue);
|
||||
void SetTo(const mozilla::SVGOrient& aValue, const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGIntegerPair& aValue,
|
||||
void SetTo(const mozilla::SVGAnimatedIntegerPair& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const nsSVGLength2& aValue, const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGAnimatedNumberPair& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGAnimatedOrient& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGAnimatedPreserveAspectRatio& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGAnimatedViewBox& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGLengthList& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGNumberList& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGNumberPair& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGPathData& aValue, const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGPointList& aValue, const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGAnimatedPreserveAspectRatio& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGStringList& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGTransformList& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGViewBox& aValue, const nsAString* aSerialized);
|
||||
|
||||
/**
|
||||
* Sets this object with the string or atom representation of aValue.
|
||||
|
@ -44,18 +44,19 @@ struct MiscContainer final {
|
||||
nsIURI* mURL;
|
||||
mozilla::AtomArray* mAtomArray;
|
||||
nsIntMargin* mIntMargin;
|
||||
const mozilla::SVGIntegerPair* mSVGIntegerPair;
|
||||
const mozilla::SVGAnimatedIntegerPair* mSVGAnimatedIntegerPair;
|
||||
const mozilla::SVGAnimatedPreserveAspectRatio*
|
||||
mSVGAnimatedPreserveAspectRatio;
|
||||
const mozilla::SVGAnimatedNumberPair* mSVGAnimatedNumberPair;
|
||||
const mozilla::SVGAnimatedOrient* mSVGAnimatedOrient;
|
||||
const nsSVGLength2* mSVGLength;
|
||||
const mozilla::SVGAnimatedViewBox* mSVGAnimatedViewBox;
|
||||
const mozilla::SVGLengthList* mSVGLengthList;
|
||||
const mozilla::SVGNumberList* mSVGNumberList;
|
||||
const mozilla::SVGNumberPair* mSVGNumberPair;
|
||||
const mozilla::SVGOrient* mSVGOrient;
|
||||
const mozilla::SVGPathData* mSVGPathData;
|
||||
const mozilla::SVGPointList* mSVGPointList;
|
||||
const mozilla::SVGAnimatedPreserveAspectRatio* mSVGPreserveAspectRatio;
|
||||
const mozilla::SVGStringList* mSVGStringList;
|
||||
const mozilla::SVGTransformList* mSVGTransformList;
|
||||
const mozilla::SVGViewBox* mSVGViewBox;
|
||||
};
|
||||
uint32_t mRefCount : 31;
|
||||
uint32_t mCached : 1;
|
||||
|
@ -5,7 +5,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "DOMSVGAngle.h"
|
||||
#include "SVGOrient.h"
|
||||
#include "SVGAnimatedOrient.h"
|
||||
#include "mozilla/dom/SVGAngleBinding.h"
|
||||
#include "mozilla/dom/SVGSVGElement.h"
|
||||
|
||||
@ -19,7 +19,7 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGAngle, Release)
|
||||
|
||||
DOMSVGAngle::DOMSVGAngle(SVGSVGElement* aSVGElement)
|
||||
: mSVGElement(aSVGElement), mType(DOMSVGAngle::CreatedValue) {
|
||||
mVal = new SVGOrient();
|
||||
mVal = new SVGAnimatedOrient();
|
||||
mVal->Init();
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class SVGOrient;
|
||||
class SVGAnimatedOrient;
|
||||
|
||||
namespace dom {
|
||||
class SVGSVGElement;
|
||||
@ -28,7 +28,7 @@ class DOMSVGAngle final : public nsWrapperCache {
|
||||
/**
|
||||
* Generic ctor for DOMSVGAngle objects that are created for an attribute.
|
||||
*/
|
||||
DOMSVGAngle(SVGOrient* aVal, SVGElement* aSVGElement, AngleType aType)
|
||||
DOMSVGAngle(SVGAnimatedOrient* aVal, SVGElement* aSVGElement, AngleType aType)
|
||||
: mVal(aVal), mSVGElement(aSVGElement), mType(aType) {}
|
||||
|
||||
/**
|
||||
@ -54,8 +54,8 @@ class DOMSVGAngle final : public nsWrapperCache {
|
||||
protected:
|
||||
~DOMSVGAngle();
|
||||
|
||||
SVGOrient* mVal; // if mType is CreatedValue, we own the angle. Otherwise,
|
||||
// the element does.
|
||||
SVGAnimatedOrient* mVal; // if mType is CreatedValue, we own the angle.
|
||||
// Otherwise, the element does.
|
||||
RefPtr<SVGElement> mSVGElement;
|
||||
AngleType mType;
|
||||
};
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "DOMSVGAnimatedAngle.h"
|
||||
|
||||
#include "SVGOrient.h"
|
||||
#include "SVGAnimatedOrient.h"
|
||||
#include "mozilla/dom/SVGAnimatedAngleBinding.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class SVGOrient;
|
||||
class SVGAnimatedOrient;
|
||||
|
||||
namespace dom {
|
||||
|
||||
@ -24,7 +24,7 @@ class DOMSVGAnimatedAngle final : public nsWrapperCache {
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGAnimatedAngle)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGAnimatedAngle)
|
||||
|
||||
DOMSVGAnimatedAngle(SVGOrient* aVal, SVGElement* aSVGElement)
|
||||
DOMSVGAnimatedAngle(SVGAnimatedOrient* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// WebIDL
|
||||
@ -37,7 +37,7 @@ class DOMSVGAnimatedAngle final : public nsWrapperCache {
|
||||
protected:
|
||||
~DOMSVGAnimatedAngle();
|
||||
|
||||
SVGOrient* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedOrient* mVal; // kept alive because it belongs to content
|
||||
RefPtr<SVGElement> mSVGElement;
|
||||
};
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef mozilla_dom_DOMSVGAnimatedBoolean_h
|
||||
#define mozilla_dom_DOMSVGAnimatedBoolean_h
|
||||
|
||||
#include "SVGBoolean.h"
|
||||
#include "SVGAnimatedBoolean.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
@ -19,7 +19,7 @@ class DOMSVGAnimatedBoolean final : public nsWrapperCache {
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGAnimatedBoolean)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGAnimatedBoolean)
|
||||
|
||||
DOMSVGAnimatedBoolean(SVGBoolean* aVal, SVGElement* aSVGElement)
|
||||
DOMSVGAnimatedBoolean(SVGAnimatedBoolean* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// WebIDL
|
||||
@ -36,7 +36,7 @@ class DOMSVGAnimatedBoolean final : public nsWrapperCache {
|
||||
protected:
|
||||
~DOMSVGAnimatedBoolean();
|
||||
|
||||
SVGBoolean* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedBoolean* mVal; // kept alive because it belongs to content
|
||||
RefPtr<SVGElement> mSVGElement;
|
||||
};
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "Link.h"
|
||||
#include "nsDOMTokenList.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "mozilla/dom/SVGGraphicsElement.h"
|
||||
|
||||
nsresult NS_NewSVGAElement(
|
||||
@ -98,7 +98,7 @@ class SVGAElement final : public SVGAElementBase, public Link {
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { HREF, XLINK_HREF, TARGET };
|
||||
SVGString mStringAttributes[3];
|
||||
SVGAnimatedString mStringAttributes[3];
|
||||
static StringInfo sStringInfo[3];
|
||||
|
||||
RefPtr<nsDOMTokenList> mRelList;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* 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 "SVGBoolean.h"
|
||||
#include "SVGAnimatedBoolean.h"
|
||||
|
||||
#include "DOMSVGAnimatedBoolean.h"
|
||||
#include "nsError.h"
|
||||
@ -18,9 +18,9 @@ namespace mozilla {
|
||||
|
||||
/* Implementation */
|
||||
|
||||
static inline SVGAttrTearoffTable<SVGBoolean, DOMSVGAnimatedBoolean>&
|
||||
static inline SVGAttrTearoffTable<SVGAnimatedBoolean, DOMSVGAnimatedBoolean>&
|
||||
SVGAnimatedBooleanTearoffTable() {
|
||||
static SVGAttrTearoffTable<SVGBoolean, DOMSVGAnimatedBoolean>
|
||||
static SVGAttrTearoffTable<SVGAnimatedBoolean, DOMSVGAnimatedBoolean>
|
||||
sSVGAnimatedBooleanTearoffTable;
|
||||
return sSVGAnimatedBooleanTearoffTable;
|
||||
}
|
||||
@ -49,8 +49,8 @@ static nsresult GetValueFromAtom(const nsAtom* aValueAsAtom, bool* aValue) {
|
||||
return NS_ERROR_DOM_SYNTAX_ERR;
|
||||
}
|
||||
|
||||
nsresult SVGBoolean::SetBaseValueAtom(const nsAtom* aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
nsresult SVGAnimatedBoolean::SetBaseValueAtom(const nsAtom* aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
bool val = false;
|
||||
|
||||
nsresult rv = GetValueFromAtom(aValue, &val);
|
||||
@ -71,11 +71,11 @@ nsresult SVGBoolean::SetBaseValueAtom(const nsAtom* aValue,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAtom* SVGBoolean::GetBaseValueAtom() const {
|
||||
nsAtom* SVGAnimatedBoolean::GetBaseValueAtom() const {
|
||||
return mBaseVal ? nsGkAtoms::_true : nsGkAtoms::_false;
|
||||
}
|
||||
|
||||
void SVGBoolean::SetBaseValue(bool aValue, SVGElement* aSVGElement) {
|
||||
void SVGAnimatedBoolean::SetBaseValue(bool aValue, SVGElement* aSVGElement) {
|
||||
if (aValue == mBaseVal) {
|
||||
return;
|
||||
}
|
||||
@ -89,7 +89,7 @@ void SVGBoolean::SetBaseValue(bool aValue, SVGElement* aSVGElement) {
|
||||
aSVGElement->DidChangeBoolean(mAttrEnum);
|
||||
}
|
||||
|
||||
void SVGBoolean::SetAnimValue(bool aValue, SVGElement* aSVGElement) {
|
||||
void SVGAnimatedBoolean::SetAnimValue(bool aValue, SVGElement* aSVGElement) {
|
||||
if (mIsAnimated && mAnimVal == aValue) {
|
||||
return;
|
||||
}
|
||||
@ -98,8 +98,8 @@ void SVGBoolean::SetAnimValue(bool aValue, SVGElement* aSVGElement) {
|
||||
aSVGElement->DidAnimateBoolean(mAttrEnum);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedBoolean> SVGBoolean::ToDOMAnimatedBoolean(
|
||||
SVGElement* aSVGElement) {
|
||||
already_AddRefed<DOMSVGAnimatedBoolean>
|
||||
SVGAnimatedBoolean::ToDOMAnimatedBoolean(SVGElement* aSVGElement) {
|
||||
RefPtr<DOMSVGAnimatedBoolean> domAnimatedBoolean =
|
||||
SVGAnimatedBooleanTearoffTable().GetTearoff(this);
|
||||
if (!domAnimatedBoolean) {
|
||||
@ -114,11 +114,11 @@ DOMSVGAnimatedBoolean::~DOMSVGAnimatedBoolean() {
|
||||
SVGAnimatedBooleanTearoffTable().RemoveTearoff(mVal);
|
||||
}
|
||||
|
||||
UniquePtr<SMILAttr> SVGBoolean::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
UniquePtr<SMILAttr> SVGAnimatedBoolean::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
return MakeUnique<SMILBool>(this, aSVGElement);
|
||||
}
|
||||
|
||||
nsresult SVGBoolean::SMILBool::ValueFromString(
|
||||
nsresult SVGAnimatedBoolean::SMILBool::ValueFromString(
|
||||
const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/,
|
||||
SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
|
||||
bool value;
|
||||
@ -134,13 +134,13 @@ nsresult SVGBoolean::SMILBool::ValueFromString(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SMILValue SVGBoolean::SMILBool::GetBaseValue() const {
|
||||
SMILValue SVGAnimatedBoolean::SMILBool::GetBaseValue() const {
|
||||
SMILValue val(SMILBoolType::Singleton());
|
||||
val.mU.mBool = mVal->mBaseVal;
|
||||
return val;
|
||||
}
|
||||
|
||||
void SVGBoolean::SMILBool::ClearAnimValue() {
|
||||
void SVGAnimatedBoolean::SMILBool::ClearAnimValue() {
|
||||
if (mVal->mIsAnimated) {
|
||||
mVal->mIsAnimated = false;
|
||||
mVal->mAnimVal = mVal->mBaseVal;
|
||||
@ -148,7 +148,7 @@ void SVGBoolean::SMILBool::ClearAnimValue() {
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGBoolean::SMILBool::SetAnimValue(const SMILValue& aValue) {
|
||||
nsresult SVGAnimatedBoolean::SMILBool::SetAnimValue(const SMILValue& aValue) {
|
||||
NS_ASSERTION(aValue.mType == SMILBoolType::Singleton(),
|
||||
"Unexpected type to assign animated value");
|
||||
if (aValue.mType == SMILBoolType::Singleton()) {
|
@ -25,7 +25,7 @@ class SVGAnimationElement;
|
||||
class SVGElement;
|
||||
} // namespace dom
|
||||
|
||||
class SVGBoolean {
|
||||
class SVGAnimatedBoolean {
|
||||
public:
|
||||
typedef mozilla::dom::SVGElement SVGElement;
|
||||
|
||||
@ -57,13 +57,13 @@ class SVGBoolean {
|
||||
public:
|
||||
struct SMILBool : public SMILAttr {
|
||||
public:
|
||||
SMILBool(SVGBoolean* aVal, SVGElement* aSVGElement)
|
||||
SMILBool(SVGAnimatedBoolean* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a SMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
SVGBoolean* mVal;
|
||||
SVGAnimatedBoolean* mVal;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// SMILAttr methods
|
@ -4,7 +4,7 @@
|
||||
* 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 "SVGClass.h"
|
||||
#include "SVGAnimatedClass.h"
|
||||
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
#include "mozilla/Move.h"
|
||||
@ -16,15 +16,15 @@ namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
// DOM wrapper class for the (DOM)SVGAnimatedString interface where the
|
||||
// wrapped class is SVGClass.
|
||||
// wrapped class is SVGAnimatedClass.
|
||||
struct DOMAnimatedString final : public DOMSVGAnimatedString {
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimatedString)
|
||||
|
||||
DOMAnimatedString(SVGClass* aVal, SVGElement* aSVGElement)
|
||||
DOMAnimatedString(SVGAnimatedClass* aVal, SVGElement* aSVGElement)
|
||||
: DOMSVGAnimatedString(aSVGElement), mVal(aVal) {}
|
||||
|
||||
SVGClass* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedClass* mVal; // kept alive because it belongs to content
|
||||
|
||||
void GetBaseVal(nsAString& aResult) override {
|
||||
mVal->GetBaseValue(aResult, mSVGElement);
|
||||
@ -50,7 +50,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMAnimatedString)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedString> SVGClass::ToDOMAnimatedString(
|
||||
already_AddRefed<DOMSVGAnimatedString> SVGAnimatedClass::ToDOMAnimatedString(
|
||||
SVGElement* aSVGElement) {
|
||||
RefPtr<DOMAnimatedString> result = new DOMAnimatedString(this, aSVGElement);
|
||||
return result.forget();
|
||||
@ -58,8 +58,8 @@ already_AddRefed<DOMSVGAnimatedString> SVGClass::ToDOMAnimatedString(
|
||||
|
||||
/* Implementation */
|
||||
|
||||
void SVGClass::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement,
|
||||
bool aDoSetAttr) {
|
||||
void SVGAnimatedClass::SetBaseValue(const nsAString& aValue,
|
||||
SVGElement* aSVGElement, bool aDoSetAttr) {
|
||||
NS_ASSERTION(aSVGElement, "Null element passed to SetBaseValue");
|
||||
|
||||
aSVGElement->SetMayHaveClass();
|
||||
@ -71,13 +71,13 @@ void SVGClass::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement,
|
||||
}
|
||||
}
|
||||
|
||||
void SVGClass::GetBaseValue(nsAString& aValue,
|
||||
const SVGElement* aSVGElement) const {
|
||||
void SVGAnimatedClass::GetBaseValue(nsAString& aValue,
|
||||
const SVGElement* aSVGElement) const {
|
||||
aSVGElement->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aValue);
|
||||
}
|
||||
|
||||
void SVGClass::GetAnimValue(nsAString& aResult,
|
||||
const SVGElement* aSVGElement) const {
|
||||
void SVGAnimatedClass::GetAnimValue(nsAString& aResult,
|
||||
const SVGElement* aSVGElement) const {
|
||||
if (mAnimVal) {
|
||||
aResult = *mAnimVal;
|
||||
return;
|
||||
@ -86,7 +86,8 @@ void SVGClass::GetAnimValue(nsAString& aResult,
|
||||
aSVGElement->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aResult);
|
||||
}
|
||||
|
||||
void SVGClass::SetAnimValue(const nsAString& aValue, SVGElement* aSVGElement) {
|
||||
void SVGAnimatedClass::SetAnimValue(const nsAString& aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
if (mAnimVal && mAnimVal->Equals(aValue)) {
|
||||
return;
|
||||
}
|
||||
@ -103,11 +104,11 @@ void DOMAnimatedString::GetAnimVal(nsAString& aResult) {
|
||||
mVal->GetAnimValue(aResult, mSVGElement);
|
||||
}
|
||||
|
||||
UniquePtr<SMILAttr> SVGClass::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
UniquePtr<SMILAttr> SVGAnimatedClass::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
return MakeUnique<SMILString>(this, aSVGElement);
|
||||
}
|
||||
|
||||
nsresult SVGClass::SMILString::ValueFromString(
|
||||
nsresult SVGAnimatedClass::SMILString::ValueFromString(
|
||||
const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
|
||||
SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
|
||||
SMILValue val(SMILStringType::Singleton());
|
||||
@ -118,21 +119,21 @@ nsresult SVGClass::SMILString::ValueFromString(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SMILValue SVGClass::SMILString::GetBaseValue() const {
|
||||
SMILValue SVGAnimatedClass::SMILString::GetBaseValue() const {
|
||||
SMILValue val(SMILStringType::Singleton());
|
||||
mSVGElement->GetAttr(kNameSpaceID_None, nsGkAtoms::_class,
|
||||
*static_cast<nsAString*>(val.mU.mPtr));
|
||||
return val;
|
||||
}
|
||||
|
||||
void SVGClass::SMILString::ClearAnimValue() {
|
||||
void SVGAnimatedClass::SMILString::ClearAnimValue() {
|
||||
if (mVal->mAnimVal) {
|
||||
mVal->mAnimVal = nullptr;
|
||||
mSVGElement->DidAnimateClass();
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGClass::SMILString::SetAnimValue(const SMILValue& aValue) {
|
||||
nsresult SVGAnimatedClass::SMILString::SetAnimValue(const SMILValue& aValue) {
|
||||
NS_ASSERTION(aValue.mType == SMILStringType::Singleton(),
|
||||
"Unexpected type to assign animated value");
|
||||
if (aValue.mType == SMILStringType::Singleton()) {
|
@ -23,7 +23,7 @@ namespace dom {
|
||||
class DOMSVGAnimatedString;
|
||||
class SVGElement;
|
||||
|
||||
class SVGClass {
|
||||
class SVGAnimatedClass {
|
||||
public:
|
||||
typedef mozilla::dom::SVGElement SVGElement;
|
||||
|
||||
@ -48,13 +48,13 @@ class SVGClass {
|
||||
public:
|
||||
struct SMILString : public SMILAttr {
|
||||
public:
|
||||
SMILString(SVGClass* aVal, SVGElement* aSVGElement)
|
||||
SMILString(SVGAnimatedClass* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a SMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
SVGClass* mVal;
|
||||
SVGAnimatedClass* mVal;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// SMILAttr methods
|
@ -4,7 +4,7 @@
|
||||
* 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 "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
#include "mozilla/SMILValue.h"
|
||||
@ -17,10 +17,12 @@ using namespace mozilla::dom;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
static SVGAttrTearoffTable<SVGEnum, SVGEnum::DOMAnimatedEnum>
|
||||
static SVGAttrTearoffTable<SVGAnimatedEnumeration,
|
||||
SVGAnimatedEnumeration::DOMAnimatedEnum>
|
||||
sSVGAnimatedEnumTearoffTable;
|
||||
|
||||
const SVGEnumMapping* SVGEnum::GetMapping(SVGElement* aSVGElement) {
|
||||
const SVGEnumMapping* SVGAnimatedEnumeration::GetMapping(
|
||||
SVGElement* aSVGElement) {
|
||||
SVGElement::EnumAttributesInfo info = aSVGElement->GetEnumInfo();
|
||||
|
||||
NS_ASSERTION(info.mEnumCount > 0 && mAttrEnum < info.mEnumCount,
|
||||
@ -29,8 +31,8 @@ const SVGEnumMapping* SVGEnum::GetMapping(SVGElement* aSVGElement) {
|
||||
return info.mEnumInfo[mAttrEnum].mMapping;
|
||||
}
|
||||
|
||||
nsresult SVGEnum::SetBaseValueAtom(const nsAtom* aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
nsresult SVGAnimatedEnumeration::SetBaseValueAtom(const nsAtom* aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
const SVGEnumMapping* mapping = GetMapping(aSVGElement);
|
||||
|
||||
while (mapping && mapping->mKey) {
|
||||
@ -55,7 +57,7 @@ nsresult SVGEnum::SetBaseValueAtom(const nsAtom* aValue,
|
||||
return NS_ERROR_DOM_TYPE_ERR;
|
||||
}
|
||||
|
||||
nsAtom* SVGEnum::GetBaseValueAtom(SVGElement* aSVGElement) {
|
||||
nsAtom* SVGAnimatedEnumeration::GetBaseValueAtom(SVGElement* aSVGElement) {
|
||||
const SVGEnumMapping* mapping = GetMapping(aSVGElement);
|
||||
|
||||
while (mapping && mapping->mKey) {
|
||||
@ -68,7 +70,8 @@ nsAtom* SVGEnum::GetBaseValueAtom(SVGElement* aSVGElement) {
|
||||
return nsGkAtoms::_empty;
|
||||
}
|
||||
|
||||
nsresult SVGEnum::SetBaseValue(uint16_t aValue, SVGElement* aSVGElement) {
|
||||
nsresult SVGAnimatedEnumeration::SetBaseValue(uint16_t aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
const SVGEnumMapping* mapping = GetMapping(aSVGElement);
|
||||
|
||||
while (mapping && mapping->mKey) {
|
||||
@ -90,7 +93,8 @@ nsresult SVGEnum::SetBaseValue(uint16_t aValue, SVGElement* aSVGElement) {
|
||||
return NS_ERROR_DOM_TYPE_ERR;
|
||||
}
|
||||
|
||||
void SVGEnum::SetAnimValue(uint16_t aValue, SVGElement* aSVGElement) {
|
||||
void SVGAnimatedEnumeration::SetAnimValue(uint16_t aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsAnimated && aValue == mAnimVal) {
|
||||
return;
|
||||
}
|
||||
@ -99,8 +103,8 @@ void SVGEnum::SetAnimValue(uint16_t aValue, SVGElement* aSVGElement) {
|
||||
aSVGElement->DidAnimateEnum(mAttrEnum);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedEnumeration> SVGEnum::ToDOMAnimatedEnum(
|
||||
SVGElement* aSVGElement) {
|
||||
already_AddRefed<DOMSVGAnimatedEnumeration>
|
||||
SVGAnimatedEnumeration::ToDOMAnimatedEnum(SVGElement* aSVGElement) {
|
||||
RefPtr<DOMAnimatedEnum> domAnimatedEnum =
|
||||
sSVGAnimatedEnumTearoffTable.GetTearoff(this);
|
||||
if (!domAnimatedEnum) {
|
||||
@ -111,15 +115,16 @@ already_AddRefed<DOMSVGAnimatedEnumeration> SVGEnum::ToDOMAnimatedEnum(
|
||||
return domAnimatedEnum.forget();
|
||||
}
|
||||
|
||||
SVGEnum::DOMAnimatedEnum::~DOMAnimatedEnum() {
|
||||
SVGAnimatedEnumeration::DOMAnimatedEnum::~DOMAnimatedEnum() {
|
||||
sSVGAnimatedEnumTearoffTable.RemoveTearoff(mVal);
|
||||
}
|
||||
|
||||
UniquePtr<SMILAttr> SVGEnum::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
UniquePtr<SMILAttr> SVGAnimatedEnumeration::ToSMILAttr(
|
||||
SVGElement* aSVGElement) {
|
||||
return MakeUnique<SMILEnum>(this, aSVGElement);
|
||||
}
|
||||
|
||||
nsresult SVGEnum::SMILEnum::ValueFromString(
|
||||
nsresult SVGAnimatedEnumeration::SMILEnum::ValueFromString(
|
||||
const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/,
|
||||
SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
|
||||
nsAtom* valAtom = NS_GetStaticAtom(aStr);
|
||||
@ -143,13 +148,13 @@ nsresult SVGEnum::SMILEnum::ValueFromString(
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
SMILValue SVGEnum::SMILEnum::GetBaseValue() const {
|
||||
SMILValue SVGAnimatedEnumeration::SMILEnum::GetBaseValue() const {
|
||||
SMILValue val(SMILEnumType::Singleton());
|
||||
val.mU.mUint = mVal->mBaseVal;
|
||||
return val;
|
||||
}
|
||||
|
||||
void SVGEnum::SMILEnum::ClearAnimValue() {
|
||||
void SVGAnimatedEnumeration::SMILEnum::ClearAnimValue() {
|
||||
if (mVal->mIsAnimated) {
|
||||
mVal->mIsAnimated = false;
|
||||
mVal->mAnimVal = mVal->mBaseVal;
|
||||
@ -157,7 +162,8 @@ void SVGEnum::SMILEnum::ClearAnimValue() {
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGEnum::SMILEnum::SetAnimValue(const SMILValue& aValue) {
|
||||
nsresult SVGAnimatedEnumeration::SMILEnum::SetAnimValue(
|
||||
const SMILValue& aValue) {
|
||||
NS_ASSERTION(aValue.mType == SMILEnumType::Singleton(),
|
||||
"Unexpected type to assign animated value");
|
||||
if (aValue.mType == SMILEnumType::Singleton()) {
|
@ -32,7 +32,7 @@ struct SVGEnumMapping {
|
||||
const SVGEnumValue mVal;
|
||||
};
|
||||
|
||||
class SVGEnum {
|
||||
class SVGAnimatedEnumeration {
|
||||
public:
|
||||
typedef mozilla::dom::SVGElement SVGElement;
|
||||
|
||||
@ -68,14 +68,14 @@ class SVGEnum {
|
||||
|
||||
public:
|
||||
// DOM wrapper class for the (DOM)SVGAnimatedEnumeration interface where the
|
||||
// wrapped class is SVGEnum.
|
||||
// wrapped class is SVGAnimatedEnumeration.
|
||||
struct DOMAnimatedEnum final
|
||||
: public mozilla::dom::DOMSVGAnimatedEnumeration {
|
||||
DOMAnimatedEnum(SVGEnum* aVal, SVGElement* aSVGElement)
|
||||
DOMAnimatedEnum(SVGAnimatedEnumeration* aVal, SVGElement* aSVGElement)
|
||||
: mozilla::dom::DOMSVGAnimatedEnumeration(aSVGElement), mVal(aVal) {}
|
||||
virtual ~DOMAnimatedEnum();
|
||||
|
||||
SVGEnum* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedEnumeration* mVal; // kept alive because it belongs to content
|
||||
|
||||
using mozilla::dom::DOMSVGAnimatedEnumeration::SetBaseVal;
|
||||
virtual uint16_t BaseVal() override { return mVal->GetBaseValue(); }
|
||||
@ -94,13 +94,13 @@ class SVGEnum {
|
||||
|
||||
struct SMILEnum : public SMILAttr {
|
||||
public:
|
||||
SMILEnum(SVGEnum* aVal, SVGElement* aSVGElement)
|
||||
SMILEnum(SVGAnimatedEnumeration* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a SMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
SVGEnum* mVal;
|
||||
SVGAnimatedEnumeration* mVal;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// SMILAttr methods
|
@ -4,7 +4,7 @@
|
||||
* 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 "SVGInteger.h"
|
||||
#include "SVGAnimatedInteger.h"
|
||||
|
||||
#include "nsError.h"
|
||||
#include "SMILIntegerType.h"
|
||||
@ -18,11 +18,12 @@ namespace mozilla {
|
||||
|
||||
/* Implementation */
|
||||
|
||||
static SVGAttrTearoffTable<SVGInteger, SVGInteger::DOMAnimatedInteger>
|
||||
static SVGAttrTearoffTable<SVGAnimatedInteger,
|
||||
SVGAnimatedInteger::DOMAnimatedInteger>
|
||||
sSVGAnimatedIntegerTearoffTable;
|
||||
|
||||
nsresult SVGInteger::SetBaseValueString(const nsAString &aValueAsString,
|
||||
SVGElement *aSVGElement) {
|
||||
nsresult SVGAnimatedInteger::SetBaseValueString(const nsAString &aValueAsString,
|
||||
SVGElement *aSVGElement) {
|
||||
bool success;
|
||||
auto token = SVGContentUtils::GetAndEnsureOneToken(aValueAsString, success);
|
||||
|
||||
@ -46,12 +47,12 @@ nsresult SVGInteger::SetBaseValueString(const nsAString &aValueAsString,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void SVGInteger::GetBaseValueString(nsAString &aValueAsString) {
|
||||
void SVGAnimatedInteger::GetBaseValueString(nsAString &aValueAsString) {
|
||||
aValueAsString.Truncate();
|
||||
aValueAsString.AppendInt(mBaseVal);
|
||||
}
|
||||
|
||||
void SVGInteger::SetBaseValue(int aValue, SVGElement *aSVGElement) {
|
||||
void SVGAnimatedInteger::SetBaseValue(int aValue, SVGElement *aSVGElement) {
|
||||
// We can't just rely on SetParsedAttrValue (as called by DidChangeInteger)
|
||||
// detecting redundant changes since it will compare false if the existing
|
||||
// attribute value has an associated serialized version (a string value) even
|
||||
@ -70,7 +71,7 @@ void SVGInteger::SetBaseValue(int aValue, SVGElement *aSVGElement) {
|
||||
aSVGElement->DidChangeInteger(mAttrEnum);
|
||||
}
|
||||
|
||||
void SVGInteger::SetAnimValue(int aValue, SVGElement *aSVGElement) {
|
||||
void SVGAnimatedInteger::SetAnimValue(int aValue, SVGElement *aSVGElement) {
|
||||
if (mIsAnimated && aValue == mAnimVal) {
|
||||
return;
|
||||
}
|
||||
@ -79,8 +80,8 @@ void SVGInteger::SetAnimValue(int aValue, SVGElement *aSVGElement) {
|
||||
aSVGElement->DidAnimateInteger(mAttrEnum);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedInteger> SVGInteger::ToDOMAnimatedInteger(
|
||||
SVGElement *aSVGElement) {
|
||||
already_AddRefed<DOMSVGAnimatedInteger>
|
||||
SVGAnimatedInteger::ToDOMAnimatedInteger(SVGElement *aSVGElement) {
|
||||
RefPtr<DOMAnimatedInteger> domAnimatedInteger =
|
||||
sSVGAnimatedIntegerTearoffTable.GetTearoff(this);
|
||||
if (!domAnimatedInteger) {
|
||||
@ -91,15 +92,15 @@ already_AddRefed<DOMSVGAnimatedInteger> SVGInteger::ToDOMAnimatedInteger(
|
||||
return domAnimatedInteger.forget();
|
||||
}
|
||||
|
||||
SVGInteger::DOMAnimatedInteger::~DOMAnimatedInteger() {
|
||||
SVGAnimatedInteger::DOMAnimatedInteger::~DOMAnimatedInteger() {
|
||||
sSVGAnimatedIntegerTearoffTable.RemoveTearoff(mVal);
|
||||
}
|
||||
|
||||
UniquePtr<SMILAttr> SVGInteger::ToSMILAttr(SVGElement *aSVGElement) {
|
||||
UniquePtr<SMILAttr> SVGAnimatedInteger::ToSMILAttr(SVGElement *aSVGElement) {
|
||||
return MakeUnique<SMILInteger>(this, aSVGElement);
|
||||
}
|
||||
|
||||
nsresult SVGInteger::SMILInteger::ValueFromString(
|
||||
nsresult SVGAnimatedInteger::SMILInteger::ValueFromString(
|
||||
const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/,
|
||||
SMILValue &aValue, bool &aPreventCachingOfSandwich) const {
|
||||
int32_t val;
|
||||
@ -115,13 +116,13 @@ nsresult SVGInteger::SMILInteger::ValueFromString(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SMILValue SVGInteger::SMILInteger::GetBaseValue() const {
|
||||
SMILValue SVGAnimatedInteger::SMILInteger::GetBaseValue() const {
|
||||
SMILValue val(SMILIntegerType::Singleton());
|
||||
val.mU.mInt = mVal->mBaseVal;
|
||||
return val;
|
||||
}
|
||||
|
||||
void SVGInteger::SMILInteger::ClearAnimValue() {
|
||||
void SVGAnimatedInteger::SMILInteger::ClearAnimValue() {
|
||||
if (mVal->mIsAnimated) {
|
||||
mVal->mIsAnimated = false;
|
||||
mVal->mAnimVal = mVal->mBaseVal;
|
||||
@ -129,7 +130,8 @@ void SVGInteger::SMILInteger::ClearAnimValue() {
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGInteger::SMILInteger::SetAnimValue(const SMILValue &aValue) {
|
||||
nsresult SVGAnimatedInteger::SMILInteger::SetAnimValue(
|
||||
const SMILValue &aValue) {
|
||||
NS_ASSERTION(aValue.mType == SMILIntegerType::Singleton(),
|
||||
"Unexpected type to assign animated value");
|
||||
if (aValue.mType == SMILIntegerType::Singleton()) {
|
@ -23,7 +23,7 @@ namespace dom {
|
||||
class SVGAnimationElement;
|
||||
} // namespace dom
|
||||
|
||||
class SVGInteger {
|
||||
class SVGAnimatedInteger {
|
||||
public:
|
||||
typedef mozilla::dom::SVGElement SVGElement;
|
||||
|
||||
@ -63,11 +63,11 @@ class SVGInteger {
|
||||
|
||||
public:
|
||||
struct DOMAnimatedInteger final : public mozilla::dom::DOMSVGAnimatedInteger {
|
||||
DOMAnimatedInteger(SVGInteger* aVal, SVGElement* aSVGElement)
|
||||
DOMAnimatedInteger(SVGAnimatedInteger* aVal, SVGElement* aSVGElement)
|
||||
: mozilla::dom::DOMSVGAnimatedInteger(aSVGElement), mVal(aVal) {}
|
||||
virtual ~DOMAnimatedInteger();
|
||||
|
||||
SVGInteger* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedInteger* mVal; // kept alive because it belongs to content
|
||||
|
||||
virtual int32_t BaseVal() override { return mVal->GetBaseValue(); }
|
||||
virtual void SetBaseVal(int32_t aValue) override {
|
||||
@ -84,13 +84,13 @@ class SVGInteger {
|
||||
|
||||
struct SMILInteger : public SMILAttr {
|
||||
public:
|
||||
SMILInteger(SVGInteger* aVal, SVGElement* aSVGElement)
|
||||
SMILInteger(SVGAnimatedInteger* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a SMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
SVGInteger* mVal;
|
||||
SVGAnimatedInteger* mVal;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// SMILAttr methods
|
@ -4,7 +4,7 @@
|
||||
* 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 "SVGIntegerPair.h"
|
||||
#include "SVGAnimatedIntegerPair.h"
|
||||
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
#include "nsError.h"
|
||||
@ -18,9 +18,11 @@ using namespace mozilla::dom;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
static SVGAttrTearoffTable<SVGIntegerPair, SVGIntegerPair::DOMAnimatedInteger>
|
||||
static SVGAttrTearoffTable<SVGAnimatedIntegerPair,
|
||||
SVGAnimatedIntegerPair::DOMAnimatedInteger>
|
||||
sSVGFirstAnimatedIntegerTearoffTable;
|
||||
static SVGAttrTearoffTable<SVGIntegerPair, SVGIntegerPair::DOMAnimatedInteger>
|
||||
static SVGAttrTearoffTable<SVGAnimatedIntegerPair,
|
||||
SVGAnimatedIntegerPair::DOMAnimatedInteger>
|
||||
sSVGSecondAnimatedIntegerTearoffTable;
|
||||
|
||||
/* Implementation */
|
||||
@ -48,8 +50,8 @@ static nsresult ParseIntegerOptionalInteger(const nsAString& aValue,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult SVGIntegerPair::SetBaseValueString(const nsAString& aValueAsString,
|
||||
SVGElement* aSVGElement) {
|
||||
nsresult SVGAnimatedIntegerPair::SetBaseValueString(
|
||||
const nsAString& aValueAsString, SVGElement* aSVGElement) {
|
||||
int32_t val[2];
|
||||
|
||||
nsresult rv = ParseIntegerOptionalInteger(aValueAsString, val);
|
||||
@ -74,7 +76,8 @@ nsresult SVGIntegerPair::SetBaseValueString(const nsAString& aValueAsString,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void SVGIntegerPair::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
void SVGAnimatedIntegerPair::GetBaseValueString(
|
||||
nsAString& aValueAsString) const {
|
||||
aValueAsString.Truncate();
|
||||
aValueAsString.AppendInt(mBaseVal[0]);
|
||||
if (mBaseVal[0] != mBaseVal[1]) {
|
||||
@ -83,8 +86,8 @@ void SVGIntegerPair::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
}
|
||||
}
|
||||
|
||||
void SVGIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGAnimatedIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex,
|
||||
SVGElement* aSVGElement) {
|
||||
uint32_t index = (aPairIndex == eFirst ? 0 : 1);
|
||||
if (mIsBaseSet && mBaseVal[index] == aValue) {
|
||||
return;
|
||||
@ -101,8 +104,8 @@ void SVGIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex,
|
||||
aSVGElement->DidChangeIntegerPair(mAttrEnum, emptyOrOldValue);
|
||||
}
|
||||
|
||||
void SVGIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGAnimatedIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2,
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsBaseSet && mBaseVal[0] == aValue1 && mBaseVal[1] == aValue2) {
|
||||
return;
|
||||
}
|
||||
@ -120,8 +123,8 @@ void SVGIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2,
|
||||
aSVGElement->DidChangeIntegerPair(mAttrEnum, emptyOrOldValue);
|
||||
}
|
||||
|
||||
void SVGIntegerPair::SetAnimValue(const int32_t aValue[2],
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGAnimatedIntegerPair::SetAnimValue(const int32_t aValue[2],
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsAnimated && mAnimVal[0] == aValue[0] && mAnimVal[1] == aValue[1]) {
|
||||
return;
|
||||
}
|
||||
@ -131,8 +134,9 @@ void SVGIntegerPair::SetAnimValue(const int32_t aValue[2],
|
||||
aSVGElement->DidAnimateIntegerPair(mAttrEnum);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedInteger> SVGIntegerPair::ToDOMAnimatedInteger(
|
||||
PairIndex aIndex, SVGElement* aSVGElement) {
|
||||
already_AddRefed<DOMSVGAnimatedInteger>
|
||||
SVGAnimatedIntegerPair::ToDOMAnimatedInteger(PairIndex aIndex,
|
||||
SVGElement* aSVGElement) {
|
||||
RefPtr<DOMAnimatedInteger> domAnimatedInteger =
|
||||
aIndex == eFirst ? sSVGFirstAnimatedIntegerTearoffTable.GetTearoff(this)
|
||||
: sSVGSecondAnimatedIntegerTearoffTable.GetTearoff(this);
|
||||
@ -149,7 +153,7 @@ already_AddRefed<DOMSVGAnimatedInteger> SVGIntegerPair::ToDOMAnimatedInteger(
|
||||
return domAnimatedInteger.forget();
|
||||
}
|
||||
|
||||
SVGIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() {
|
||||
SVGAnimatedIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() {
|
||||
if (mIndex == eFirst) {
|
||||
sSVGFirstAnimatedIntegerTearoffTable.RemoveTearoff(mVal);
|
||||
} else {
|
||||
@ -157,11 +161,12 @@ SVGIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() {
|
||||
}
|
||||
}
|
||||
|
||||
UniquePtr<SMILAttr> SVGIntegerPair::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
UniquePtr<SMILAttr> SVGAnimatedIntegerPair::ToSMILAttr(
|
||||
SVGElement* aSVGElement) {
|
||||
return MakeUnique<SMILIntegerPair>(this, aSVGElement);
|
||||
}
|
||||
|
||||
nsresult SVGIntegerPair::SMILIntegerPair::ValueFromString(
|
||||
nsresult SVGAnimatedIntegerPair::SMILIntegerPair::ValueFromString(
|
||||
const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
|
||||
SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
|
||||
int32_t values[2];
|
||||
@ -180,14 +185,14 @@ nsresult SVGIntegerPair::SMILIntegerPair::ValueFromString(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SMILValue SVGIntegerPair::SMILIntegerPair::GetBaseValue() const {
|
||||
SMILValue SVGAnimatedIntegerPair::SMILIntegerPair::GetBaseValue() const {
|
||||
SMILValue val(SVGIntegerPairSMILType::Singleton());
|
||||
val.mU.mIntPair[0] = mVal->mBaseVal[0];
|
||||
val.mU.mIntPair[1] = mVal->mBaseVal[1];
|
||||
return val;
|
||||
}
|
||||
|
||||
void SVGIntegerPair::SMILIntegerPair::ClearAnimValue() {
|
||||
void SVGAnimatedIntegerPair::SMILIntegerPair::ClearAnimValue() {
|
||||
if (mVal->mIsAnimated) {
|
||||
mVal->mIsAnimated = false;
|
||||
mVal->mAnimVal[0] = mVal->mBaseVal[0];
|
||||
@ -196,7 +201,7 @@ void SVGIntegerPair::SMILIntegerPair::ClearAnimValue() {
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGIntegerPair::SMILIntegerPair::SetAnimValue(
|
||||
nsresult SVGAnimatedIntegerPair::SMILIntegerPair::SetAnimValue(
|
||||
const SMILValue& aValue) {
|
||||
NS_ASSERTION(aValue.mType == SVGIntegerPairSMILType::Singleton(),
|
||||
"Unexpected type to assign animated value");
|
@ -23,7 +23,7 @@ class SVGAnimationElement;
|
||||
class SVGElement;
|
||||
} // namespace dom
|
||||
|
||||
class SVGIntegerPair {
|
||||
class SVGAnimatedIntegerPair {
|
||||
public:
|
||||
typedef mozilla::dom::SVGElement SVGElement;
|
||||
|
||||
@ -71,14 +71,14 @@ class SVGIntegerPair {
|
||||
|
||||
public:
|
||||
struct DOMAnimatedInteger final : public mozilla::dom::DOMSVGAnimatedInteger {
|
||||
DOMAnimatedInteger(SVGIntegerPair* aVal, PairIndex aIndex,
|
||||
DOMAnimatedInteger(SVGAnimatedIntegerPair* aVal, PairIndex aIndex,
|
||||
SVGElement* aSVGElement)
|
||||
: mozilla::dom::DOMSVGAnimatedInteger(aSVGElement),
|
||||
mVal(aVal),
|
||||
mIndex(aIndex) {}
|
||||
virtual ~DOMAnimatedInteger();
|
||||
|
||||
SVGIntegerPair* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedIntegerPair* mVal; // kept alive because it belongs to content
|
||||
PairIndex mIndex; // are we the first or second integer
|
||||
|
||||
virtual int32_t BaseVal() override { return mVal->GetBaseValue(mIndex); }
|
||||
@ -96,13 +96,13 @@ class SVGIntegerPair {
|
||||
|
||||
struct SMILIntegerPair : public SMILAttr {
|
||||
public:
|
||||
SMILIntegerPair(SVGIntegerPair* aVal, SVGElement* aSVGElement)
|
||||
SMILIntegerPair(SVGAnimatedIntegerPair* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a SMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
SVGIntegerPair* mVal;
|
||||
SVGAnimatedIntegerPair* mVal;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// SMILAttr methods
|
@ -4,7 +4,7 @@
|
||||
* 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 "SVGNumberPair.h"
|
||||
#include "SVGAnimatedNumberPair.h"
|
||||
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
#include "SVGAttrTearoffTable.h"
|
||||
@ -16,9 +16,11 @@ using namespace mozilla::dom;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
static SVGAttrTearoffTable<SVGNumberPair, SVGNumberPair::DOMAnimatedNumber>
|
||||
static SVGAttrTearoffTable<SVGAnimatedNumberPair,
|
||||
SVGAnimatedNumberPair::DOMAnimatedNumber>
|
||||
sSVGFirstAnimatedNumberTearoffTable;
|
||||
static SVGAttrTearoffTable<SVGNumberPair, SVGNumberPair::DOMAnimatedNumber>
|
||||
static SVGAttrTearoffTable<SVGAnimatedNumberPair,
|
||||
SVGAnimatedNumberPair::DOMAnimatedNumber>
|
||||
sSVGSecondAnimatedNumberTearoffTable;
|
||||
|
||||
static nsresult ParseNumberOptionalNumber(const nsAString& aValue,
|
||||
@ -44,8 +46,8 @@ static nsresult ParseNumberOptionalNumber(const nsAString& aValue,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult SVGNumberPair::SetBaseValueString(const nsAString& aValueAsString,
|
||||
SVGElement* aSVGElement) {
|
||||
nsresult SVGAnimatedNumberPair::SetBaseValueString(
|
||||
const nsAString& aValueAsString, SVGElement* aSVGElement) {
|
||||
float val[2];
|
||||
|
||||
nsresult rv = ParseNumberOptionalNumber(aValueAsString, val);
|
||||
@ -69,7 +71,8 @@ nsresult SVGNumberPair::SetBaseValueString(const nsAString& aValueAsString,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void SVGNumberPair::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
void SVGAnimatedNumberPair::GetBaseValueString(
|
||||
nsAString& aValueAsString) const {
|
||||
aValueAsString.Truncate();
|
||||
aValueAsString.AppendFloat(mBaseVal[0]);
|
||||
if (mBaseVal[0] != mBaseVal[1]) {
|
||||
@ -78,8 +81,8 @@ void SVGNumberPair::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
}
|
||||
}
|
||||
|
||||
void SVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGAnimatedNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex,
|
||||
SVGElement* aSVGElement) {
|
||||
uint32_t index = (aPairIndex == eFirst ? 0 : 1);
|
||||
if (mIsBaseSet && mBaseVal[index] == aValue) {
|
||||
return;
|
||||
@ -95,8 +98,8 @@ void SVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex,
|
||||
aSVGElement->DidChangeNumberPair(mAttrEnum, emptyOrOldValue);
|
||||
}
|
||||
|
||||
void SVGNumberPair::SetBaseValues(float aValue1, float aValue2,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGAnimatedNumberPair::SetBaseValues(float aValue1, float aValue2,
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsBaseSet && mBaseVal[0] == aValue1 && mBaseVal[1] == aValue2) {
|
||||
return;
|
||||
}
|
||||
@ -113,8 +116,8 @@ void SVGNumberPair::SetBaseValues(float aValue1, float aValue2,
|
||||
aSVGElement->DidChangeNumberPair(mAttrEnum, emptyOrOldValue);
|
||||
}
|
||||
|
||||
void SVGNumberPair::SetAnimValue(const float aValue[2],
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGAnimatedNumberPair::SetAnimValue(const float aValue[2],
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsAnimated && mAnimVal[0] == aValue[0] && mAnimVal[1] == aValue[1]) {
|
||||
return;
|
||||
}
|
||||
@ -124,8 +127,9 @@ void SVGNumberPair::SetAnimValue(const float aValue[2],
|
||||
aSVGElement->DidAnimateNumberPair(mAttrEnum);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumber> SVGNumberPair::ToDOMAnimatedNumber(
|
||||
PairIndex aIndex, SVGElement* aSVGElement) {
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGAnimatedNumberPair::ToDOMAnimatedNumber(PairIndex aIndex,
|
||||
SVGElement* aSVGElement) {
|
||||
RefPtr<DOMAnimatedNumber> domAnimatedNumber =
|
||||
aIndex == eFirst ? sSVGFirstAnimatedNumberTearoffTable.GetTearoff(this)
|
||||
: sSVGSecondAnimatedNumberTearoffTable.GetTearoff(this);
|
||||
@ -141,7 +145,7 @@ already_AddRefed<DOMSVGAnimatedNumber> SVGNumberPair::ToDOMAnimatedNumber(
|
||||
return domAnimatedNumber.forget();
|
||||
}
|
||||
|
||||
SVGNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() {
|
||||
SVGAnimatedNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() {
|
||||
if (mIndex == eFirst) {
|
||||
sSVGFirstAnimatedNumberTearoffTable.RemoveTearoff(mVal);
|
||||
} else {
|
||||
@ -149,11 +153,11 @@ SVGNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() {
|
||||
}
|
||||
}
|
||||
|
||||
UniquePtr<SMILAttr> SVGNumberPair::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
UniquePtr<SMILAttr> SVGAnimatedNumberPair::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
return MakeUnique<SMILNumberPair>(this, aSVGElement);
|
||||
}
|
||||
|
||||
nsresult SVGNumberPair::SMILNumberPair::ValueFromString(
|
||||
nsresult SVGAnimatedNumberPair::SMILNumberPair::ValueFromString(
|
||||
const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
|
||||
SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
|
||||
float values[2];
|
||||
@ -172,14 +176,14 @@ nsresult SVGNumberPair::SMILNumberPair::ValueFromString(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SMILValue SVGNumberPair::SMILNumberPair::GetBaseValue() const {
|
||||
SMILValue SVGAnimatedNumberPair::SMILNumberPair::GetBaseValue() const {
|
||||
SMILValue val(&SVGNumberPairSMILType::sSingleton);
|
||||
val.mU.mNumberPair[0] = mVal->mBaseVal[0];
|
||||
val.mU.mNumberPair[1] = mVal->mBaseVal[1];
|
||||
return val;
|
||||
}
|
||||
|
||||
void SVGNumberPair::SMILNumberPair::ClearAnimValue() {
|
||||
void SVGAnimatedNumberPair::SMILNumberPair::ClearAnimValue() {
|
||||
if (mVal->mIsAnimated) {
|
||||
mVal->mIsAnimated = false;
|
||||
mVal->mAnimVal[0] = mVal->mBaseVal[0];
|
||||
@ -188,7 +192,8 @@ void SVGNumberPair::SMILNumberPair::ClearAnimValue() {
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGNumberPair::SMILNumberPair::SetAnimValue(const SMILValue& aValue) {
|
||||
nsresult SVGAnimatedNumberPair::SMILNumberPair::SetAnimValue(
|
||||
const SMILValue& aValue) {
|
||||
NS_ASSERTION(aValue.mType == &SVGNumberPairSMILType::sSingleton,
|
||||
"Unexpected type to assign animated value");
|
||||
if (aValue.mType == &SVGNumberPairSMILType::sSingleton) {
|
@ -25,7 +25,7 @@ class SVGAnimationElement;
|
||||
class SVGElement;
|
||||
} // namespace dom
|
||||
|
||||
class SVGNumberPair {
|
||||
class SVGAnimatedNumberPair {
|
||||
public:
|
||||
typedef mozilla::dom::SVGElement SVGElement;
|
||||
|
||||
@ -72,16 +72,16 @@ class SVGNumberPair {
|
||||
|
||||
public:
|
||||
// DOM wrapper class for the (DOM)SVGAnimatedNumber interface where the
|
||||
// wrapped class is SVGNumberPair.
|
||||
// wrapped class is SVGAnimatedNumberPair.
|
||||
struct DOMAnimatedNumber final : public mozilla::dom::DOMSVGAnimatedNumber {
|
||||
DOMAnimatedNumber(SVGNumberPair* aVal, PairIndex aIndex,
|
||||
DOMAnimatedNumber(SVGAnimatedNumberPair* aVal, PairIndex aIndex,
|
||||
SVGElement* aSVGElement)
|
||||
: mozilla::dom::DOMSVGAnimatedNumber(aSVGElement),
|
||||
mVal(aVal),
|
||||
mIndex(aIndex) {}
|
||||
virtual ~DOMAnimatedNumber();
|
||||
|
||||
SVGNumberPair* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedNumberPair* mVal; // kept alive because it belongs to content
|
||||
PairIndex mIndex; // are we the first or second number
|
||||
|
||||
virtual float BaseVal() override { return mVal->GetBaseValue(mIndex); }
|
||||
@ -100,13 +100,13 @@ class SVGNumberPair {
|
||||
|
||||
struct SMILNumberPair : public SMILAttr {
|
||||
public:
|
||||
SMILNumberPair(SVGNumberPair* aVal, SVGElement* aSVGElement)
|
||||
SMILNumberPair(SVGAnimatedNumberPair* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a SMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
SVGNumberPair* mVal;
|
||||
SVGAnimatedNumberPair* mVal;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// SMILAttr methods
|
@ -4,7 +4,7 @@
|
||||
* 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 "SVGOrient.h"
|
||||
#include "SVGAnimatedOrient.h"
|
||||
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/Move.h"
|
||||
@ -28,12 +28,14 @@ static const nsStaticAtom* const angleUnitMap[] = {
|
||||
nullptr, /* SVG_ANGLETYPE_UNSPECIFIED */
|
||||
nsGkAtoms::deg, nsGkAtoms::rad, nsGkAtoms::grad};
|
||||
|
||||
static SVGAttrTearoffTable<SVGOrient, DOMSVGAnimatedEnumeration>
|
||||
static SVGAttrTearoffTable<SVGAnimatedOrient, DOMSVGAnimatedEnumeration>
|
||||
sSVGAnimatedEnumTearoffTable;
|
||||
static SVGAttrTearoffTable<SVGOrient, DOMSVGAnimatedAngle>
|
||||
static SVGAttrTearoffTable<SVGAnimatedOrient, DOMSVGAnimatedAngle>
|
||||
sSVGAnimatedAngleTearoffTable;
|
||||
static SVGAttrTearoffTable<SVGOrient, DOMSVGAngle> sBaseSVGAngleTearoffTable;
|
||||
static SVGAttrTearoffTable<SVGOrient, DOMSVGAngle> sAnimSVGAngleTearoffTable;
|
||||
static SVGAttrTearoffTable<SVGAnimatedOrient, DOMSVGAngle>
|
||||
sBaseSVGAngleTearoffTable;
|
||||
static SVGAttrTearoffTable<SVGAnimatedOrient, DOMSVGAngle>
|
||||
sAnimSVGAngleTearoffTable;
|
||||
|
||||
/* Helper functions */
|
||||
|
||||
@ -44,7 +46,7 @@ static SVGAttrTearoffTable<SVGOrient, DOMSVGAngle> sAnimSVGAngleTearoffTable;
|
||||
class MOZ_RAII AutoChangeOrientNotifier {
|
||||
public:
|
||||
explicit AutoChangeOrientNotifier(
|
||||
SVGOrient* aOrient, SVGElement* aSVGElement,
|
||||
SVGAnimatedOrient* aOrient, SVGElement* aSVGElement,
|
||||
bool aDoSetAttr = true MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
: mOrient(aOrient), mSVGElement(aSVGElement), mDoSetAttr(aDoSetAttr) {
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
@ -66,7 +68,7 @@ class MOZ_RAII AutoChangeOrientNotifier {
|
||||
}
|
||||
|
||||
private:
|
||||
SVGOrient* const mOrient;
|
||||
SVGAnimatedOrient* const mOrient;
|
||||
SVGElement* const mSVGElement;
|
||||
nsAttrValue mEmptyOrOldValue;
|
||||
bool mDoSetAttr;
|
||||
@ -116,8 +118,8 @@ static void GetAngleValueString(nsAString& aValueAsString, float aValue,
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool SVGOrient::GetValueFromString(const nsAString& aString, float& aValue,
|
||||
uint16_t* aUnitType) {
|
||||
bool SVGAnimatedOrient::GetValueFromString(const nsAString& aString,
|
||||
float& aValue, uint16_t* aUnitType) {
|
||||
bool success;
|
||||
auto token = SVGContentUtils::GetAndEnsureOneToken(aString, success);
|
||||
|
||||
@ -138,7 +140,7 @@ bool SVGOrient::GetValueFromString(const nsAString& aString, float& aValue,
|
||||
}
|
||||
|
||||
/* static */
|
||||
float SVGOrient::GetDegreesPerUnit(uint8_t aUnit) {
|
||||
float SVGAnimatedOrient::GetDegreesPerUnit(uint8_t aUnit) {
|
||||
switch (aUnit) {
|
||||
case SVG_ANGLETYPE_UNSPECIFIED:
|
||||
case SVG_ANGLETYPE_DEG:
|
||||
@ -153,8 +155,8 @@ float SVGOrient::GetDegreesPerUnit(uint8_t aUnit) {
|
||||
}
|
||||
}
|
||||
|
||||
void SVGOrient::SetBaseValueInSpecifiedUnits(float aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGAnimatedOrient::SetBaseValueInSpecifiedUnits(float aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
if (mBaseVal == aValue && mBaseType == SVG_MARKER_ORIENT_ANGLE) {
|
||||
return;
|
||||
}
|
||||
@ -169,8 +171,8 @@ void SVGOrient::SetBaseValueInSpecifiedUnits(float aValue,
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGOrient::ConvertToSpecifiedUnits(uint16_t unitType,
|
||||
SVGElement* aSVGElement) {
|
||||
nsresult SVGAnimatedOrient::ConvertToSpecifiedUnits(uint16_t unitType,
|
||||
SVGElement* aSVGElement) {
|
||||
if (!IsValidAngleUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
|
||||
if (mBaseValUnit == uint8_t(unitType) &&
|
||||
@ -184,9 +186,9 @@ nsresult SVGOrient::ConvertToSpecifiedUnits(uint16_t unitType,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult SVGOrient::NewValueSpecifiedUnits(uint16_t unitType,
|
||||
float valueInSpecifiedUnits,
|
||||
SVGElement* aSVGElement) {
|
||||
nsresult SVGAnimatedOrient::NewValueSpecifiedUnits(uint16_t unitType,
|
||||
float valueInSpecifiedUnits,
|
||||
SVGElement* aSVGElement) {
|
||||
NS_ENSURE_FINITE(valueInSpecifiedUnits, NS_ERROR_ILLEGAL_VALUE);
|
||||
|
||||
if (!IsValidAngleUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
@ -208,7 +210,8 @@ nsresult SVGOrient::NewValueSpecifiedUnits(uint16_t unitType,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAngle> SVGOrient::ToDOMBaseVal(SVGElement* aSVGElement) {
|
||||
already_AddRefed<DOMSVGAngle> SVGAnimatedOrient::ToDOMBaseVal(
|
||||
SVGElement* aSVGElement) {
|
||||
RefPtr<DOMSVGAngle> domBaseVal = sBaseSVGAngleTearoffTable.GetTearoff(this);
|
||||
if (!domBaseVal) {
|
||||
domBaseVal = new DOMSVGAngle(this, aSVGElement, DOMSVGAngle::BaseValue);
|
||||
@ -218,7 +221,8 @@ already_AddRefed<DOMSVGAngle> SVGOrient::ToDOMBaseVal(SVGElement* aSVGElement) {
|
||||
return domBaseVal.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAngle> SVGOrient::ToDOMAnimVal(SVGElement* aSVGElement) {
|
||||
already_AddRefed<DOMSVGAngle> SVGAnimatedOrient::ToDOMAnimVal(
|
||||
SVGElement* aSVGElement) {
|
||||
RefPtr<DOMSVGAngle> domAnimVal = sAnimSVGAngleTearoffTable.GetTearoff(this);
|
||||
if (!domAnimVal) {
|
||||
domAnimVal = new DOMSVGAngle(this, aSVGElement, DOMSVGAngle::AnimValue);
|
||||
@ -240,9 +244,9 @@ DOMSVGAngle::~DOMSVGAngle() {
|
||||
|
||||
/* Implementation */
|
||||
|
||||
nsresult SVGOrient::SetBaseValueString(const nsAString& aValueAsString,
|
||||
SVGElement* aSVGElement,
|
||||
bool aDoSetAttr) {
|
||||
nsresult SVGAnimatedOrient::SetBaseValueString(const nsAString& aValueAsString,
|
||||
SVGElement* aSVGElement,
|
||||
bool aDoSetAttr) {
|
||||
uint8_t type;
|
||||
float value;
|
||||
uint16_t unitType;
|
||||
@ -290,7 +294,7 @@ nsresult SVGOrient::SetBaseValueString(const nsAString& aValueAsString,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void SVGOrient::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
void SVGAnimatedOrient::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
switch (mBaseType) {
|
||||
case SVG_MARKER_ORIENT_AUTO:
|
||||
aValueAsString.AssignLiteral("auto");
|
||||
@ -302,16 +306,18 @@ void SVGOrient::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
GetAngleValueString(aValueAsString, mBaseVal, mBaseValUnit);
|
||||
}
|
||||
|
||||
void SVGOrient::GetBaseAngleValueString(nsAString& aValueAsString) const {
|
||||
void SVGAnimatedOrient::GetBaseAngleValueString(
|
||||
nsAString& aValueAsString) const {
|
||||
GetAngleValueString(aValueAsString, mBaseVal, mBaseValUnit);
|
||||
}
|
||||
|
||||
void SVGOrient::GetAnimAngleValueString(nsAString& aValueAsString) const {
|
||||
void SVGAnimatedOrient::GetAnimAngleValueString(
|
||||
nsAString& aValueAsString) const {
|
||||
GetAngleValueString(aValueAsString, mAnimVal, mAnimValUnit);
|
||||
}
|
||||
|
||||
void SVGOrient::SetBaseValue(float aValue, uint8_t aUnit,
|
||||
SVGElement* aSVGElement, bool aDoSetAttr) {
|
||||
void SVGAnimatedOrient::SetBaseValue(float aValue, uint8_t aUnit,
|
||||
SVGElement* aSVGElement, bool aDoSetAttr) {
|
||||
float valueInSpecifiedUnits = aValue / GetDegreesPerUnit(aUnit);
|
||||
if (aUnit == mBaseValUnit && mBaseVal == valueInSpecifiedUnits &&
|
||||
mBaseType == SVG_MARKER_ORIENT_ANGLE) {
|
||||
@ -330,7 +336,8 @@ void SVGOrient::SetBaseValue(float aValue, uint8_t aUnit,
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGOrient::SetBaseType(SVGEnumValue aValue, SVGElement* aSVGElement) {
|
||||
nsresult SVGAnimatedOrient::SetBaseType(SVGEnumValue aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
if (mBaseType == aValue) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -351,8 +358,8 @@ nsresult SVGOrient::SetBaseType(SVGEnumValue aValue, SVGElement* aSVGElement) {
|
||||
return NS_ERROR_DOM_TYPE_ERR;
|
||||
}
|
||||
|
||||
void SVGOrient::SetAnimValue(float aValue, uint8_t aUnit,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGAnimatedOrient::SetAnimValue(float aValue, uint8_t aUnit,
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsAnimated && mAnimVal == aValue && mAnimValUnit == aUnit &&
|
||||
mAnimType == SVG_MARKER_ORIENT_ANGLE) {
|
||||
return;
|
||||
@ -364,7 +371,8 @@ void SVGOrient::SetAnimValue(float aValue, uint8_t aUnit,
|
||||
aSVGElement->DidAnimateOrient();
|
||||
}
|
||||
|
||||
void SVGOrient::SetAnimType(SVGEnumValue aValue, SVGElement* aSVGElement) {
|
||||
void SVGAnimatedOrient::SetAnimType(SVGEnumValue aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsAnimated && mAnimType == aValue) {
|
||||
return;
|
||||
}
|
||||
@ -375,7 +383,7 @@ void SVGOrient::SetAnimType(SVGEnumValue aValue, SVGElement* aSVGElement) {
|
||||
aSVGElement->DidAnimateOrient();
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedAngle> SVGOrient::ToDOMAnimatedAngle(
|
||||
already_AddRefed<DOMSVGAnimatedAngle> SVGAnimatedOrient::ToDOMAnimatedAngle(
|
||||
SVGElement* aSVGElement) {
|
||||
RefPtr<DOMSVGAnimatedAngle> domAnimatedAngle =
|
||||
sSVGAnimatedAngleTearoffTable.GetTearoff(this);
|
||||
@ -387,8 +395,8 @@ already_AddRefed<DOMSVGAnimatedAngle> SVGOrient::ToDOMAnimatedAngle(
|
||||
return domAnimatedAngle.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedEnumeration> SVGOrient::ToDOMAnimatedEnum(
|
||||
SVGElement* aSVGElement) {
|
||||
already_AddRefed<DOMSVGAnimatedEnumeration>
|
||||
SVGAnimatedOrient::ToDOMAnimatedEnum(SVGElement* aSVGElement) {
|
||||
RefPtr<DOMSVGAnimatedEnumeration> domAnimatedEnum =
|
||||
sSVGAnimatedEnumTearoffTable.GetTearoff(this);
|
||||
if (!domAnimatedEnum) {
|
||||
@ -403,19 +411,19 @@ DOMSVGAnimatedAngle::~DOMSVGAnimatedAngle() {
|
||||
sSVGAnimatedAngleTearoffTable.RemoveTearoff(mVal);
|
||||
}
|
||||
|
||||
SVGOrient::DOMAnimatedEnum::~DOMAnimatedEnum() {
|
||||
SVGAnimatedOrient::DOMAnimatedEnum::~DOMAnimatedEnum() {
|
||||
sSVGAnimatedEnumTearoffTable.RemoveTearoff(mVal);
|
||||
}
|
||||
|
||||
// we want to avoid exposing SVG_MARKER_ORIENT_AUTO_START_REVERSE to
|
||||
// Web content
|
||||
uint16_t SVGOrient::DOMAnimatedEnum::Sanitize(uint16_t aValue) {
|
||||
uint16_t SVGAnimatedOrient::DOMAnimatedEnum::Sanitize(uint16_t aValue) {
|
||||
return aValue == dom::SVG_MARKER_ORIENT_AUTO_START_REVERSE
|
||||
? dom::SVGMarkerElement_Binding::SVG_MARKER_ORIENT_UNKNOWN
|
||||
: aValue;
|
||||
}
|
||||
|
||||
UniquePtr<SMILAttr> SVGOrient::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
UniquePtr<SMILAttr> SVGAnimatedOrient::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
if (aSVGElement->NodeInfo()->Equals(nsGkAtoms::marker, kNameSpaceID_SVG)) {
|
||||
return MakeUnique<SMILOrient>(this, aSVGElement);
|
||||
}
|
||||
@ -425,7 +433,7 @@ UniquePtr<SMILAttr> SVGOrient::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsresult SVGOrient::SMILOrient::ValueFromString(
|
||||
nsresult SVGAnimatedOrient::SMILOrient::ValueFromString(
|
||||
const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/,
|
||||
SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
|
||||
SMILValue val(&SVGOrientSMILType::sSingleton);
|
||||
@ -453,7 +461,7 @@ nsresult SVGOrient::SMILOrient::ValueFromString(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SMILValue SVGOrient::SMILOrient::GetBaseValue() const {
|
||||
SMILValue SVGAnimatedOrient::SMILOrient::GetBaseValue() const {
|
||||
SMILValue val(&SVGOrientSMILType::sSingleton);
|
||||
val.mU.mOrient.mAngle = mOrient->GetBaseValInSpecifiedUnits();
|
||||
val.mU.mOrient.mUnit = mOrient->GetBaseValueUnit();
|
||||
@ -461,7 +469,7 @@ SMILValue SVGOrient::SMILOrient::GetBaseValue() const {
|
||||
return val;
|
||||
}
|
||||
|
||||
void SVGOrient::SMILOrient::ClearAnimValue() {
|
||||
void SVGAnimatedOrient::SMILOrient::ClearAnimValue() {
|
||||
if (mOrient->mIsAnimated) {
|
||||
mOrient->mIsAnimated = false;
|
||||
mOrient->mAnimVal = mOrient->mBaseVal;
|
||||
@ -471,7 +479,7 @@ void SVGOrient::SMILOrient::ClearAnimValue() {
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGOrient::SMILOrient::SetAnimValue(const SMILValue& aValue) {
|
||||
nsresult SVGAnimatedOrient::SMILOrient::SetAnimValue(const SMILValue& aValue) {
|
||||
NS_ASSERTION(aValue.mType == &SVGOrientSMILType::sSingleton,
|
||||
"Unexpected type to assign animated value");
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "DOMSVGAnimatedEnumeration.h"
|
||||
#include "nsError.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "mozilla/AlreadyAddRefed.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/SMILAttr.h"
|
||||
@ -30,7 +30,7 @@ class SVGAnimationElement;
|
||||
class SVGElement;
|
||||
} // namespace dom
|
||||
|
||||
class SVGOrient {
|
||||
class SVGAnimatedOrient {
|
||||
friend class AutoChangeOrientNotifier;
|
||||
friend class mozilla::dom::DOMSVGAngle;
|
||||
friend class mozilla::dom::DOMSVGAnimatedAngle;
|
||||
@ -100,13 +100,13 @@ class SVGOrient {
|
||||
|
||||
public:
|
||||
// DOM wrapper class for the (DOM)SVGAnimatedEnumeration interface where the
|
||||
// wrapped class is SVGOrient.
|
||||
// wrapped class is SVGAnimatedOrient.
|
||||
struct DOMAnimatedEnum final : public dom::DOMSVGAnimatedEnumeration {
|
||||
DOMAnimatedEnum(SVGOrient* aVal, SVGElement* aSVGElement)
|
||||
DOMAnimatedEnum(SVGAnimatedOrient* aVal, SVGElement* aSVGElement)
|
||||
: DOMSVGAnimatedEnumeration(aSVGElement), mVal(aVal) {}
|
||||
~DOMAnimatedEnum();
|
||||
|
||||
SVGOrient* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedOrient* mVal; // kept alive because it belongs to content
|
||||
|
||||
using mozilla::dom::DOMSVGAnimatedEnumeration::SetBaseVal;
|
||||
uint16_t BaseVal() override { return Sanitize(mVal->mBaseType); }
|
||||
@ -127,13 +127,13 @@ class SVGOrient {
|
||||
|
||||
struct SMILOrient final : public SMILAttr {
|
||||
public:
|
||||
SMILOrient(SVGOrient* aOrient, SVGElement* aSVGElement)
|
||||
SMILOrient(SVGAnimatedOrient* aOrient, SVGElement* aSVGElement)
|
||||
: mOrient(aOrient), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a SMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
SVGOrient* mOrient;
|
||||
SVGAnimatedOrient* mOrient;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// SMILAttr methods
|
@ -6,8 +6,8 @@
|
||||
|
||||
#include "SVGAnimatedRect.h"
|
||||
#include "mozilla/dom/SVGAnimatedRectBinding.h"
|
||||
#include "SVGElement.h"
|
||||
#include "SVGViewBox.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
#include "SVGAnimatedViewBox.h"
|
||||
#include "SVGIRect.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -18,11 +18,12 @@ NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedRect, mSVGElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(SVGAnimatedRect, AddRef)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(SVGAnimatedRect, Release)
|
||||
|
||||
SVGAnimatedRect::SVGAnimatedRect(SVGViewBox* aVal, SVGElement* aSVGElement)
|
||||
SVGAnimatedRect::SVGAnimatedRect(SVGAnimatedViewBox* aVal,
|
||||
SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
SVGAnimatedRect::~SVGAnimatedRect() {
|
||||
SVGViewBox::sSVGAnimatedRectTearoffTable.RemoveTearoff(mVal);
|
||||
SVGAnimatedViewBox::sSVGAnimatedRectTearoffTable.RemoveTearoff(mVal);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGIRect> SVGAnimatedRect::GetBaseVal() {
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
namespace mozilla {
|
||||
class SVGViewBox;
|
||||
class SVGAnimatedViewBox;
|
||||
namespace dom {
|
||||
|
||||
class SVGAnimatedRect final : public nsWrapperCache {
|
||||
@ -23,7 +23,7 @@ class SVGAnimatedRect final : public nsWrapperCache {
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAnimatedRect)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAnimatedRect)
|
||||
|
||||
SVGAnimatedRect(SVGViewBox* aVal, SVGElement* aSVGElement);
|
||||
SVGAnimatedRect(SVGAnimatedViewBox* aVal, SVGElement* aSVGElement);
|
||||
|
||||
SVGElement* GetParentObject() const { return mSVGElement; }
|
||||
|
||||
@ -37,7 +37,7 @@ class SVGAnimatedRect final : public nsWrapperCache {
|
||||
private:
|
||||
virtual ~SVGAnimatedRect();
|
||||
|
||||
SVGViewBox* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedViewBox* mVal; // kept alive because it belongs to content
|
||||
RefPtr<SVGElement> mSVGElement;
|
||||
};
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* 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 "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/SMILValue.h"
|
||||
@ -15,28 +15,30 @@ using namespace mozilla::dom;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGString::DOMAnimatedString,
|
||||
mSVGElement)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(
|
||||
SVGAnimatedString::DOMAnimatedString, mSVGElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGString::DOMAnimatedString)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGString::DOMAnimatedString)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedString::DOMAnimatedString)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedString::DOMAnimatedString)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGString::DOMAnimatedString)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedString::DOMAnimatedString)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
static inline SVGAttrTearoffTable<SVGString, SVGString::DOMAnimatedString>&
|
||||
static inline SVGAttrTearoffTable<SVGAnimatedString,
|
||||
SVGAnimatedString::DOMAnimatedString>&
|
||||
SVGAnimatedStringTearoffTable() {
|
||||
static SVGAttrTearoffTable<SVGString, SVGString::DOMAnimatedString>
|
||||
static SVGAttrTearoffTable<SVGAnimatedString,
|
||||
SVGAnimatedString::DOMAnimatedString>
|
||||
sSVGAnimatedStringTearoffTable;
|
||||
return sSVGAnimatedStringTearoffTable;
|
||||
}
|
||||
|
||||
/* Implementation */
|
||||
|
||||
void SVGString::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement,
|
||||
bool aDoSetAttr) {
|
||||
void SVGAnimatedString::SetBaseValue(const nsAString& aValue,
|
||||
SVGElement* aSVGElement, bool aDoSetAttr) {
|
||||
NS_ASSERTION(aSVGElement, "Null element passed to SetBaseValue");
|
||||
|
||||
mIsBaseSet = true;
|
||||
@ -50,8 +52,8 @@ void SVGString::SetBaseValue(const nsAString& aValue, SVGElement* aSVGElement,
|
||||
aSVGElement->DidChangeString(mAttrEnum);
|
||||
}
|
||||
|
||||
void SVGString::GetAnimValue(nsAString& aResult,
|
||||
const SVGElement* aSVGElement) const {
|
||||
void SVGAnimatedString::GetAnimValue(nsAString& aResult,
|
||||
const SVGElement* aSVGElement) const {
|
||||
if (mAnimVal) {
|
||||
aResult = *mAnimVal;
|
||||
return;
|
||||
@ -60,7 +62,8 @@ void SVGString::GetAnimValue(nsAString& aResult,
|
||||
aSVGElement->GetStringBaseValue(mAttrEnum, aResult);
|
||||
}
|
||||
|
||||
void SVGString::SetAnimValue(const nsAString& aValue, SVGElement* aSVGElement) {
|
||||
void SVGAnimatedString::SetAnimValue(const nsAString& aValue,
|
||||
SVGElement* aSVGElement) {
|
||||
if (aSVGElement->IsStringAnimatable(mAttrEnum)) {
|
||||
if (mAnimVal && mAnimVal->Equals(aValue)) {
|
||||
return;
|
||||
@ -73,7 +76,7 @@ void SVGString::SetAnimValue(const nsAString& aValue, SVGElement* aSVGElement) {
|
||||
}
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedString> SVGString::ToDOMAnimatedString(
|
||||
already_AddRefed<DOMSVGAnimatedString> SVGAnimatedString::ToDOMAnimatedString(
|
||||
SVGElement* aSVGElement) {
|
||||
RefPtr<DOMAnimatedString> domAnimatedString =
|
||||
SVGAnimatedStringTearoffTable().GetTearoff(this);
|
||||
@ -85,15 +88,15 @@ already_AddRefed<DOMSVGAnimatedString> SVGString::ToDOMAnimatedString(
|
||||
return domAnimatedString.forget();
|
||||
}
|
||||
|
||||
SVGString::DOMAnimatedString::~DOMAnimatedString() {
|
||||
SVGAnimatedString::DOMAnimatedString::~DOMAnimatedString() {
|
||||
SVGAnimatedStringTearoffTable().RemoveTearoff(mVal);
|
||||
}
|
||||
|
||||
UniquePtr<SMILAttr> SVGString::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
UniquePtr<SMILAttr> SVGAnimatedString::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
return MakeUnique<SMILString>(this, aSVGElement);
|
||||
}
|
||||
|
||||
nsresult SVGString::SMILString::ValueFromString(
|
||||
nsresult SVGAnimatedString::SMILString::ValueFromString(
|
||||
const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
|
||||
SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
|
||||
SMILValue val(SMILStringType::Singleton());
|
||||
@ -104,21 +107,21 @@ nsresult SVGString::SMILString::ValueFromString(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SMILValue SVGString::SMILString::GetBaseValue() const {
|
||||
SMILValue SVGAnimatedString::SMILString::GetBaseValue() const {
|
||||
SMILValue val(SMILStringType::Singleton());
|
||||
mSVGElement->GetStringBaseValue(mVal->mAttrEnum,
|
||||
*static_cast<nsAString*>(val.mU.mPtr));
|
||||
return val;
|
||||
}
|
||||
|
||||
void SVGString::SMILString::ClearAnimValue() {
|
||||
void SVGAnimatedString::SMILString::ClearAnimValue() {
|
||||
if (mVal->mAnimVal) {
|
||||
mVal->mAnimVal = nullptr;
|
||||
mSVGElement->DidAnimateString(mVal->mAttrEnum);
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGString::SMILString::SetAnimValue(const SMILValue& aValue) {
|
||||
nsresult SVGAnimatedString::SMILString::SetAnimValue(const SMILValue& aValue) {
|
||||
NS_ASSERTION(aValue.mType == SMILStringType::Singleton(),
|
||||
"Unexpected type to assign animated value");
|
||||
if (aValue.mType == SMILStringType::Singleton()) {
|
@ -21,7 +21,7 @@ namespace dom {
|
||||
class SVGElement;
|
||||
}
|
||||
|
||||
class SVGString {
|
||||
class SVGAnimatedString {
|
||||
public:
|
||||
typedef mozilla::dom::SVGElement SVGElement;
|
||||
|
||||
@ -59,15 +59,15 @@ class SVGString {
|
||||
|
||||
public:
|
||||
// DOM wrapper class for the (DOM)SVGAnimatedString interface where the
|
||||
// wrapped class is SVGString.
|
||||
// wrapped class is SVGAnimatedString.
|
||||
struct DOMAnimatedString final : public mozilla::dom::DOMSVGAnimatedString {
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimatedString)
|
||||
|
||||
DOMAnimatedString(SVGString* aVal, SVGElement* aSVGElement)
|
||||
DOMAnimatedString(SVGAnimatedString* aVal, SVGElement* aSVGElement)
|
||||
: mozilla::dom::DOMSVGAnimatedString(aSVGElement), mVal(aVal) {}
|
||||
|
||||
SVGString* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedString* mVal; // kept alive because it belongs to content
|
||||
|
||||
void GetBaseVal(nsAString& aResult) override {
|
||||
mVal->GetBaseValue(aResult, mSVGElement);
|
||||
@ -87,13 +87,13 @@ class SVGString {
|
||||
};
|
||||
struct SMILString : public SMILAttr {
|
||||
public:
|
||||
SMILString(SVGString* aVal, SVGElement* aSVGElement)
|
||||
SMILString(SVGAnimatedString* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a SMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
SVGString* mVal;
|
||||
SVGAnimatedString* mVal;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// SMILAttr methods
|
@ -4,7 +4,7 @@
|
||||
* 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 "SVGViewBox.h"
|
||||
#include "SVGAnimatedViewBox.h"
|
||||
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/SMILValue.h"
|
||||
@ -62,39 +62,39 @@ nsresult SVGViewBoxRect::FromString(const nsAString& aStr,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* Cycle collection macros for SVGViewBox */
|
||||
/* Cycle collection macros for SVGAnimatedViewBox */
|
||||
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGViewBox::DOMBaseVal,
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedViewBox::DOMBaseVal,
|
||||
mSVGElement)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGViewBox::DOMAnimVal,
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedViewBox::DOMAnimVal,
|
||||
mSVGElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGViewBox::DOMBaseVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGViewBox::DOMBaseVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedViewBox::DOMBaseVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedViewBox::DOMBaseVal)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGViewBox::DOMAnimVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGViewBox::DOMAnimVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedViewBox::DOMAnimVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedViewBox::DOMAnimVal)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGViewBox::DOMBaseVal)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedViewBox::DOMBaseVal)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGViewBox::DOMAnimVal)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimatedViewBox::DOMAnimVal)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
static SVGAttrTearoffTable<SVGViewBox, SVGViewBox::DOMBaseVal>
|
||||
static SVGAttrTearoffTable<SVGAnimatedViewBox, SVGAnimatedViewBox::DOMBaseVal>
|
||||
sBaseSVGViewBoxTearoffTable;
|
||||
static SVGAttrTearoffTable<SVGViewBox, SVGViewBox::DOMAnimVal>
|
||||
static SVGAttrTearoffTable<SVGAnimatedViewBox, SVGAnimatedViewBox::DOMAnimVal>
|
||||
sAnimSVGViewBoxTearoffTable;
|
||||
SVGAttrTearoffTable<SVGViewBox, SVGAnimatedRect>
|
||||
SVGViewBox::sSVGAnimatedRectTearoffTable;
|
||||
SVGAttrTearoffTable<SVGAnimatedViewBox, SVGAnimatedRect>
|
||||
SVGAnimatedViewBox::sSVGAnimatedRectTearoffTable;
|
||||
|
||||
/* Implementation of SVGViewBox methods */
|
||||
/* Implementation of SVGAnimatedViewBox methods */
|
||||
|
||||
void SVGViewBox::Init() {
|
||||
void SVGAnimatedViewBox::Init() {
|
||||
mHasBaseVal = false;
|
||||
// We shouldn't use mBaseVal for rendering (its usages should be guarded with
|
||||
// "mHasBaseVal" checks), but just in case we do by accident, this will
|
||||
@ -104,7 +104,7 @@ void SVGViewBox::Init() {
|
||||
mAnimVal = nullptr;
|
||||
}
|
||||
|
||||
bool SVGViewBox::HasRect() const {
|
||||
bool SVGAnimatedViewBox::HasRect() const {
|
||||
// Check mAnimVal if we have one; otherwise, check mBaseVal if we have one;
|
||||
// otherwise, just return false (we clearly do not have a rect).
|
||||
const SVGViewBoxRect* rect = mAnimVal;
|
||||
@ -119,8 +119,8 @@ bool SVGViewBox::HasRect() const {
|
||||
return !rect->none && rect->width >= 0 && rect->height >= 0;
|
||||
}
|
||||
|
||||
void SVGViewBox::SetAnimValue(const SVGViewBoxRect& aRect,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGAnimatedViewBox::SetAnimValue(const SVGViewBoxRect& aRect,
|
||||
SVGElement* aSVGElement) {
|
||||
if (!mAnimVal) {
|
||||
// it's okay if allocation fails - and no point in reporting that
|
||||
mAnimVal = new SVGViewBoxRect(aRect);
|
||||
@ -133,8 +133,8 @@ void SVGViewBox::SetAnimValue(const SVGViewBoxRect& aRect,
|
||||
aSVGElement->DidAnimateViewBox();
|
||||
}
|
||||
|
||||
void SVGViewBox::SetBaseValue(const SVGViewBoxRect& aRect,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGAnimatedViewBox::SetBaseValue(const SVGViewBoxRect& aRect,
|
||||
SVGElement* aSVGElement) {
|
||||
if (!mHasBaseVal || mBaseVal == aRect) {
|
||||
// This method is used to set a single x, y, width
|
||||
// or height value. It can't create a base value
|
||||
@ -155,9 +155,9 @@ void SVGViewBox::SetBaseValue(const SVGViewBoxRect& aRect,
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGViewBox::SetBaseValueString(const nsAString& aValue,
|
||||
SVGElement* aSVGElement,
|
||||
bool aDoSetAttr) {
|
||||
nsresult SVGAnimatedViewBox::SetBaseValueString(const nsAString& aValue,
|
||||
SVGElement* aSVGElement,
|
||||
bool aDoSetAttr) {
|
||||
SVGViewBoxRect viewBox;
|
||||
|
||||
nsresult rv = SVGViewBoxRect::FromString(aValue, &viewBox);
|
||||
@ -185,7 +185,7 @@ nsresult SVGViewBox::SetBaseValueString(const nsAString& aValue,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void SVGViewBox::GetBaseValueString(nsAString& aValue) const {
|
||||
void SVGAnimatedViewBox::GetBaseValueString(nsAString& aValue) const {
|
||||
if (mBaseVal.none) {
|
||||
aValue.AssignLiteral("none");
|
||||
return;
|
||||
@ -195,7 +195,7 @@ void SVGViewBox::GetBaseValueString(nsAString& aValue) const {
|
||||
(double)mBaseVal.height);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedRect> SVGViewBox::ToSVGAnimatedRect(
|
||||
already_AddRefed<SVGAnimatedRect> SVGAnimatedViewBox::ToSVGAnimatedRect(
|
||||
SVGElement* aSVGElement) {
|
||||
RefPtr<SVGAnimatedRect> domAnimatedRect =
|
||||
sSVGAnimatedRectTearoffTable.GetTearoff(this);
|
||||
@ -207,7 +207,8 @@ already_AddRefed<SVGAnimatedRect> SVGViewBox::ToSVGAnimatedRect(
|
||||
return domAnimatedRect.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<SVGIRect> SVGViewBox::ToDOMBaseVal(SVGElement* aSVGElement) {
|
||||
already_AddRefed<SVGIRect> SVGAnimatedViewBox::ToDOMBaseVal(
|
||||
SVGElement* aSVGElement) {
|
||||
if (!mHasBaseVal || mBaseVal.none) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -221,11 +222,12 @@ already_AddRefed<SVGIRect> SVGViewBox::ToDOMBaseVal(SVGElement* aSVGElement) {
|
||||
return domBaseVal.forget();
|
||||
}
|
||||
|
||||
SVGViewBox::DOMBaseVal::~DOMBaseVal() {
|
||||
SVGAnimatedViewBox::DOMBaseVal::~DOMBaseVal() {
|
||||
sBaseSVGViewBoxTearoffTable.RemoveTearoff(mVal);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGIRect> SVGViewBox::ToDOMAnimVal(SVGElement* aSVGElement) {
|
||||
already_AddRefed<SVGIRect> SVGAnimatedViewBox::ToDOMAnimVal(
|
||||
SVGElement* aSVGElement) {
|
||||
if ((mAnimVal && mAnimVal->none) ||
|
||||
(!mAnimVal && (!mHasBaseVal || mBaseVal.none))) {
|
||||
return nullptr;
|
||||
@ -240,39 +242,40 @@ already_AddRefed<SVGIRect> SVGViewBox::ToDOMAnimVal(SVGElement* aSVGElement) {
|
||||
return domAnimVal.forget();
|
||||
}
|
||||
|
||||
SVGViewBox::DOMAnimVal::~DOMAnimVal() {
|
||||
SVGAnimatedViewBox::DOMAnimVal::~DOMAnimVal() {
|
||||
sAnimSVGViewBoxTearoffTable.RemoveTearoff(mVal);
|
||||
}
|
||||
|
||||
void SVGViewBox::DOMBaseVal::SetX(float aX, ErrorResult& aRv) {
|
||||
void SVGAnimatedViewBox::DOMBaseVal::SetX(float aX, ErrorResult& aRv) {
|
||||
SVGViewBoxRect rect = mVal->GetBaseValue();
|
||||
rect.x = aX;
|
||||
mVal->SetBaseValue(rect, mSVGElement);
|
||||
}
|
||||
|
||||
void SVGViewBox::DOMBaseVal::SetY(float aY, ErrorResult& aRv) {
|
||||
void SVGAnimatedViewBox::DOMBaseVal::SetY(float aY, ErrorResult& aRv) {
|
||||
SVGViewBoxRect rect = mVal->GetBaseValue();
|
||||
rect.y = aY;
|
||||
mVal->SetBaseValue(rect, mSVGElement);
|
||||
}
|
||||
|
||||
void SVGViewBox::DOMBaseVal::SetWidth(float aWidth, ErrorResult& aRv) {
|
||||
void SVGAnimatedViewBox::DOMBaseVal::SetWidth(float aWidth, ErrorResult& aRv) {
|
||||
SVGViewBoxRect rect = mVal->GetBaseValue();
|
||||
rect.width = aWidth;
|
||||
mVal->SetBaseValue(rect, mSVGElement);
|
||||
}
|
||||
|
||||
void SVGViewBox::DOMBaseVal::SetHeight(float aHeight, ErrorResult& aRv) {
|
||||
void SVGAnimatedViewBox::DOMBaseVal::SetHeight(float aHeight,
|
||||
ErrorResult& aRv) {
|
||||
SVGViewBoxRect rect = mVal->GetBaseValue();
|
||||
rect.height = aHeight;
|
||||
mVal->SetBaseValue(rect, mSVGElement);
|
||||
}
|
||||
|
||||
UniquePtr<SMILAttr> SVGViewBox::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
UniquePtr<SMILAttr> SVGAnimatedViewBox::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
return MakeUnique<SMILViewBox>(this, aSVGElement);
|
||||
}
|
||||
|
||||
nsresult SVGViewBox::SMILViewBox ::ValueFromString(
|
||||
nsresult SVGAnimatedViewBox::SMILViewBox ::ValueFromString(
|
||||
const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/,
|
||||
SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
|
||||
SVGViewBoxRect viewBox;
|
||||
@ -288,20 +291,21 @@ nsresult SVGViewBox::SMILViewBox ::ValueFromString(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SMILValue SVGViewBox::SMILViewBox::GetBaseValue() const {
|
||||
SMILValue SVGAnimatedViewBox::SMILViewBox::GetBaseValue() const {
|
||||
SMILValue val(&SVGViewBoxSMILType::sSingleton);
|
||||
*static_cast<SVGViewBoxRect*>(val.mU.mPtr) = mVal->mBaseVal;
|
||||
return val;
|
||||
}
|
||||
|
||||
void SVGViewBox::SMILViewBox::ClearAnimValue() {
|
||||
void SVGAnimatedViewBox::SMILViewBox::ClearAnimValue() {
|
||||
if (mVal->mAnimVal) {
|
||||
mVal->mAnimVal = nullptr;
|
||||
mSVGElement->DidAnimateViewBox();
|
||||
}
|
||||
}
|
||||
|
||||
nsresult SVGViewBox::SMILViewBox::SetAnimValue(const SMILValue& aValue) {
|
||||
nsresult SVGAnimatedViewBox::SMILViewBox::SetAnimValue(
|
||||
const SMILValue& aValue) {
|
||||
NS_ASSERTION(aValue.mType == &SVGViewBoxSMILType::sSingleton,
|
||||
"Unexpected type to assign animated value");
|
||||
if (aValue.mType == &SVGViewBoxSMILType::sSingleton) {
|
@ -45,7 +45,7 @@ struct SVGViewBoxRect {
|
||||
static nsresult FromString(const nsAString& aStr, SVGViewBoxRect* aViewBox);
|
||||
};
|
||||
|
||||
class SVGViewBox {
|
||||
class SVGAnimatedViewBox {
|
||||
public:
|
||||
typedef mozilla::dom::SVGElement SVGElement;
|
||||
|
||||
@ -104,10 +104,10 @@ class SVGViewBox {
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMBaseVal)
|
||||
|
||||
DOMBaseVal(SVGViewBox* aVal, SVGElement* aSVGElement)
|
||||
DOMBaseVal(SVGAnimatedViewBox* aVal, SVGElement* aSVGElement)
|
||||
: mozilla::dom::SVGIRect(), mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
SVGViewBox* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedViewBox* mVal; // kept alive because it belongs to content
|
||||
RefPtr<SVGElement> mSVGElement;
|
||||
|
||||
float X() const final { return mVal->GetBaseValue().x; }
|
||||
@ -133,10 +133,10 @@ class SVGViewBox {
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimVal)
|
||||
|
||||
DOMAnimVal(SVGViewBox* aVal, SVGElement* aSVGElement)
|
||||
DOMAnimVal(SVGAnimatedViewBox* aVal, SVGElement* aSVGElement)
|
||||
: mozilla::dom::SVGIRect(), mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
SVGViewBox* mVal; // kept alive because it belongs to content
|
||||
SVGAnimatedViewBox* mVal; // kept alive because it belongs to content
|
||||
RefPtr<SVGElement> mSVGElement;
|
||||
|
||||
// Script may have modified animation parameters or timeline -- DOM getters
|
||||
@ -185,13 +185,13 @@ class SVGViewBox {
|
||||
|
||||
struct SMILViewBox : public SMILAttr {
|
||||
public:
|
||||
SMILViewBox(SVGViewBox* aVal, SVGElement* aSVGElement)
|
||||
SMILViewBox(SVGAnimatedViewBox* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a SMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
SVGViewBox* mVal;
|
||||
SVGAnimatedViewBox* mVal;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// SMILAttr methods
|
||||
@ -204,7 +204,7 @@ class SVGViewBox {
|
||||
virtual nsresult SetAnimValue(const SMILValue& aValue) override;
|
||||
};
|
||||
|
||||
static SVGAttrTearoffTable<SVGViewBox, mozilla::dom::SVGAnimatedRect>
|
||||
static SVGAttrTearoffTable<SVGAnimatedViewBox, mozilla::dom::SVGAnimatedRect>
|
||||
sSVGAnimatedRectTearoffTable;
|
||||
};
|
||||
|
@ -7,28 +7,28 @@
|
||||
#include "SVGAttrValueWrapper.h"
|
||||
|
||||
#include "SVGAnimatedPreserveAspectRatio.h"
|
||||
#include "SVGIntegerPair.h"
|
||||
#include "SVGAnimatedIntegerPair.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGLengthList.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "SVGAnimatedNumberPair.h"
|
||||
#include "SVGNumberList.h"
|
||||
#include "SVGOrient.h"
|
||||
#include "SVGAnimatedOrient.h"
|
||||
#include "SVGAnimatedViewBox.h"
|
||||
#include "SVGPathData.h"
|
||||
#include "SVGPointList.h"
|
||||
#include "SVGStringList.h"
|
||||
#include "SVGTransformList.h"
|
||||
#include "SVGViewBox.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
/*static*/
|
||||
void SVGAttrValueWrapper::ToString(const SVGOrient* aOrient,
|
||||
void SVGAttrValueWrapper::ToString(const SVGAnimatedOrient* aOrient,
|
||||
nsAString& aResult) {
|
||||
aOrient->GetBaseValueString(aResult);
|
||||
}
|
||||
|
||||
/*static*/
|
||||
void SVGAttrValueWrapper::ToString(const SVGIntegerPair* aIntegerPair,
|
||||
void SVGAttrValueWrapper::ToString(const SVGAnimatedIntegerPair* aIntegerPair,
|
||||
nsAString& aResult) {
|
||||
aIntegerPair->GetBaseValueString(aResult);
|
||||
}
|
||||
@ -52,7 +52,7 @@ void SVGAttrValueWrapper::ToString(const SVGNumberList* aNumberList,
|
||||
}
|
||||
|
||||
/*static*/
|
||||
void SVGAttrValueWrapper::ToString(const SVGNumberPair* aNumberPair,
|
||||
void SVGAttrValueWrapper::ToString(const SVGAnimatedNumberPair* aNumberPair,
|
||||
nsAString& aResult) {
|
||||
aNumberPair->GetBaseValueString(aResult);
|
||||
}
|
||||
@ -89,7 +89,7 @@ void SVGAttrValueWrapper::ToString(const SVGTransformList* aTransformList,
|
||||
}
|
||||
|
||||
/*static*/
|
||||
void SVGAttrValueWrapper::ToString(const SVGViewBox* aViewBox,
|
||||
void SVGAttrValueWrapper::ToString(const SVGAnimatedViewBox* aViewBox,
|
||||
nsAString& aResult) {
|
||||
aViewBox->GetBaseValueString(aResult);
|
||||
}
|
||||
|
@ -17,26 +17,29 @@
|
||||
class nsSVGLength2;
|
||||
|
||||
namespace mozilla {
|
||||
class SVGIntegerPair;
|
||||
class SVGAnimatedIntegerPair;
|
||||
class SVGAnimatedNumberPair;
|
||||
class SVGAnimatedOrient;
|
||||
class SVGAnimatedPreserveAspectRatio;
|
||||
class SVGAnimatedViewBox;
|
||||
class SVGLengthList;
|
||||
class SVGNumberList;
|
||||
class SVGNumberPair;
|
||||
class SVGOrient;
|
||||
class SVGPathData;
|
||||
class SVGPointList;
|
||||
class SVGAnimatedPreserveAspectRatio;
|
||||
class SVGStringList;
|
||||
class SVGTransformList;
|
||||
class SVGViewBox;
|
||||
|
||||
class SVGAttrValueWrapper {
|
||||
public:
|
||||
static void ToString(const SVGOrient* aAngle, nsAString& aResult);
|
||||
static void ToString(const SVGIntegerPair* aIntegerPair, nsAString& aResult);
|
||||
static void ToString(const SVGAnimatedIntegerPair* aIntegerPair,
|
||||
nsAString& aResult);
|
||||
static void ToString(const SVGAnimatedNumberPair* aNumberPair,
|
||||
nsAString& aResult);
|
||||
static void ToString(const SVGAnimatedOrient* aOrient, nsAString& aResult);
|
||||
static void ToString(const nsSVGLength2* aLength, nsAString& aResult);
|
||||
static void ToString(const SVGAnimatedViewBox* aViewBox, nsAString& aResult);
|
||||
static void ToString(const SVGLengthList* aLengthList, nsAString& aResult);
|
||||
static void ToString(const SVGNumberList* aNumberList, nsAString& aResult);
|
||||
static void ToString(const SVGNumberPair* aNumberPair, nsAString& aResult);
|
||||
static void ToString(const SVGPathData* aPathData, nsAString& aResult);
|
||||
static void ToString(const SVGPointList* aPointList, nsAString& aResult);
|
||||
static void ToString(
|
||||
@ -45,7 +48,6 @@ class SVGAttrValueWrapper {
|
||||
static void ToString(const SVGStringList* aStringList, nsAString& aResult);
|
||||
static void ToString(const SVGTransformList* aTransformList,
|
||||
nsAString& aResult);
|
||||
static void ToString(const SVGViewBox* aViewBox, nsAString& aResult);
|
||||
};
|
||||
|
||||
} /* namespace mozilla */
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef mozilla_dom_SVGClipPathElement_h
|
||||
#define mozilla_dom_SVGClipPathElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "mozilla/dom/SVGTransformableElement.h"
|
||||
|
||||
class nsSVGClipPathFrame;
|
||||
@ -44,7 +44,7 @@ class SVGClipPathElement final : public SVGClipPathElementBase {
|
||||
|
||||
protected:
|
||||
enum { CLIPPATHUNITS };
|
||||
SVGEnum mEnumAttributes[1];
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
|
||||
virtual EnumAttributesInfo GetEnumInfo() override;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define mozilla_dom_SVGComponentTransferFunctionElement_h
|
||||
|
||||
#include "SVGAnimatedNumberList.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
|
||||
@ -78,7 +78,7 @@ class SVGComponentTransferFunctionElement
|
||||
static NumberInfo sNumberInfo[5];
|
||||
|
||||
enum { TYPE };
|
||||
SVGEnum mEnumAttributes[1];
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
static SVGEnumMapping sTypeMap[];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
};
|
||||
|
@ -43,17 +43,17 @@
|
||||
#include "SVGAnimatedPointList.h"
|
||||
#include "SVGAnimatedPathSegList.h"
|
||||
#include "SVGAnimatedTransformList.h"
|
||||
#include "SVGBoolean.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGInteger.h"
|
||||
#include "SVGIntegerPair.h"
|
||||
#include "SVGAnimatedBoolean.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGAnimatedInteger.h"
|
||||
#include "SVGAnimatedIntegerPair.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGMotionSMILAttr.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "SVGOrient.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGViewBox.h"
|
||||
#include "SVGAnimatedNumberPair.h"
|
||||
#include "SVGAnimatedOrient.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "SVGAnimatedViewBox.h"
|
||||
#include "SVGMotionSMILAttr.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
// This is needed to ensure correct handling of calls to the
|
||||
@ -173,13 +173,13 @@ nsresult SVGElement::Init() {
|
||||
enumInfo.Reset(i);
|
||||
}
|
||||
|
||||
SVGOrient* orient = GetOrient();
|
||||
SVGAnimatedOrient* orient = GetOrient();
|
||||
|
||||
if (orient) {
|
||||
orient->Init();
|
||||
}
|
||||
|
||||
SVGViewBox* viewBox = GetViewBox();
|
||||
SVGAnimatedViewBox* viewBox = GetViewBox();
|
||||
|
||||
if (viewBox) {
|
||||
viewBox->Init();
|
||||
@ -408,7 +408,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
}
|
||||
|
||||
if (!foundMatch) {
|
||||
// Check for SVGNumberPair attribute
|
||||
// Check for SVGAnimatedNumberPair attribute
|
||||
NumberPairAttributesInfo numberPairInfo = GetNumberPairInfo();
|
||||
for (i = 0; i < numberPairInfo.mNumberPairCount; i++) {
|
||||
if (aAttribute == numberPairInfo.mNumberPairInfo[i].mName) {
|
||||
@ -426,7 +426,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
}
|
||||
|
||||
if (!foundMatch) {
|
||||
// Check for SVGInteger attribute
|
||||
// Check for SVGAnimatedInteger attribute
|
||||
IntegerAttributesInfo integerInfo = GetIntegerInfo();
|
||||
for (i = 0; i < integerInfo.mIntegerCount; i++) {
|
||||
if (aAttribute == integerInfo.mIntegerInfo[i].mName) {
|
||||
@ -444,7 +444,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
}
|
||||
|
||||
if (!foundMatch) {
|
||||
// Check for SVGIntegerPair attribute
|
||||
// Check for SVGAnimatedIntegerPair attribute
|
||||
IntegerPairAttributesInfo integerPairInfo = GetIntegerPairInfo();
|
||||
for (i = 0; i < integerPairInfo.mIntegerPairCount; i++) {
|
||||
if (aAttribute == integerPairInfo.mIntegerPairInfo[i].mName) {
|
||||
@ -463,7 +463,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
}
|
||||
|
||||
if (!foundMatch) {
|
||||
// Check for SVGBoolean attribute
|
||||
// Check for SVGAnimatedBoolean attribute
|
||||
BooleanAttributesInfo booleanInfo = GetBooleanInfo();
|
||||
for (i = 0; i < booleanInfo.mBooleanCount; i++) {
|
||||
if (aAttribute == booleanInfo.mBooleanInfo[i].mName) {
|
||||
@ -484,7 +484,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
}
|
||||
|
||||
if (!foundMatch) {
|
||||
// Check for SVGEnum attribute
|
||||
// Check for SVGAnimatedEnumeration attribute
|
||||
EnumAttributesInfo enumInfo = GetEnumInfo();
|
||||
for (i = 0; i < enumInfo.mEnumCount; i++) {
|
||||
if (aAttribute == enumInfo.mEnumInfo[i].mName) {
|
||||
@ -532,7 +532,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
if (!foundMatch) {
|
||||
// Check for orient attribute
|
||||
if (aAttribute == nsGkAtoms::orient) {
|
||||
SVGOrient* orient = GetOrient();
|
||||
SVGAnimatedOrient* orient = GetOrient();
|
||||
if (orient) {
|
||||
rv = orient->SetBaseValueString(aValue, this, false);
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -543,9 +543,9 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
}
|
||||
foundMatch = true;
|
||||
}
|
||||
// Check for SVGViewBox attribute
|
||||
// Check for viewBox attribute
|
||||
} else if (aAttribute == nsGkAtoms::viewBox) {
|
||||
SVGViewBox* viewBox = GetViewBox();
|
||||
SVGAnimatedViewBox* viewBox = GetViewBox();
|
||||
if (viewBox) {
|
||||
rv = viewBox->SetBaseValueString(aValue, this, false);
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -556,7 +556,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
}
|
||||
foundMatch = true;
|
||||
}
|
||||
// Check for SVGAnimatedPreserveAspectRatio attribute
|
||||
// Check for preserveAspectRatio attribute
|
||||
} else if (aAttribute == nsGkAtoms::preserveAspectRatio) {
|
||||
SVGAnimatedPreserveAspectRatio* preserveAspectRatio =
|
||||
GetPreserveAspectRatio();
|
||||
@ -603,7 +603,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
}
|
||||
|
||||
if (!foundMatch) {
|
||||
// Check for SVGString attribute
|
||||
// Check for SVGAnimatedString attribute
|
||||
StringAttributesInfo stringInfo = GetStringInfo();
|
||||
for (uint32_t i = 0; i < stringInfo.mStringCount; i++) {
|
||||
if (aNamespaceID == stringInfo.mStringInfo[i].mNamespaceID &&
|
||||
@ -768,7 +768,7 @@ void SVGElement::UnsetAttrInternal(int32_t aNamespaceID, nsAtom* aName,
|
||||
|
||||
// Check if this is an orient attribute going away
|
||||
if (aName == nsGkAtoms::orient) {
|
||||
SVGOrient* orient = GetOrient();
|
||||
SVGAnimatedOrient* orient = GetOrient();
|
||||
if (orient) {
|
||||
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
|
||||
orient->Init();
|
||||
@ -778,7 +778,7 @@ void SVGElement::UnsetAttrInternal(int32_t aNamespaceID, nsAtom* aName,
|
||||
|
||||
// Check if this is a viewBox attribute going away
|
||||
if (aName == nsGkAtoms::viewBox) {
|
||||
SVGViewBox* viewBox = GetViewBox();
|
||||
SVGAnimatedViewBox* viewBox = GetViewBox();
|
||||
if (viewBox) {
|
||||
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
|
||||
viewBox->Init();
|
||||
@ -1885,14 +1885,14 @@ void SVGElement::DidAnimateEnum(uint8_t aAttrEnum) {
|
||||
}
|
||||
}
|
||||
|
||||
SVGOrient* SVGElement::GetOrient() { return nullptr; }
|
||||
SVGAnimatedOrient* SVGElement::GetOrient() { return nullptr; }
|
||||
|
||||
nsAttrValue SVGElement::WillChangeOrient() {
|
||||
return WillChangeValue(nsGkAtoms::orient);
|
||||
}
|
||||
|
||||
void SVGElement::DidChangeOrient(const nsAttrValue& aEmptyOrOldValue) {
|
||||
SVGOrient* orient = GetOrient();
|
||||
SVGAnimatedOrient* orient = GetOrient();
|
||||
|
||||
NS_ASSERTION(orient, "DidChangeOrient on element with no orient attrib");
|
||||
|
||||
@ -1911,14 +1911,14 @@ void SVGElement::DidAnimateOrient() {
|
||||
}
|
||||
}
|
||||
|
||||
SVGViewBox* SVGElement::GetViewBox() { return nullptr; }
|
||||
SVGAnimatedViewBox* SVGElement::GetViewBox() { return nullptr; }
|
||||
|
||||
nsAttrValue SVGElement::WillChangeViewBox() {
|
||||
return WillChangeValue(nsGkAtoms::viewBox);
|
||||
}
|
||||
|
||||
void SVGElement::DidChangeViewBox(const nsAttrValue& aEmptyOrOldValue) {
|
||||
SVGViewBox* viewBox = GetViewBox();
|
||||
SVGAnimatedViewBox* viewBox = GetViewBox();
|
||||
|
||||
NS_ASSERTION(viewBox, "DidChangeViewBox on element with no viewBox attrib");
|
||||
|
||||
@ -2222,13 +2222,13 @@ UniquePtr<SMILAttr> SVGElement::GetAnimatedAttr(int32_t aNamespaceID,
|
||||
|
||||
// orient:
|
||||
if (aName == nsGkAtoms::orient) {
|
||||
SVGOrient* orient = GetOrient();
|
||||
SVGAnimatedOrient* orient = GetOrient();
|
||||
return orient ? orient->ToSMILAttr(this) : nullptr;
|
||||
}
|
||||
|
||||
// viewBox:
|
||||
if (aName == nsGkAtoms::viewBox) {
|
||||
SVGViewBox* viewBox = GetViewBox();
|
||||
SVGAnimatedViewBox* viewBox = GetViewBox();
|
||||
return viewBox ? viewBox->ToSMILAttr(this) : nullptr;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "mozilla/SVGContentUtils.h"
|
||||
#include "mozilla/dom/DOMRect.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/SVGClass.h"
|
||||
#include "mozilla/dom/SVGAnimatedClass.h"
|
||||
#include "mozilla/gfx/MatrixFwd.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsChangeHint.h"
|
||||
@ -36,24 +36,24 @@ nsresult NS_NewSVGElement(mozilla::dom::Element** aResult,
|
||||
namespace mozilla {
|
||||
class DeclarationBlock;
|
||||
|
||||
class DOMSVGStringList;
|
||||
class SVGAnimatedBoolean;
|
||||
class SVGAnimatedEnumeration;
|
||||
class SVGAnimatedInteger;
|
||||
class SVGAnimatedIntegerPair;
|
||||
class SVGAnimatedLengthList;
|
||||
class SVGAnimatedNumberList;
|
||||
class SVGAnimatedNumberPair;
|
||||
class SVGAnimatedOrient;
|
||||
class SVGAnimatedPathSegList;
|
||||
class SVGAnimatedPointList;
|
||||
class SVGAnimatedString;
|
||||
class SVGAnimatedPreserveAspectRatio;
|
||||
class SVGAnimatedTransformList;
|
||||
class SVGAnimatedLengthList;
|
||||
class SVGBoolean;
|
||||
class SVGEnum;
|
||||
class SVGUserUnitList;
|
||||
class SVGInteger;
|
||||
class SVGIntegerPair;
|
||||
class SVGAnimatedViewBox;
|
||||
class SVGNumberList;
|
||||
class SVGNumberPair;
|
||||
class SVGOrient;
|
||||
class SVGString;
|
||||
class SVGStringList;
|
||||
class DOMSVGStringList;
|
||||
class SVGViewBox;
|
||||
class SVGUserUnitList;
|
||||
|
||||
struct SVGEnumMapping;
|
||||
|
||||
@ -376,11 +376,11 @@ class SVGElement : public SVGElementBase // nsIContent
|
||||
};
|
||||
|
||||
struct NumberPairAttributesInfo {
|
||||
SVGNumberPair* const mNumberPairs;
|
||||
SVGAnimatedNumberPair* const mNumberPairs;
|
||||
const NumberPairInfo* const mNumberPairInfo;
|
||||
const uint32_t mNumberPairCount;
|
||||
|
||||
NumberPairAttributesInfo(SVGNumberPair* aNumberPairs,
|
||||
NumberPairAttributesInfo(SVGAnimatedNumberPair* aNumberPairs,
|
||||
NumberPairInfo* aNumberPairInfo,
|
||||
uint32_t aNumberPairCount)
|
||||
: mNumberPairs(aNumberPairs),
|
||||
@ -396,12 +396,12 @@ class SVGElement : public SVGElementBase // nsIContent
|
||||
};
|
||||
|
||||
struct IntegerAttributesInfo {
|
||||
SVGInteger* const mIntegers;
|
||||
SVGAnimatedInteger* const mIntegers;
|
||||
const IntegerInfo* const mIntegerInfo;
|
||||
const uint32_t mIntegerCount;
|
||||
|
||||
IntegerAttributesInfo(SVGInteger* aIntegers, IntegerInfo* aIntegerInfo,
|
||||
uint32_t aIntegerCount)
|
||||
IntegerAttributesInfo(SVGAnimatedInteger* aIntegers,
|
||||
IntegerInfo* aIntegerInfo, uint32_t aIntegerCount)
|
||||
: mIntegers(aIntegers),
|
||||
mIntegerInfo(aIntegerInfo),
|
||||
mIntegerCount(aIntegerCount) {}
|
||||
@ -416,11 +416,11 @@ class SVGElement : public SVGElementBase // nsIContent
|
||||
};
|
||||
|
||||
struct IntegerPairAttributesInfo {
|
||||
SVGIntegerPair* const mIntegerPairs;
|
||||
SVGAnimatedIntegerPair* const mIntegerPairs;
|
||||
const IntegerPairInfo* const mIntegerPairInfo;
|
||||
const uint32_t mIntegerPairCount;
|
||||
|
||||
IntegerPairAttributesInfo(SVGIntegerPair* aIntegerPairs,
|
||||
IntegerPairAttributesInfo(SVGAnimatedIntegerPair* aIntegerPairs,
|
||||
IntegerPairInfo* aIntegerPairInfo,
|
||||
uint32_t aIntegerPairCount)
|
||||
: mIntegerPairs(aIntegerPairs),
|
||||
@ -436,12 +436,12 @@ class SVGElement : public SVGElementBase // nsIContent
|
||||
};
|
||||
|
||||
struct BooleanAttributesInfo {
|
||||
SVGBoolean* const mBooleans;
|
||||
SVGAnimatedBoolean* const mBooleans;
|
||||
const BooleanInfo* const mBooleanInfo;
|
||||
const uint32_t mBooleanCount;
|
||||
|
||||
BooleanAttributesInfo(SVGBoolean* aBooleans, BooleanInfo* aBooleanInfo,
|
||||
uint32_t aBooleanCount)
|
||||
BooleanAttributesInfo(SVGAnimatedBoolean* aBooleans,
|
||||
BooleanInfo* aBooleanInfo, uint32_t aBooleanCount)
|
||||
: mBooleans(aBooleans),
|
||||
mBooleanInfo(aBooleanInfo),
|
||||
mBooleanCount(aBooleanCount) {}
|
||||
@ -449,7 +449,7 @@ class SVGElement : public SVGElementBase // nsIContent
|
||||
void Reset(uint8_t aAttrEnum);
|
||||
};
|
||||
|
||||
friend class mozilla::SVGEnum;
|
||||
friend class mozilla::SVGAnimatedEnumeration;
|
||||
|
||||
struct EnumInfo {
|
||||
nsStaticAtom* const mName;
|
||||
@ -458,11 +458,11 @@ class SVGElement : public SVGElementBase // nsIContent
|
||||
};
|
||||
|
||||
struct EnumAttributesInfo {
|
||||
SVGEnum* const mEnums;
|
||||
SVGAnimatedEnumeration* const mEnums;
|
||||
const EnumInfo* const mEnumInfo;
|
||||
const uint32_t mEnumCount;
|
||||
|
||||
EnumAttributesInfo(SVGEnum* aEnums, EnumInfo* aEnumInfo,
|
||||
EnumAttributesInfo(SVGAnimatedEnumeration* aEnums, EnumInfo* aEnumInfo,
|
||||
uint32_t aEnumCount)
|
||||
: mEnums(aEnums), mEnumInfo(aEnumInfo), mEnumCount(aEnumCount) {}
|
||||
|
||||
@ -525,11 +525,11 @@ class SVGElement : public SVGElementBase // nsIContent
|
||||
};
|
||||
|
||||
struct StringAttributesInfo {
|
||||
SVGString* const mStrings;
|
||||
SVGAnimatedString* const mStrings;
|
||||
const StringInfo* const mStringInfo;
|
||||
const uint32_t mStringCount;
|
||||
|
||||
StringAttributesInfo(SVGString* aStrings, StringInfo* aStringInfo,
|
||||
StringAttributesInfo(SVGAnimatedString* aStrings, StringInfo* aStringInfo,
|
||||
uint32_t aStringCount)
|
||||
: mStrings(aStrings),
|
||||
mStringInfo(aStringInfo),
|
||||
@ -568,9 +568,9 @@ class SVGElement : public SVGElementBase // nsIContent
|
||||
virtual EnumAttributesInfo GetEnumInfo();
|
||||
// We assume all orients, viewboxes and preserveAspectRatios are alike
|
||||
// so we don't need to wrap the class
|
||||
virtual SVGOrient* GetOrient();
|
||||
virtual SVGViewBox* GetViewBox();
|
||||
virtual SVGAnimatedOrient* GetOrient();
|
||||
virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio();
|
||||
virtual SVGAnimatedViewBox* GetViewBox();
|
||||
virtual NumberListAttributesInfo GetNumberListInfo();
|
||||
virtual LengthListAttributesInfo GetLengthListInfo();
|
||||
virtual StringAttributesInfo GetStringInfo();
|
||||
@ -582,7 +582,7 @@ class SVGElement : public SVGElementBase // nsIContent
|
||||
void UnsetAttrInternal(int32_t aNameSpaceID, nsAtom* aAttribute,
|
||||
bool aNotify);
|
||||
|
||||
SVGClass mClassAttribute;
|
||||
SVGAnimatedClass mClassAttribute;
|
||||
nsAutoPtr<nsAttrValue> mClassAnimAttr;
|
||||
RefPtr<mozilla::DeclarationBlock> mContentDeclarationBlock;
|
||||
};
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef mozilla_dom_SVGFEBlendElement_h
|
||||
#define mozilla_dom_SVGFEBlendElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGFilters.h"
|
||||
|
||||
nsresult NS_NewSVGFEBlendElement(
|
||||
@ -36,7 +36,7 @@ class SVGFEBlendElement : public SVGFEBlendElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -53,12 +53,12 @@ class SVGFEBlendElement : public SVGFEBlendElementBase {
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { MODE };
|
||||
SVGEnum mEnumAttributes[1];
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
static SVGEnumMapping sModeMap[];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
|
||||
enum { RESULT, IN1, IN2 };
|
||||
SVGString mStringAttributes[3];
|
||||
SVGAnimatedString mStringAttributes[3];
|
||||
static StringInfo sStringInfo[3];
|
||||
};
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define mozilla_dom_SVGFEColorMatrixElement_h
|
||||
|
||||
#include "SVGAnimatedNumberList.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGFilters.h"
|
||||
|
||||
nsresult NS_NewSVGFEColorMatrixElement(
|
||||
@ -40,7 +40,7 @@ class SVGFEColorMatrixElement : public SVGFEColorMatrixElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -58,12 +58,12 @@ class SVGFEColorMatrixElement : public SVGFEColorMatrixElementBase {
|
||||
virtual NumberListAttributesInfo GetNumberListInfo() override;
|
||||
|
||||
enum { TYPE };
|
||||
SVGEnum mEnumAttributes[1];
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
static SVGEnumMapping sTypeMap[];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
|
||||
enum { VALUES };
|
||||
|
@ -36,7 +36,7 @@ class SVGFEComponentTransferElement : public SVGFEComponentTransferElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -51,7 +51,7 @@ class SVGFEComponentTransferElement : public SVGFEComponentTransferElementBase {
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
};
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef mozilla_dom_SVGFECompositeElement_h
|
||||
#define mozilla_dom_SVGFECompositeElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
|
||||
@ -38,7 +38,7 @@ class SVGFECompositeElement : public SVGFECompositeElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -65,12 +65,12 @@ class SVGFECompositeElement : public SVGFECompositeElementBase {
|
||||
static NumberInfo sNumberInfo[4];
|
||||
|
||||
enum { OPERATOR };
|
||||
SVGEnum mEnumAttributes[1];
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
static SVGEnumMapping sOperatorMap[];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
|
||||
enum { RESULT, IN1, IN2 };
|
||||
SVGString mStringAttributes[3];
|
||||
SVGAnimatedString mStringAttributes[3];
|
||||
static StringInfo sStringInfo[3];
|
||||
};
|
||||
|
||||
|
@ -68,12 +68,12 @@ already_AddRefed<DOMSVGAnimatedString> SVGFEConvolveMatrixElement::In1() {
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedInteger> SVGFEConvolveMatrixElement::OrderX() {
|
||||
return mIntegerPairAttributes[ORDER].ToDOMAnimatedInteger(
|
||||
SVGIntegerPair::eFirst, this);
|
||||
SVGAnimatedIntegerPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedInteger> SVGFEConvolveMatrixElement::OrderY() {
|
||||
return mIntegerPairAttributes[ORDER].ToDOMAnimatedInteger(
|
||||
SVGIntegerPair::eSecond, this);
|
||||
SVGAnimatedIntegerPair::eSecond, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumberList>
|
||||
@ -111,13 +111,13 @@ already_AddRefed<DOMSVGAnimatedNumber> SVGFEConvolveMatrixElement::Bias() {
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGFEConvolveMatrixElement::KernelUnitLengthX() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eFirst, this);
|
||||
SVGAnimatedNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGFEConvolveMatrixElement::KernelUnitLengthY() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eSecond, this);
|
||||
SVGAnimatedNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
void SVGFEConvolveMatrixElement::GetSourceImageNames(
|
||||
@ -135,10 +135,10 @@ FilterPrimitiveDescription SVGFEConvolveMatrixElement::GetPrimitiveDescription(
|
||||
mNumberListAttributes[KERNELMATRIX].GetAnimValue();
|
||||
uint32_t kmLength = kernelMatrix.Length();
|
||||
|
||||
int32_t orderX =
|
||||
mIntegerPairAttributes[ORDER].GetAnimValue(SVGIntegerPair::eFirst);
|
||||
int32_t orderY =
|
||||
mIntegerPairAttributes[ORDER].GetAnimValue(SVGIntegerPair::eSecond);
|
||||
int32_t orderX = mIntegerPairAttributes[ORDER].GetAnimValue(
|
||||
SVGAnimatedIntegerPair::eFirst);
|
||||
int32_t orderY = mIntegerPairAttributes[ORDER].GetAnimValue(
|
||||
SVGAnimatedIntegerPair::eSecond);
|
||||
|
||||
if (orderX <= 0 || orderY <= 0 ||
|
||||
static_cast<uint32_t>(orderX * orderY) != kmLength) {
|
||||
|
@ -8,13 +8,13 @@
|
||||
#define mozilla_dom_SVGFEConvolveMatrixElement_h
|
||||
|
||||
#include "DOMSVGAnimatedNumberList.h"
|
||||
#include "SVGBoolean.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "SVGInteger.h"
|
||||
#include "SVGIntegerPair.h"
|
||||
#include "SVGAnimatedBoolean.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGAnimatedInteger.h"
|
||||
#include "SVGAnimatedIntegerPair.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "SVGFilters.h"
|
||||
|
||||
nsresult NS_NewSVGFEConvolveMatrixElement(
|
||||
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
||||
@ -46,7 +46,7 @@ class SVGFEConvolveMatrixElement : public SVGFEConvolveMatrixElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -82,28 +82,28 @@ class SVGFEConvolveMatrixElement : public SVGFEConvolveMatrixElementBase {
|
||||
static NumberInfo sNumberInfo[2];
|
||||
|
||||
enum { KERNEL_UNIT_LENGTH };
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
SVGAnimatedNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { TARGET_X, TARGET_Y };
|
||||
SVGInteger mIntegerAttributes[2];
|
||||
SVGAnimatedInteger mIntegerAttributes[2];
|
||||
static IntegerInfo sIntegerInfo[2];
|
||||
|
||||
enum { ORDER };
|
||||
SVGIntegerPair mIntegerPairAttributes[1];
|
||||
SVGAnimatedIntegerPair mIntegerPairAttributes[1];
|
||||
static IntegerPairInfo sIntegerPairInfo[1];
|
||||
|
||||
enum { PRESERVEALPHA };
|
||||
SVGBoolean mBooleanAttributes[1];
|
||||
SVGAnimatedBoolean mBooleanAttributes[1];
|
||||
static BooleanInfo sBooleanInfo[1];
|
||||
|
||||
enum { EDGEMODE };
|
||||
SVGEnum mEnumAttributes[1];
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
static SVGEnumMapping sEdgeModeMap[];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
|
||||
enum { KERNELMATRIX };
|
||||
|
@ -45,13 +45,13 @@ SVGFEDiffuseLightingElement::DiffuseConstant() {
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGFEDiffuseLightingElement::KernelUnitLengthX() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eFirst, this);
|
||||
SVGAnimatedNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGFEDiffuseLightingElement::KernelUnitLengthY() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eSecond, this);
|
||||
SVGAnimatedNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
FilterPrimitiveDescription SVGFEDiffuseLightingElement::GetPrimitiveDescription(
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef mozilla_dom_SVGFEDisplacementMapElement_h
|
||||
#define mozilla_dom_SVGFEDisplacementMapElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGFilters.h"
|
||||
|
||||
nsresult NS_NewSVGFEDisplacementMapElement(
|
||||
@ -36,7 +36,7 @@ class SVGFEDisplacementMapElement : public SVGFEDisplacementMapElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -74,12 +74,12 @@ class SVGFEDisplacementMapElement : public SVGFEDisplacementMapElementBase {
|
||||
static NumberInfo sNumberInfo[1];
|
||||
|
||||
enum { CHANNEL_X, CHANNEL_Y };
|
||||
SVGEnum mEnumAttributes[2];
|
||||
SVGAnimatedEnumeration mEnumAttributes[2];
|
||||
static SVGEnumMapping sChannelMap[];
|
||||
static EnumInfo sEnumInfo[2];
|
||||
|
||||
enum { RESULT, IN1, IN2 };
|
||||
SVGString mStringAttributes[3];
|
||||
SVGAnimatedString mStringAttributes[3];
|
||||
static StringInfo sStringInfo[3];
|
||||
};
|
||||
|
||||
|
@ -52,12 +52,12 @@ already_AddRefed<DOMSVGAnimatedNumber> SVGFEDropShadowElement::Dy() {
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumber> SVGFEDropShadowElement::StdDeviationX() {
|
||||
return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eFirst, this);
|
||||
SVGAnimatedNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumber> SVGFEDropShadowElement::StdDeviationY() {
|
||||
return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eSecond, this);
|
||||
SVGAnimatedNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
void SVGFEDropShadowElement::SetStdDeviation(float stdDeviationX,
|
||||
@ -72,10 +72,10 @@ FilterPrimitiveDescription SVGFEDropShadowElement::GetPrimitiveDescription(
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) {
|
||||
float stdX = aInstance->GetPrimitiveNumber(SVGContentUtils::X,
|
||||
&mNumberPairAttributes[STD_DEV],
|
||||
SVGNumberPair::eFirst);
|
||||
SVGAnimatedNumberPair::eFirst);
|
||||
float stdY = aInstance->GetPrimitiveNumber(SVGContentUtils::Y,
|
||||
&mNumberPairAttributes[STD_DEV],
|
||||
SVGNumberPair::eSecond);
|
||||
SVGAnimatedNumberPair::eSecond);
|
||||
if (stdX < 0 || stdY < 0) {
|
||||
return FilterPrimitiveDescription();
|
||||
}
|
||||
|
@ -7,10 +7,10 @@
|
||||
#ifndef mozilla_dom_SVGFEDropShadowElement_h
|
||||
#define mozilla_dom_SVGFEDropShadowElement_h
|
||||
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedNumberPair.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "SVGFilters.h"
|
||||
|
||||
nsresult NS_NewSVGFEDropShadowElement(
|
||||
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
||||
@ -39,7 +39,7 @@ class SVGFEDropShadowElement : public SVGFEDropShadowElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -67,11 +67,11 @@ class SVGFEDropShadowElement : public SVGFEDropShadowElementBase {
|
||||
static NumberInfo sNumberInfo[2];
|
||||
|
||||
enum { STD_DEV };
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
SVGAnimatedNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,7 @@ class SVGFEFloodElement : public SVGFEFloodElementBase {
|
||||
nsSVGFilterInstance* aInstance, const IntRect& aFilterSubregion,
|
||||
const nsTArray<bool>& aInputsAreTainted,
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ class SVGFEFloodElement : public SVGFEFloodElementBase {
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { RESULT };
|
||||
SVGString mStringAttributes[1];
|
||||
SVGAnimatedString mStringAttributes[1];
|
||||
static StringInfo sStringInfo[1];
|
||||
};
|
||||
|
||||
|
@ -42,13 +42,13 @@ already_AddRefed<DOMSVGAnimatedString> SVGFEGaussianBlurElement::In1() {
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGFEGaussianBlurElement::StdDeviationX() {
|
||||
return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eFirst, this);
|
||||
SVGAnimatedNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGFEGaussianBlurElement::StdDeviationY() {
|
||||
return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eSecond, this);
|
||||
SVGAnimatedNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
void SVGFEGaussianBlurElement::SetStdDeviation(float stdDeviationX,
|
||||
@ -63,10 +63,10 @@ FilterPrimitiveDescription SVGFEGaussianBlurElement::GetPrimitiveDescription(
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) {
|
||||
float stdX = aInstance->GetPrimitiveNumber(SVGContentUtils::X,
|
||||
&mNumberPairAttributes[STD_DEV],
|
||||
SVGNumberPair::eFirst);
|
||||
SVGAnimatedNumberPair::eFirst);
|
||||
float stdY = aInstance->GetPrimitiveNumber(SVGContentUtils::Y,
|
||||
&mNumberPairAttributes[STD_DEV],
|
||||
SVGNumberPair::eSecond);
|
||||
SVGAnimatedNumberPair::eSecond);
|
||||
if (stdX < 0 || stdY < 0) {
|
||||
return FilterPrimitiveDescription();
|
||||
}
|
||||
|
@ -7,9 +7,9 @@
|
||||
#ifndef mozilla_dom_SVGFEGaussianBlurElement_h
|
||||
#define mozilla_dom_SVGFEGaussianBlurElement_h
|
||||
|
||||
#include "SVGAnimatedNumberPair.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "SVGString.h"
|
||||
|
||||
nsresult NS_NewSVGFEGaussianBlurElement(
|
||||
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
||||
@ -38,7 +38,7 @@ class SVGFEGaussianBlurElement : public SVGFEGaussianBlurElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -56,11 +56,11 @@ class SVGFEGaussianBlurElement : public SVGFEGaussianBlurElementBase {
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { STD_DEV };
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
SVGAnimatedNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
};
|
||||
|
||||
|
@ -49,7 +49,7 @@ class SVGFEImageElement final : public SVGFEImageElementBase,
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual bool OutputIsTainted(const nsTArray<bool>& aInputsAreTainted,
|
||||
@ -95,7 +95,7 @@ class SVGFEImageElement final : public SVGFEImageElementBase,
|
||||
nsIContent* AsContent() override { return this; }
|
||||
|
||||
enum { RESULT, HREF, XLINK_HREF };
|
||||
SVGString mStringAttributes[3];
|
||||
SVGAnimatedString mStringAttributes[3];
|
||||
static StringInfo sStringInfo[3];
|
||||
|
||||
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
||||
|
@ -34,7 +34,7 @@ class SVGFEMergeElement : public SVGFEMergeElementBase {
|
||||
nsSVGFilterInstance* aInstance, const IntRect& aFilterSubregion,
|
||||
const nsTArray<bool>& aInputsAreTainted,
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -46,7 +46,7 @@ class SVGFEMergeElement : public SVGFEMergeElementBase {
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { RESULT };
|
||||
SVGString mStringAttributes[1];
|
||||
SVGAnimatedString mStringAttributes[1];
|
||||
static StringInfo sStringInfo[1];
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,7 @@ class SVGFEMergeNodeElement : public SVGFEMergeNodeElementBase {
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
|
||||
const SVGString* GetIn1() { return &mStringAttributes[IN1]; }
|
||||
const SVGAnimatedString* GetIn1() { return &mStringAttributes[IN1]; }
|
||||
|
||||
// WebIDL
|
||||
already_AddRefed<DOMSVGAnimatedString> In1();
|
||||
@ -44,7 +44,7 @@ class SVGFEMergeNodeElement : public SVGFEMergeNodeElementBase {
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { IN1 };
|
||||
SVGString mStringAttributes[1];
|
||||
SVGAnimatedString mStringAttributes[1];
|
||||
static StringInfo sStringInfo[1];
|
||||
};
|
||||
|
||||
|
@ -53,12 +53,12 @@ already_AddRefed<DOMSVGAnimatedEnumeration> SVGFEMorphologyElement::Operator() {
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumber> SVGFEMorphologyElement::RadiusX() {
|
||||
return mNumberPairAttributes[RADIUS].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eFirst, this);
|
||||
SVGAnimatedNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumber> SVGFEMorphologyElement::RadiusY() {
|
||||
return mNumberPairAttributes[RADIUS].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eSecond, this);
|
||||
SVGAnimatedNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
void SVGFEMorphologyElement::SetRadius(float rx, float ry) {
|
||||
@ -80,11 +80,11 @@ void SVGFEMorphologyElement::GetRXY(int32_t* aRX, int32_t* aRY,
|
||||
// issues.
|
||||
*aRX = NSToIntCeil(aInstance.GetPrimitiveNumber(
|
||||
SVGContentUtils::X, &mNumberPairAttributes[RADIUS],
|
||||
SVGNumberPair::eFirst) -
|
||||
SVGAnimatedNumberPair::eFirst) -
|
||||
MORPHOLOGY_EPSILON);
|
||||
*aRY = NSToIntCeil(aInstance.GetPrimitiveNumber(
|
||||
SVGContentUtils::Y, &mNumberPairAttributes[RADIUS],
|
||||
SVGNumberPair::eSecond) -
|
||||
SVGAnimatedNumberPair::eSecond) -
|
||||
MORPHOLOGY_EPSILON);
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,10 @@
|
||||
#ifndef mozilla_dom_SVGFEMorphologyElement_h
|
||||
#define mozilla_dom_SVGFEMorphologyElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGAnimatedNumberPair.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "SVGString.h"
|
||||
|
||||
nsresult NS_NewSVGFEMorphologyElement(
|
||||
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
||||
@ -39,7 +39,7 @@ class SVGFEMorphologyElement : public SVGFEMorphologyElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -61,16 +61,16 @@ class SVGFEMorphologyElement : public SVGFEMorphologyElementBase {
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { RADIUS };
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
SVGAnimatedNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { OPERATOR };
|
||||
SVGEnum mEnumAttributes[1];
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
static SVGEnumMapping sOperatorMap[];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
};
|
||||
|
||||
|
@ -7,9 +7,9 @@
|
||||
#ifndef mozilla_dom_SVGFEOffsetElement_h
|
||||
#define mozilla_dom_SVGFEOffsetElement_h
|
||||
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "SVGFilters.h"
|
||||
|
||||
nsresult NS_NewSVGFEOffsetElement(
|
||||
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
||||
@ -38,7 +38,7 @@ class SVGFEOffsetElement : public SVGFEOffsetElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -59,7 +59,7 @@ class SVGFEOffsetElement : public SVGFEOffsetElementBase {
|
||||
static NumberInfo sNumberInfo[2];
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
};
|
||||
|
||||
|
@ -48,13 +48,13 @@ SVGFESpecularLightingElement::SpecularExponent() {
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGFESpecularLightingElement::KernelUnitLengthX() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eFirst, this);
|
||||
SVGAnimatedNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGFESpecularLightingElement::KernelUnitLengthY() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eSecond, this);
|
||||
SVGAnimatedNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -38,7 +38,7 @@ class SVGFETileElement : public SVGFETileElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -52,7 +52,7 @@ class SVGFETileElement : public SVGFETileElementBase {
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
};
|
||||
|
||||
|
@ -63,13 +63,13 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFETurbulenceElement)
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGFETurbulenceElement::BaseFrequencyX() {
|
||||
return mNumberPairAttributes[BASE_FREQ].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eFirst, this);
|
||||
SVGAnimatedNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumber>
|
||||
SVGFETurbulenceElement::BaseFrequencyY() {
|
||||
return mNumberPairAttributes[BASE_FREQ].ToDOMAnimatedNumber(
|
||||
SVGNumberPair::eSecond, this);
|
||||
SVGAnimatedNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedInteger> SVGFETurbulenceElement::NumOctaves() {
|
||||
@ -93,10 +93,10 @@ FilterPrimitiveDescription SVGFETurbulenceElement::GetPrimitiveDescription(
|
||||
nsSVGFilterInstance* aInstance, const IntRect& aFilterSubregion,
|
||||
const nsTArray<bool>& aInputsAreTainted,
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) {
|
||||
float fX =
|
||||
mNumberPairAttributes[BASE_FREQ].GetAnimValue(SVGNumberPair::eFirst);
|
||||
float fY =
|
||||
mNumberPairAttributes[BASE_FREQ].GetAnimValue(SVGNumberPair::eSecond);
|
||||
float fX = mNumberPairAttributes[BASE_FREQ].GetAnimValue(
|
||||
SVGAnimatedNumberPair::eFirst);
|
||||
float fY = mNumberPairAttributes[BASE_FREQ].GetAnimValue(
|
||||
SVGAnimatedNumberPair::eSecond);
|
||||
float seed = mNumberAttributes[OCTAVES].GetAnimValue();
|
||||
uint32_t octaves =
|
||||
clamped(mIntegerAttributes[OCTAVES].GetAnimValue(), 0, MAX_OCTAVES);
|
||||
|
@ -7,11 +7,11 @@
|
||||
#ifndef mozilla_dom_SVGFETurbulenceElement_h
|
||||
#define mozilla_dom_SVGFETurbulenceElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGAnimatedInteger.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "SVGInteger.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "SVGFilters.h"
|
||||
|
||||
nsresult NS_NewSVGFETurbulenceElement(
|
||||
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
||||
@ -42,7 +42,7 @@ class SVGFETurbulenceElement : public SVGFETurbulenceElementBase {
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
|
||||
@ -68,21 +68,21 @@ class SVGFETurbulenceElement : public SVGFETurbulenceElementBase {
|
||||
static NumberInfo sNumberInfo[1];
|
||||
|
||||
enum { BASE_FREQ };
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
SVGAnimatedNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { OCTAVES };
|
||||
SVGInteger mIntegerAttributes[1];
|
||||
SVGAnimatedInteger mIntegerAttributes[1];
|
||||
static IntegerInfo sIntegerInfo[1];
|
||||
|
||||
enum { TYPE, STITCHTILES };
|
||||
SVGEnum mEnumAttributes[2];
|
||||
SVGAnimatedEnumeration mEnumAttributes[2];
|
||||
static SVGEnumMapping sTypeMap[];
|
||||
static SVGEnumMapping sStitchTilesMap[];
|
||||
static EnumInfo sEnumInfo[2];
|
||||
|
||||
enum { RESULT };
|
||||
SVGString mStringAttributes[1];
|
||||
SVGAnimatedString mStringAttributes[1];
|
||||
static StringInfo sStringInfo[1];
|
||||
};
|
||||
|
||||
|
@ -7,9 +7,9 @@
|
||||
#ifndef mozilla_dom_SVGFilterElement_h
|
||||
#define mozilla_dom_SVGFilterElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
|
||||
class nsSVGFilterFrame;
|
||||
@ -64,11 +64,11 @@ class SVGFilterElement : public SVGFilterElementBase {
|
||||
static LengthInfo sLengthInfo[4];
|
||||
|
||||
enum { FILTERUNITS, PRIMITIVEUNITS };
|
||||
SVGEnum mEnumAttributes[2];
|
||||
SVGAnimatedEnumeration mEnumAttributes[2];
|
||||
static EnumInfo sEnumInfo[2];
|
||||
|
||||
enum { HREF, XLINK_HREF };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
};
|
||||
|
||||
|
@ -14,11 +14,11 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGAnimatedNumberPair.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "nsSVGFilterInstance.h"
|
||||
#include "SVGNumberList.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "SVGString.h"
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
#include "mozilla/SVGContentUtils.h"
|
||||
@ -144,15 +144,15 @@ bool SVGFE::HasValidDimensions() const {
|
||||
}
|
||||
|
||||
Size SVGFE::GetKernelUnitLength(nsSVGFilterInstance* aInstance,
|
||||
SVGNumberPair* aKernelUnitLength) {
|
||||
SVGAnimatedNumberPair* aKernelUnitLength) {
|
||||
if (!aKernelUnitLength->IsExplicitlySet()) {
|
||||
return Size(1, 1);
|
||||
}
|
||||
|
||||
float kernelX = aInstance->GetPrimitiveNumber(
|
||||
SVGContentUtils::X, aKernelUnitLength, SVGNumberPair::eFirst);
|
||||
SVGContentUtils::X, aKernelUnitLength, SVGAnimatedNumberPair::eFirst);
|
||||
float kernelY = aInstance->GetPrimitiveNumber(
|
||||
SVGContentUtils::Y, aKernelUnitLength, SVGNumberPair::eSecond);
|
||||
SVGContentUtils::Y, aKernelUnitLength, SVGAnimatedNumberPair::eSecond);
|
||||
return Size(kernelX, kernelY);
|
||||
}
|
||||
|
||||
|
@ -11,10 +11,10 @@
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
#include "FilterSupport.h"
|
||||
#include "nsImageLoadingContent.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGString.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "SVGAnimatedNumberPair.h"
|
||||
|
||||
class nsSVGFilterInstance;
|
||||
|
||||
@ -22,10 +22,10 @@ namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
struct SVGStringInfo {
|
||||
SVGStringInfo(const SVGString* aString, SVGElement* aElement)
|
||||
SVGStringInfo(const SVGAnimatedString* aString, SVGElement* aElement)
|
||||
: mString(aString), mElement(aElement) {}
|
||||
|
||||
const SVGString* mString;
|
||||
const SVGAnimatedString* mString;
|
||||
SVGElement* mElement;
|
||||
};
|
||||
|
||||
@ -95,7 +95,7 @@ class SVGFE : public SVGFEBase {
|
||||
return !(aFlags & ~eFILTER);
|
||||
}
|
||||
|
||||
virtual SVGString& GetResultImageName() = 0;
|
||||
virtual SVGAnimatedString& GetResultImageName() = 0;
|
||||
// Return a list of all image names used as sources. Default is to
|
||||
// return no sources.
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources);
|
||||
@ -146,7 +146,7 @@ class SVGFE : public SVGFEBase {
|
||||
virtual LengthAttributesInfo GetLengthInfo() override;
|
||||
|
||||
Size GetKernelUnitLength(nsSVGFilterInstance* aInstance,
|
||||
SVGNumberPair* aKernelUnitLength);
|
||||
SVGAnimatedNumberPair* aKernelUnitLength);
|
||||
|
||||
enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
|
||||
nsSVGLength2 mLengthAttributes[4];
|
||||
@ -192,7 +192,7 @@ class SVGFELightingElement : public SVGFELightingElementBase {
|
||||
|
||||
virtual bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute) const override;
|
||||
virtual SVGString& GetResultImageName() override {
|
||||
virtual SVGAnimatedString& GetResultImageName() override {
|
||||
return mStringAttributes[RESULT];
|
||||
}
|
||||
virtual void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
|
||||
@ -225,11 +225,11 @@ class SVGFELightingElement : public SVGFELightingElementBase {
|
||||
static NumberInfo sNumberInfo[4];
|
||||
|
||||
enum { KERNEL_UNIT_LENGTH };
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
SVGAnimatedNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
};
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
#define __NS_SVGGRADIENTELEMENT_H__
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "SVGAnimatedTransformList.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
|
||||
@ -64,12 +64,12 @@ class SVGGradientElement : public SVGGradientElementBase {
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { GRADIENTUNITS, SPREADMETHOD };
|
||||
SVGEnum mEnumAttributes[2];
|
||||
SVGAnimatedEnumeration mEnumAttributes[2];
|
||||
static SVGEnumMapping sSpreadMethodMap[];
|
||||
static EnumInfo sEnumInfo[2];
|
||||
|
||||
enum { HREF, XLINK_HREF };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
|
||||
// SVGGradientElement values
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "nsImageLoadingContent.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "SVGGeometryElement.h"
|
||||
#include "SVGAnimatedPreserveAspectRatio.h"
|
||||
|
||||
@ -112,7 +112,7 @@ class SVGImageElement : public SVGImageElementBase,
|
||||
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
||||
|
||||
enum { HREF, XLINK_HREF };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
};
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
#define mozilla_dom_SVGMPathElement_h
|
||||
|
||||
#include "mozilla/dom/IDTracker.h"
|
||||
#include "SVGElement.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
#include "nsStubMutationObserver.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
|
||||
nsresult NS_NewSVGMPathElement(
|
||||
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
||||
@ -110,7 +110,7 @@ class SVGMPathElement final : public SVGMPathElementBase,
|
||||
void NotifyParentOfMpathChange(nsIContent* aParent);
|
||||
|
||||
enum { HREF, XLINK_HREF };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
PathElementTracker mPathTracker;
|
||||
};
|
||||
|
@ -165,9 +165,9 @@ SVGElement::EnumAttributesInfo SVGMarkerElement::GetEnumInfo() {
|
||||
return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo));
|
||||
}
|
||||
|
||||
SVGOrient* SVGMarkerElement::GetOrient() { return &mOrient; }
|
||||
SVGAnimatedOrient* SVGMarkerElement::GetOrient() { return &mOrient; }
|
||||
|
||||
SVGViewBox* SVGMarkerElement::GetViewBox() { return &mViewBox; }
|
||||
SVGAnimatedViewBox* SVGMarkerElement::GetViewBox() { return &mViewBox; }
|
||||
|
||||
SVGAnimatedPreserveAspectRatio* SVGMarkerElement::GetPreserveAspectRatio() {
|
||||
return &mPreserveAspectRatio;
|
||||
|
@ -10,11 +10,11 @@
|
||||
#include "DOMSVGAnimatedAngle.h"
|
||||
#include "DOMSVGAnimatedEnumeration.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "SVGAnimatedPreserveAspectRatio.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGOrient.h"
|
||||
#include "SVGViewBox.h"
|
||||
#include "SVGAnimatedOrient.h"
|
||||
#include "SVGAnimatedPreserveAspectRatio.h"
|
||||
#include "SVGAnimatedViewBox.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
#include "mozilla/dom/SVGMarkerElementBinding.h"
|
||||
@ -79,21 +79,21 @@ class SVGMarkerElement : public SVGMarkerElementBase {
|
||||
|
||||
virtual LengthAttributesInfo GetLengthInfo() override;
|
||||
virtual EnumAttributesInfo GetEnumInfo() override;
|
||||
virtual SVGOrient* GetOrient() override;
|
||||
virtual SVGViewBox* GetViewBox() override;
|
||||
virtual SVGAnimatedOrient* GetOrient() override;
|
||||
virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
|
||||
virtual SVGAnimatedViewBox* GetViewBox() override;
|
||||
|
||||
enum { REFX, REFY, MARKERWIDTH, MARKERHEIGHT };
|
||||
nsSVGLength2 mLengthAttributes[4];
|
||||
static LengthInfo sLengthInfo[4];
|
||||
|
||||
enum { MARKERUNITS };
|
||||
SVGEnum mEnumAttributes[1];
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
static SVGEnumMapping sUnitsMap[];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
|
||||
SVGOrient mOrient;
|
||||
SVGViewBox mViewBox;
|
||||
SVGAnimatedOrient mOrient;
|
||||
SVGAnimatedViewBox mViewBox;
|
||||
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
||||
|
||||
SVGViewportElement* mCoordCtx;
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef mozilla_dom_SVGMaskElement_h
|
||||
#define mozilla_dom_SVGMaskElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
|
||||
@ -59,7 +59,7 @@ class SVGMaskElement final : public SVGMaskElementBase {
|
||||
static LengthInfo sLengthInfo[4];
|
||||
|
||||
enum { MASKUNITS, MASKCONTENTUNITS };
|
||||
SVGEnum mEnumAttributes[2];
|
||||
SVGAnimatedEnumeration mEnumAttributes[2];
|
||||
static EnumInfo sEnumInfo[2];
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "mozilla/SMILParserUtils.h"
|
||||
#include "nsAttrValue.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "SVGOrient.h"
|
||||
#include "SVGAnimatedOrient.h"
|
||||
#include "SVGMotionSMILPathUtils.h"
|
||||
#include "SVGMotionSMILType.h"
|
||||
#include "SVGPathDataParser.h"
|
||||
@ -391,7 +391,8 @@ nsresult SVGMotionSMILAnimationFunction::SetRotate(const nsAString& aRotate,
|
||||
mRotateType = eRotateType_Explicit;
|
||||
|
||||
uint16_t angleUnit;
|
||||
if (!SVGOrient::GetValueFromString(aRotate, mRotateAngle, &angleUnit)) {
|
||||
if (!SVGAnimatedOrient::GetValueFromString(aRotate, mRotateAngle,
|
||||
&angleUnit)) {
|
||||
mRotateAngle = 0.0f; // set default rotate angle
|
||||
// XXX report to console?
|
||||
return NS_ERROR_DOM_SYNTAX_ERR;
|
||||
@ -399,8 +400,8 @@ nsresult SVGMotionSMILAnimationFunction::SetRotate(const nsAString& aRotate,
|
||||
|
||||
// Convert to radian units, if we're not already in radians.
|
||||
if (angleUnit != SVG_ANGLETYPE_RAD) {
|
||||
mRotateAngle *= SVGOrient::GetDegreesPerUnit(angleUnit) /
|
||||
SVGOrient::GetDegreesPerUnit(SVG_ANGLETYPE_RAD);
|
||||
mRotateAngle *= SVGAnimatedOrient::GetDegreesPerUnit(angleUnit) /
|
||||
SVGAnimatedOrient::GetDegreesPerUnit(SVG_ANGLETYPE_RAD);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "mozilla/SMILValue.h"
|
||||
#include "mozilla/dom/SVGMarkerElement.h"
|
||||
#include "nsDebug.h"
|
||||
#include "SVGOrient.h"
|
||||
#include "SVGAnimatedOrient.h"
|
||||
#include <math.h>
|
||||
|
||||
namespace mozilla {
|
||||
@ -69,17 +69,19 @@ nsresult SVGOrientSMILType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
|
||||
|
||||
// We may be dealing with two different angle units, so we normalize to
|
||||
// degrees for the add:
|
||||
float currentAngle = aDest.mU.mOrient.mAngle *
|
||||
SVGOrient::GetDegreesPerUnit(aDest.mU.mOrient.mUnit);
|
||||
float currentAngle =
|
||||
aDest.mU.mOrient.mAngle *
|
||||
SVGAnimatedOrient::GetDegreesPerUnit(aDest.mU.mOrient.mUnit);
|
||||
float angleToAdd =
|
||||
aValueToAdd.mU.mOrient.mAngle *
|
||||
SVGOrient::GetDegreesPerUnit(aValueToAdd.mU.mOrient.mUnit) * aCount;
|
||||
SVGAnimatedOrient::GetDegreesPerUnit(aValueToAdd.mU.mOrient.mUnit) *
|
||||
aCount;
|
||||
|
||||
// And then we give the resulting animated value the same units as the value
|
||||
// that we're animating to/by (i.e. the same as aValueToAdd):
|
||||
aDest.mU.mOrient.mAngle =
|
||||
(currentAngle + angleToAdd) /
|
||||
SVGOrient::GetDegreesPerUnit(aValueToAdd.mU.mOrient.mUnit);
|
||||
SVGAnimatedOrient::GetDegreesPerUnit(aValueToAdd.mU.mOrient.mUnit);
|
||||
aDest.mU.mOrient.mUnit = aValueToAdd.mU.mOrient.mUnit;
|
||||
|
||||
return NS_OK;
|
||||
@ -99,9 +101,9 @@ nsresult SVGOrientSMILType::ComputeDistance(const SMILValue& aFrom,
|
||||
|
||||
// Normalize both to degrees in case they're different angle units:
|
||||
double from = aFrom.mU.mOrient.mAngle *
|
||||
SVGOrient::GetDegreesPerUnit(aFrom.mU.mOrient.mUnit);
|
||||
SVGAnimatedOrient::GetDegreesPerUnit(aFrom.mU.mOrient.mUnit);
|
||||
double to = aTo.mU.mOrient.mAngle *
|
||||
SVGOrient::GetDegreesPerUnit(aTo.mU.mOrient.mUnit);
|
||||
SVGAnimatedOrient::GetDegreesPerUnit(aTo.mU.mOrient.mUnit);
|
||||
|
||||
aDistance = fabs(to - from);
|
||||
|
||||
@ -123,15 +125,16 @@ nsresult SVGOrientSMILType::Interpolate(const SMILValue& aStartVal,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
float start = aStartVal.mU.mOrient.mAngle *
|
||||
SVGOrient::GetDegreesPerUnit(aStartVal.mU.mOrient.mUnit);
|
||||
float start =
|
||||
aStartVal.mU.mOrient.mAngle *
|
||||
SVGAnimatedOrient::GetDegreesPerUnit(aStartVal.mU.mOrient.mUnit);
|
||||
float end = aEndVal.mU.mOrient.mAngle *
|
||||
SVGOrient::GetDegreesPerUnit(aEndVal.mU.mOrient.mUnit);
|
||||
SVGAnimatedOrient::GetDegreesPerUnit(aEndVal.mU.mOrient.mUnit);
|
||||
float result = (start + (end - start) * aUnitDistance);
|
||||
|
||||
// Again, we use the unit of the to/by value for the result:
|
||||
aResult.mU.mOrient.mAngle =
|
||||
result / SVGOrient::GetDegreesPerUnit(aEndVal.mU.mOrient.mUnit);
|
||||
result / SVGAnimatedOrient::GetDegreesPerUnit(aEndVal.mU.mOrient.mUnit);
|
||||
aResult.mU.mOrient.mUnit = aEndVal.mU.mOrient.mUnit;
|
||||
|
||||
return NS_OK;
|
||||
|
@ -162,7 +162,7 @@ SVGElement::EnumAttributesInfo SVGPatternElement::GetEnumInfo() {
|
||||
return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo));
|
||||
}
|
||||
|
||||
SVGViewBox* SVGPatternElement::GetViewBox() { return &mViewBox; }
|
||||
SVGAnimatedViewBox* SVGPatternElement::GetViewBox() { return &mViewBox; }
|
||||
|
||||
SVGAnimatedPreserveAspectRatio* SVGPatternElement::GetPreserveAspectRatio() {
|
||||
return &mPreserveAspectRatio;
|
||||
|
@ -8,12 +8,12 @@
|
||||
#define mozilla_dom_SVGPatternElement_h
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "SVGAnimatedPreserveAspectRatio.h"
|
||||
#include "SVGAnimatedTransformList.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGViewBox.h"
|
||||
#include "SVGAnimatedPreserveAspectRatio.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "SVGAnimatedTransformList.h"
|
||||
#include "SVGAnimatedViewBox.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
|
||||
class nsSVGPatternFrame;
|
||||
@ -72,26 +72,26 @@ class SVGPatternElement final : public SVGPatternElementBase {
|
||||
protected:
|
||||
virtual LengthAttributesInfo GetLengthInfo() override;
|
||||
virtual EnumAttributesInfo GetEnumInfo() override;
|
||||
virtual SVGViewBox* GetViewBox() override;
|
||||
virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
|
||||
virtual SVGAnimatedViewBox* GetViewBox() override;
|
||||
|
||||
enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
|
||||
nsSVGLength2 mLengthAttributes[4];
|
||||
static LengthInfo sLengthInfo[4];
|
||||
|
||||
enum { PATTERNUNITS, PATTERNCONTENTUNITS };
|
||||
SVGEnum mEnumAttributes[2];
|
||||
SVGAnimatedEnumeration mEnumAttributes[2];
|
||||
static EnumInfo sEnumInfo[2];
|
||||
|
||||
nsAutoPtr<mozilla::SVGAnimatedTransformList> mPatternTransform;
|
||||
|
||||
enum { HREF, XLINK_HREF };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
|
||||
// SVGFitToViewbox properties
|
||||
SVGViewBox mViewBox;
|
||||
SVGAnimatedViewBox mViewBox;
|
||||
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
||||
};
|
||||
|
||||
|
@ -638,7 +638,7 @@ SVGViewElement* SVGSVGElement::GetCurrentViewElement() const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const SVGViewBox& SVGSVGElement::GetViewBoxInternal() const {
|
||||
const SVGAnimatedViewBox& SVGSVGElement::GetViewBoxInternal() const {
|
||||
SVGViewElement* viewElement = GetCurrentViewElement();
|
||||
|
||||
if (viewElement && viewElement->mViewBox.HasRect()) {
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef mozilla_dom_SVGSVGElement_h
|
||||
#define mozilla_dom_SVGSVGElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGViewportElement.h"
|
||||
|
||||
nsresult NS_NewSVGSVGElement(
|
||||
@ -33,8 +33,8 @@ class SVGView {
|
||||
public:
|
||||
SVGView();
|
||||
|
||||
mozilla::SVGEnum mZoomAndPan;
|
||||
SVGViewBox mViewBox;
|
||||
SVGAnimatedEnumeration mZoomAndPan;
|
||||
SVGAnimatedViewBox mViewBox;
|
||||
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
||||
nsAutoPtr<SVGAnimatedTransformList> mTransforms;
|
||||
};
|
||||
@ -219,14 +219,14 @@ class SVGSVGElement final : public SVGSVGElementBase {
|
||||
}
|
||||
virtual float GetCurrentScale() const override { return mCurrentScale; }
|
||||
|
||||
virtual const SVGViewBox& GetViewBoxInternal() const override;
|
||||
virtual const SVGAnimatedViewBox& GetViewBoxInternal() const override;
|
||||
virtual SVGAnimatedTransformList* GetTransformInternal() const override;
|
||||
|
||||
virtual EnumAttributesInfo GetEnumInfo() override;
|
||||
|
||||
enum { ZOOMANDPAN };
|
||||
mozilla::SVGEnum mEnumAttributes[1];
|
||||
static mozilla::SVGEnumMapping sZoomAndPanMap[];
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
static SVGEnumMapping sZoomAndPanMap[];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
|
||||
// The time container for animations within this SVG document fragment. Set
|
||||
|
@ -7,10 +7,10 @@
|
||||
#ifndef mozilla_dom_SVGScriptElement_h
|
||||
#define mozilla_dom_SVGScriptElement_h
|
||||
|
||||
#include "SVGElement.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "mozilla/AlreadyAddRefed.h"
|
||||
#include "mozilla/dom/ScriptElement.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
|
||||
nsresult NS_NewSVGScriptElement(
|
||||
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
||||
@ -81,7 +81,7 @@ class SVGScriptElement final : public SVGScriptElementBase,
|
||||
virtual bool GetAsyncState() override { return false; }
|
||||
|
||||
enum { HREF, XLINK_HREF };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
};
|
||||
|
||||
|
@ -37,8 +37,10 @@ class SVGTSpanElement final : public SVGTSpanElementBase {
|
||||
virtual EnumAttributesInfo GetEnumInfo() override;
|
||||
virtual LengthAttributesInfo GetLengthInfo() override;
|
||||
|
||||
SVGEnum mEnumAttributes[1];
|
||||
virtual SVGEnum* EnumAttributes() override { return mEnumAttributes; }
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
virtual SVGAnimatedEnumeration* EnumAttributes() override {
|
||||
return mEnumAttributes;
|
||||
}
|
||||
|
||||
nsSVGLength2 mLengthAttributes[1];
|
||||
virtual nsSVGLength2* LengthAttributes() override {
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "mozilla/dom/SVGGraphicsElement.h"
|
||||
#include "DOMSVGAnimatedEnumeration.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "nsSVGLength2.h"
|
||||
|
||||
class SVGTextFrame;
|
||||
@ -60,7 +60,7 @@ class SVGTextContentElement : public SVGTextContentElementBase {
|
||||
GetNonLayoutDependentNumberOfChars();
|
||||
|
||||
enum { LENGTHADJUST };
|
||||
virtual SVGEnum* EnumAttributes() = 0;
|
||||
virtual SVGAnimatedEnumeration* EnumAttributes() = 0;
|
||||
static SVGEnumMapping sLengthAdjustMap[];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
|
||||
|
@ -37,8 +37,10 @@ class SVGTextElement final : public SVGTextElementBase {
|
||||
virtual EnumAttributesInfo GetEnumInfo() override;
|
||||
virtual LengthAttributesInfo GetLengthInfo() override;
|
||||
|
||||
SVGEnum mEnumAttributes[1];
|
||||
virtual SVGEnum* EnumAttributes() override { return mEnumAttributes; }
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
virtual SVGAnimatedEnumeration* EnumAttributes() override {
|
||||
return mEnumAttributes;
|
||||
}
|
||||
|
||||
nsSVGLength2 mLengthAttributes[1];
|
||||
virtual nsSVGLength2* LengthAttributes() override {
|
||||
|
@ -7,10 +7,10 @@
|
||||
#ifndef mozilla_dom_SVGTextPathElement_h
|
||||
#define mozilla_dom_SVGTextPathElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGAnimatedPathSegList.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "mozilla/dom/SVGTextContentElement.h"
|
||||
|
||||
class nsAtom;
|
||||
@ -72,15 +72,17 @@ class SVGTextPathElement final : public SVGTextPathElementBase {
|
||||
static LengthInfo sLengthInfo[2];
|
||||
|
||||
enum { /* LENGTHADJUST, */ METHOD = 1, SPACING, SIDE };
|
||||
SVGEnum mEnumAttributes[4];
|
||||
virtual SVGEnum* EnumAttributes() override { return mEnumAttributes; }
|
||||
SVGAnimatedEnumeration mEnumAttributes[4];
|
||||
virtual SVGAnimatedEnumeration* EnumAttributes() override {
|
||||
return mEnumAttributes;
|
||||
}
|
||||
static SVGEnumMapping sMethodMap[];
|
||||
static SVGEnumMapping sSpacingMap[];
|
||||
static SVGEnumMapping sSideMap[];
|
||||
static EnumInfo sEnumInfo[4];
|
||||
|
||||
enum { HREF, XLINK_HREF };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
|
||||
SVGAnimatedPathSegList mPath;
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsStubMutationObserver.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGString.h"
|
||||
#include "SVGAnimatedString.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
class nsIContent;
|
||||
@ -144,7 +144,7 @@ class SVGUseElement final : public SVGUseElementBase,
|
||||
static LengthInfo sLengthInfo[4];
|
||||
|
||||
enum { HREF, XLINK_HREF };
|
||||
SVGString mStringAttributes[2];
|
||||
SVGAnimatedString mStringAttributes[2];
|
||||
static StringInfo sStringInfo[2];
|
||||
|
||||
RefPtr<SVGUseElement> mOriginal; // if we've been cloned, our "real" copy
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "mozilla/SMILValue.h"
|
||||
#include "nsDebug.h"
|
||||
#include "SVGViewBox.h"
|
||||
#include "SVGAnimatedViewBox.h"
|
||||
#include <math.h>
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -67,7 +67,7 @@ SVGElement::EnumAttributesInfo SVGViewElement::GetEnumInfo() {
|
||||
return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo));
|
||||
}
|
||||
|
||||
SVGViewBox* SVGViewElement::GetViewBox() { return &mViewBox; }
|
||||
SVGAnimatedViewBox* SVGViewElement::GetViewBox() { return &mViewBox; }
|
||||
|
||||
SVGAnimatedPreserveAspectRatio* SVGViewElement::GetPreserveAspectRatio() {
|
||||
return &mPreserveAspectRatio;
|
||||
|
@ -7,10 +7,10 @@
|
||||
#ifndef mozilla_dom_SVGViewElement_h
|
||||
#define mozilla_dom_SVGViewElement_h
|
||||
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "SVGAnimatedPreserveAspectRatio.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedViewBox.h"
|
||||
#include "SVGStringList.h"
|
||||
#include "SVGViewBox.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
|
||||
class nsSVGOuterSVGFrame;
|
||||
@ -54,14 +54,14 @@ class SVGViewElement : public SVGViewElementBase {
|
||||
virtual EnumAttributesInfo GetEnumInfo() override;
|
||||
|
||||
enum { ZOOMANDPAN };
|
||||
SVGEnum mEnumAttributes[1];
|
||||
SVGAnimatedEnumeration mEnumAttributes[1];
|
||||
static SVGEnumMapping sZoomAndPanMap[];
|
||||
static EnumInfo sEnumInfo[1];
|
||||
|
||||
virtual SVGViewBox* GetViewBox() override;
|
||||
virtual SVGAnimatedViewBox* GetViewBox() override;
|
||||
virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
|
||||
|
||||
SVGViewBox mViewBox;
|
||||
SVGAnimatedViewBox mViewBox;
|
||||
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
||||
};
|
||||
|
||||
|
@ -310,7 +310,7 @@ bool SVGViewportElement::HasValidDimensions() const {
|
||||
mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0));
|
||||
}
|
||||
|
||||
SVGViewBox* SVGViewportElement::GetViewBox() { return &mViewBox; }
|
||||
SVGAnimatedViewBox* SVGViewportElement::GetViewBox() { return &mViewBox; }
|
||||
|
||||
SVGAnimatedPreserveAspectRatio* SVGViewportElement::GetPreserveAspectRatio() {
|
||||
return &mPreserveAspectRatio;
|
||||
|
@ -11,14 +11,14 @@
|
||||
#include "mozilla/dom/FromParser.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "SVGAnimatedEnumeration.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGAnimatedPreserveAspectRatio.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGAnimatedViewBox.h"
|
||||
#include "SVGGraphicsElement.h"
|
||||
#include "SVGImageContext.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "nsISVGPoint.h"
|
||||
#include "SVGPreserveAspectRatio.h"
|
||||
#include "SVGViewBox.h"
|
||||
|
||||
class nsSVGOuterSVGFrame;
|
||||
class nsSVGViewportFrame;
|
||||
@ -126,7 +126,7 @@ class SVGViewportElement : public SVGGraphicsElement {
|
||||
// WebIDL
|
||||
already_AddRefed<SVGAnimatedRect> ViewBox();
|
||||
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
|
||||
virtual SVGViewBox* GetViewBox() override;
|
||||
virtual SVGAnimatedViewBox* GetViewBox() override;
|
||||
|
||||
protected:
|
||||
// implementation helpers:
|
||||
@ -178,11 +178,13 @@ class SVGViewportElement : public SVGGraphicsElement {
|
||||
|
||||
virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
|
||||
|
||||
virtual const SVGViewBox& GetViewBoxInternal() const { return mViewBox; }
|
||||
virtual const SVGAnimatedViewBox& GetViewBoxInternal() const {
|
||||
return mViewBox;
|
||||
}
|
||||
virtual SVGAnimatedTransformList* GetTransformInternal() const {
|
||||
return mTransforms;
|
||||
}
|
||||
SVGViewBox mViewBox;
|
||||
SVGAnimatedViewBox mViewBox;
|
||||
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
||||
|
||||
// The size of the rectangular SVG viewport into which we render. This is
|
||||
|
@ -19,13 +19,13 @@ EXPORTS.mozilla += [
|
||||
|
||||
EXPORTS.mozilla.dom += [
|
||||
'SVGAElement.h',
|
||||
'SVGAnimatedClass.h',
|
||||
'SVGAnimatedRect.h',
|
||||
'SVGAnimateElement.h',
|
||||
'SVGAnimateMotionElement.h',
|
||||
'SVGAnimateTransformElement.h',
|
||||
'SVGAnimationElement.h',
|
||||
'SVGCircleElement.h',
|
||||
'SVGClass.h',
|
||||
'SVGClipPathElement.h',
|
||||
'SVGComponentTransferFunctionElement.h',
|
||||
'SVGDefsElement.h',
|
||||
@ -123,21 +123,28 @@ UNIFIED_SOURCES += [
|
||||
'nsSVGLength2.cpp',
|
||||
'nsSVGNumber2.cpp',
|
||||
'SVGAElement.cpp',
|
||||
'SVGAnimatedBoolean.cpp',
|
||||
'SVGAnimatedClass.cpp',
|
||||
'SVGAnimatedEnumeration.cpp',
|
||||
'SVGAnimatedInteger.cpp',
|
||||
'SVGAnimatedIntegerPair.cpp',
|
||||
'SVGAnimatedLengthList.cpp',
|
||||
'SVGAnimatedNumberList.cpp',
|
||||
'SVGAnimatedNumberPair.cpp',
|
||||
'SVGAnimatedOrient.cpp',
|
||||
'SVGAnimatedPathSegList.cpp',
|
||||
'SVGAnimatedPointList.cpp',
|
||||
'SVGAnimatedPreserveAspectRatio.cpp',
|
||||
'SVGAnimatedRect.cpp',
|
||||
'SVGAnimatedString.cpp',
|
||||
'SVGAnimatedTransformList.cpp',
|
||||
'SVGAnimatedViewBox.cpp',
|
||||
'SVGAnimateElement.cpp',
|
||||
'SVGAnimateMotionElement.cpp',
|
||||
'SVGAnimateTransformElement.cpp',
|
||||
'SVGAnimationElement.cpp',
|
||||
'SVGAttrValueWrapper.cpp',
|
||||
'SVGBoolean.cpp',
|
||||
'SVGCircleElement.cpp',
|
||||
'SVGClass.cpp',
|
||||
'SVGClipPathElement.cpp',
|
||||
'SVGContentUtils.cpp',
|
||||
'SVGDataParser.cpp',
|
||||
@ -147,7 +154,6 @@ UNIFIED_SOURCES += [
|
||||
'SVGElement.cpp',
|
||||
'SVGElementFactory.cpp',
|
||||
'SVGEllipseElement.cpp',
|
||||
'SVGEnum.cpp',
|
||||
'SVGFEBlendElement.cpp',
|
||||
'SVGFEColorMatrixElement.cpp',
|
||||
'SVGFEComponentTransferElement.cpp',
|
||||
@ -178,8 +184,6 @@ UNIFIED_SOURCES += [
|
||||
'SVGGradientElement.cpp',
|
||||
'SVGGraphicsElement.cpp',
|
||||
'SVGImageElement.cpp',
|
||||
'SVGInteger.cpp',
|
||||
'SVGIntegerPair.cpp',
|
||||
'SVGIntegerPairSMILType.cpp',
|
||||
'SVGLength.cpp',
|
||||
'SVGLengthList.cpp',
|
||||
@ -196,9 +200,7 @@ UNIFIED_SOURCES += [
|
||||
'SVGMPathElement.cpp',
|
||||
'SVGNumberList.cpp',
|
||||
'SVGNumberListSMILType.cpp',
|
||||
'SVGNumberPair.cpp',
|
||||
'SVGNumberPairSMILType.cpp',
|
||||
'SVGOrient.cpp',
|
||||
'SVGOrientSMILType.cpp',
|
||||
'SVGPathData.cpp',
|
||||
'SVGPathDataParser.cpp',
|
||||
@ -217,7 +219,6 @@ UNIFIED_SOURCES += [
|
||||
'SVGScriptElement.cpp',
|
||||
'SVGSetElement.cpp',
|
||||
'SVGStopElement.cpp',
|
||||
'SVGString.cpp',
|
||||
'SVGStringList.cpp',
|
||||
'SVGStyleElement.cpp',
|
||||
'SVGSVGElement.cpp',
|
||||
@ -236,7 +237,6 @@ UNIFIED_SOURCES += [
|
||||
'SVGTransformListSMILType.cpp',
|
||||
'SVGTSpanElement.cpp',
|
||||
'SVGUseElement.cpp',
|
||||
'SVGViewBox.cpp',
|
||||
'SVGViewBoxSMILType.cpp',
|
||||
'SVGViewElement.cpp',
|
||||
'SVGViewportElement.cpp',
|
||||
|
@ -428,7 +428,7 @@ gfxMatrix nsSVGClipPathFrame::GetClipPathTransform(nsIFrame* aClippedFrame) {
|
||||
|
||||
gfxMatrix tm = content->PrependLocalTransformsTo(gfxMatrix());
|
||||
|
||||
SVGEnum* clipPathUnits =
|
||||
SVGAnimatedEnumeration* clipPathUnits =
|
||||
&content->mEnumAttributes[SVGClipPathElement::CLIPPATHUNITS];
|
||||
|
||||
uint32_t flags = nsSVGUtils::eBBoxIncludeFillGeometry |
|
||||
|
@ -31,7 +31,7 @@ nsIFrame* NS_NewSVGFilterFrame(nsIPresShell* aPresShell,
|
||||
NS_IMPL_FRAMEARENA_HELPERS(nsSVGFilterFrame)
|
||||
|
||||
uint16_t nsSVGFilterFrame::GetEnumValue(uint32_t aIndex, nsIContent* aDefault) {
|
||||
SVGEnum& thisEnum =
|
||||
SVGAnimatedEnumeration& thisEnum =
|
||||
static_cast<SVGFilterElement*>(GetContent())->mEnumAttributes[aIndex];
|
||||
|
||||
if (thisEnum.IsExplicitlySet()) {
|
||||
|
@ -9,9 +9,9 @@
|
||||
|
||||
#include "gfxMatrix.h"
|
||||
#include "gfxRect.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "SVGAnimatedNumberPair.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
class nsSVGFilterFrame;
|
||||
@ -65,7 +65,7 @@ class SVGFilterElement;
|
||||
* "filter space point" = (20, 20)
|
||||
*/
|
||||
class nsSVGFilterInstance {
|
||||
typedef mozilla::SVGNumberPair SVGNumberPair;
|
||||
typedef mozilla::SVGAnimatedNumberPair SVGAnimatedNumberPair;
|
||||
typedef mozilla::gfx::Point3D Point3D;
|
||||
typedef mozilla::gfx::IntRect IntRect;
|
||||
typedef mozilla::gfx::SourceSurface SourceSurface;
|
||||
@ -114,8 +114,9 @@ class nsSVGFilterInstance {
|
||||
const nsSVGNumber2* aNumber) const {
|
||||
return GetPrimitiveNumber(aCtxType, aNumber->GetAnimValue());
|
||||
}
|
||||
float GetPrimitiveNumber(uint8_t aCtxType, const SVGNumberPair* aNumberPair,
|
||||
SVGNumberPair::PairIndex aIndex) const {
|
||||
float GetPrimitiveNumber(uint8_t aCtxType,
|
||||
const SVGAnimatedNumberPair* aNumberPair,
|
||||
SVGAnimatedNumberPair::PairIndex aIndex) const {
|
||||
return GetPrimitiveNumber(aCtxType, aNumberPair->GetAnimValue(aIndex));
|
||||
}
|
||||
|
||||
|
@ -66,8 +66,9 @@ nsresult nsSVGGradientFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
|
||||
uint16_t nsSVGGradientFrame::GetEnumValue(uint32_t aIndex,
|
||||
nsIContent* aDefault) {
|
||||
const SVGEnum& thisEnum = static_cast<dom::SVGGradientElement*>(GetContent())
|
||||
->mEnumAttributes[aIndex];
|
||||
const SVGAnimatedEnumeration& thisEnum =
|
||||
static_cast<dom::SVGGradientElement*>(GetContent())
|
||||
->mEnumAttributes[aIndex];
|
||||
|
||||
if (thisEnum.IsExplicitlySet()) {
|
||||
return thisEnum.GetAnimValue();
|
||||
|
@ -208,7 +208,7 @@ gfxMatrix nsSVGMaskFrame::GetCanvasTM() { return mMatrixForChildren; }
|
||||
gfxMatrix nsSVGMaskFrame::GetMaskTransform(nsIFrame* aMaskedFrame) {
|
||||
SVGMaskElement* content = static_cast<SVGMaskElement*>(GetContent());
|
||||
|
||||
SVGEnum* maskContentUnits =
|
||||
SVGAnimatedEnumeration* maskContentUnits =
|
||||
&content->mEnumAttributes[SVGMaskElement::MASKCONTENTUNITS];
|
||||
|
||||
uint32_t flags = nsSVGUtils::eBBoxIncludeFillGeometry |
|
||||
|
@ -131,7 +131,7 @@ static float MaxExpansion(const Matrix &aMatrix) {
|
||||
// scale if the viewBox is specified and _patternUnits_ is set to or defaults to
|
||||
// objectBoundingBox though, since in that case the viewBox is relative to the
|
||||
// bbox
|
||||
static bool IncludeBBoxScale(const SVGViewBox &aViewBox,
|
||||
static bool IncludeBBoxScale(const SVGAnimatedViewBox &aViewBox,
|
||||
uint32_t aPatternContentUnits,
|
||||
uint32_t aPatternUnits) {
|
||||
return (!aViewBox.IsExplicitlySet() &&
|
||||
@ -163,7 +163,8 @@ static Matrix GetPatternMatrix(uint16_t aPatternUnits,
|
||||
return patternMatrix;
|
||||
}
|
||||
|
||||
static nsresult GetTargetGeometry(gfxRect *aBBox, const SVGViewBox &aViewBox,
|
||||
static nsresult GetTargetGeometry(gfxRect *aBBox,
|
||||
const SVGAnimatedViewBox &aViewBox,
|
||||
uint16_t aPatternContentUnits,
|
||||
uint16_t aPatternUnits, nsIFrame *aTarget,
|
||||
const Matrix &aContextMatrix,
|
||||
@ -214,7 +215,7 @@ already_AddRefed<SourceSurface> nsSVGPatternFrame::PaintPattern(
|
||||
}
|
||||
nsIFrame *firstKid = patternWithChildren->mFrames.FirstChild();
|
||||
|
||||
const SVGViewBox &viewBox = GetViewBox();
|
||||
const SVGAnimatedViewBox &viewBox = GetViewBox();
|
||||
|
||||
uint16_t patternContentUnits =
|
||||
GetEnumValue(SVGPatternElement::PATTERNCONTENTUNITS);
|
||||
@ -411,7 +412,7 @@ nsSVGPatternFrame *nsSVGPatternFrame::GetPatternWithChildren() {
|
||||
|
||||
uint16_t nsSVGPatternFrame::GetEnumValue(uint32_t aIndex,
|
||||
nsIContent *aDefault) {
|
||||
SVGEnum &thisEnum =
|
||||
SVGAnimatedEnumeration &thisEnum =
|
||||
static_cast<SVGPatternElement *>(GetContent())->mEnumAttributes[aIndex];
|
||||
|
||||
if (thisEnum.IsExplicitlySet()) {
|
||||
@ -472,8 +473,8 @@ gfxMatrix nsSVGPatternFrame::GetPatternTransform() {
|
||||
return animTransformList->GetAnimValue().GetConsolidationMatrix();
|
||||
}
|
||||
|
||||
const SVGViewBox &nsSVGPatternFrame::GetViewBox(nsIContent *aDefault) {
|
||||
const SVGViewBox &thisViewBox =
|
||||
const SVGAnimatedViewBox &nsSVGPatternFrame::GetViewBox(nsIContent *aDefault) {
|
||||
const SVGAnimatedViewBox &thisViewBox =
|
||||
static_cast<SVGPatternElement *>(GetContent())->mViewBox;
|
||||
|
||||
if (thisViewBox.IsExplicitlySet()) {
|
||||
@ -611,7 +612,7 @@ gfxRect nsSVGPatternFrame::GetPatternRect(uint16_t aPatternUnits,
|
||||
return gfxRect(x, y, width, height);
|
||||
}
|
||||
|
||||
gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGViewBox &aViewBox,
|
||||
gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGAnimatedViewBox &aViewBox,
|
||||
uint16_t aPatternContentUnits,
|
||||
uint16_t aPatternUnits,
|
||||
const gfxRect &callerBBox,
|
||||
|
@ -20,8 +20,8 @@ class nsSVGLength2;
|
||||
namespace mozilla {
|
||||
class SVGAnimatedPreserveAspectRatio;
|
||||
class SVGAnimatedTransformList;
|
||||
class SVGAnimatedViewBox;
|
||||
class SVGGeometryFrame;
|
||||
class SVGViewBox;
|
||||
} // namespace mozilla
|
||||
|
||||
class nsSVGPatternFrame final : public nsSVGPaintServerFrame {
|
||||
@ -80,8 +80,8 @@ class nsSVGPatternFrame final : public nsSVGPaintServerFrame {
|
||||
mozilla::SVGAnimatedTransformList* GetPatternTransformList(
|
||||
nsIContent* aDefault);
|
||||
gfxMatrix GetPatternTransform();
|
||||
const SVGViewBox& GetViewBox(nsIContent* aDefault);
|
||||
const SVGViewBox& GetViewBox() { return GetViewBox(mContent); }
|
||||
const SVGAnimatedViewBox& GetViewBox(nsIContent* aDefault);
|
||||
const SVGAnimatedViewBox& GetViewBox() { return GetViewBox(mContent); }
|
||||
const SVGAnimatedPreserveAspectRatio& GetPreserveAspectRatio(
|
||||
nsIContent* aDefault);
|
||||
const SVGAnimatedPreserveAspectRatio& GetPreserveAspectRatio() {
|
||||
@ -110,7 +110,7 @@ class nsSVGPatternFrame final : public nsSVGPaintServerFrame {
|
||||
|
||||
gfxRect GetPatternRect(uint16_t aPatternUnits, const gfxRect& bbox,
|
||||
const Matrix& callerCTM, nsIFrame* aTarget);
|
||||
gfxMatrix ConstructCTM(const SVGViewBox& aViewBox,
|
||||
gfxMatrix ConstructCTM(const SVGAnimatedViewBox& aViewBox,
|
||||
uint16_t aPatternContentUnits, uint16_t aPatternUnits,
|
||||
const gfxRect& callerBBox, const Matrix& callerCTM,
|
||||
nsIFrame* aTarget);
|
||||
|
@ -1206,8 +1206,8 @@ bool nsSVGUtils::CanOptimizeOpacity(nsIFrame* aFrame) {
|
||||
}
|
||||
|
||||
gfxMatrix nsSVGUtils::AdjustMatrixForUnits(const gfxMatrix& aMatrix,
|
||||
SVGEnum* aUnits, nsIFrame* aFrame,
|
||||
uint32_t aFlags) {
|
||||
SVGAnimatedEnumeration* aUnits,
|
||||
nsIFrame* aFrame, uint32_t aFlags) {
|
||||
if (aFrame && aUnits->GetAnimValue() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
|
||||
gfxRect bbox = GetBBox(aFrame, aFlags);
|
||||
gfxMatrix tm = aMatrix;
|
||||
|
@ -44,9 +44,9 @@ struct nsStyleSVG;
|
||||
struct nsRect;
|
||||
|
||||
namespace mozilla {
|
||||
class SVGAnimatedEnumeration;
|
||||
class SVGContextPaint;
|
||||
struct SVGContextPaintImpl;
|
||||
class SVGEnum;
|
||||
class SVGGeometryFrame;
|
||||
namespace dom {
|
||||
class Element;
|
||||
@ -344,7 +344,7 @@ class nsSVGUtils {
|
||||
* @param aFlags One or more of the BBoxFlags values defined below.
|
||||
*/
|
||||
static gfxMatrix AdjustMatrixForUnits(const gfxMatrix& aMatrix,
|
||||
mozilla::SVGEnum* aUnits,
|
||||
mozilla::SVGAnimatedEnumeration* aUnits,
|
||||
nsIFrame* aFrame, uint32_t aFlags);
|
||||
|
||||
enum BBoxFlags {
|
||||
|
Loading…
x
Reference in New Issue
Block a user