| Index: Source/core/svg/SVGAnimatedTypeAnimator.h
|
| diff --git a/Source/core/svg/SVGAnimatedTypeAnimator.h b/Source/core/svg/SVGAnimatedTypeAnimator.h
|
| index b690fdd9d91bc49ba0046447240d55662e024f37..e2b0d3c87a674efa12eb0a35c1540ffd9af6f214 100644
|
| --- a/Source/core/svg/SVGAnimatedTypeAnimator.h
|
| +++ b/Source/core/svg/SVGAnimatedTypeAnimator.h
|
| @@ -23,20 +23,14 @@
|
| #include "core/svg/SVGAnimatedType.h"
|
| #include "core/svg/SVGElementInstance.h"
|
| #include "core/svg/properties/SVGAnimatedProperty.h"
|
| -#include "core/svg/properties/SVGAttributeToPropertyMap.h"
|
| #include <wtf/PassOwnPtr.h>
|
|
|
| namespace WebCore {
|
|
|
| struct SVGElementAnimatedProperties {
|
| - SVGElementAnimatedProperties()
|
| - : element(0)
|
| - { }
|
| + SVGElementAnimatedProperties();
|
|
|
| - SVGElementAnimatedProperties(SVGElement* element, Vector<RefPtr<SVGAnimatedProperty> >& properties)
|
| - : element(element)
|
| - , properties(properties)
|
| - { }
|
| + SVGElementAnimatedProperties(SVGElement*, Vector<RefPtr<SVGAnimatedProperty> >&);
|
|
|
| SVGElement* element;
|
| Vector<RefPtr<SVGAnimatedProperty> > properties;
|
| @@ -48,7 +42,7 @@ class SVGAnimationElement;
|
| class SVGAnimatedTypeAnimator {
|
| WTF_MAKE_FAST_ALLOCATED;
|
| public:
|
| - virtual ~SVGAnimatedTypeAnimator() { }
|
| + virtual ~SVGAnimatedTypeAnimator();
|
| virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&) = 0;
|
|
|
| virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) = 0;
|
| @@ -61,75 +55,16 @@ public:
|
| virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) = 0;
|
| virtual float calculateDistance(const String& fromString, const String& toString) = 0;
|
|
|
| - void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& toString)
|
| - {
|
| - from = constructFromString(fromString);
|
| - to = constructFromString(toString);
|
| - }
|
| -
|
| - void calculateFromAndByValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& byString)
|
| - {
|
| - from = constructFromString(fromString);
|
| - to = constructFromString(byString);
|
| - addAnimatedTypes(from.get(), to.get());
|
| - }
|
| + void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& toString);
|
| + void calculateFromAndByValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& byString);
|
|
|
| void setContextElement(SVGElement* contextElement) { m_contextElement = contextElement; }
|
| AnimatedPropertyType type() const { return m_type; }
|
|
|
| - SVGElementAnimatedPropertyList findAnimatedPropertiesForAttributeName(SVGElement* targetElement, const QualifiedName& attributeName)
|
| - {
|
| - ASSERT(targetElement);
|
| -
|
| - SVGElementAnimatedPropertyList propertiesByInstance;
|
| -
|
| - Vector<RefPtr<SVGAnimatedProperty> > targetProperties;
|
| - targetElement->localAttributeToPropertyMap().animatedPropertiesForAttribute(targetElement, attributeName, targetProperties);
|
| -
|
| - if (!SVGAnimatedType::supportsAnimVal(m_type))
|
| - return SVGElementAnimatedPropertyList();
|
| -
|
| - SVGElementAnimatedProperties propertiesPair(targetElement, targetProperties);
|
| - propertiesByInstance.append(propertiesPair);
|
| -
|
| - const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
|
| - const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
|
| - for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
|
| - SVGElement* shadowTreeElement = (*it)->shadowTreeElement();
|
| - if (!shadowTreeElement)
|
| - continue;
|
| -
|
| - Vector<RefPtr<SVGAnimatedProperty> > instanceProperties;
|
| - targetElement->localAttributeToPropertyMap().animatedPropertiesForAttribute(shadowTreeElement, attributeName, instanceProperties);
|
| -
|
| - SVGElementAnimatedProperties instancePropertiesPair(shadowTreeElement, instanceProperties);
|
| - propertiesByInstance.append(instancePropertiesPair);
|
| - }
|
| -
|
| -#if !ASSERT_DISABLED
|
| - SVGElementAnimatedPropertyList::const_iterator propertiesEnd = propertiesByInstance.end();
|
| - for (SVGElementAnimatedPropertyList::const_iterator it = propertiesByInstance.begin(); it != propertiesEnd; ++it) {
|
| - size_t propertiesSize = it->properties.size();
|
| - for (size_t i = 0; i < propertiesSize; ++i) {
|
| - RefPtr<SVGAnimatedProperty> property = it->properties[i];
|
| - if (property->animatedPropertyType() != m_type) {
|
| - ASSERT(m_type == AnimatedAngle);
|
| - ASSERT(property->animatedPropertyType() == AnimatedEnumeration);
|
| - }
|
| - }
|
| - }
|
| -#endif
|
| -
|
| - return propertiesByInstance;
|
| - }
|
| + SVGElementAnimatedPropertyList findAnimatedPropertiesForAttributeName(SVGElement*, const QualifiedName&);
|
|
|
| protected:
|
| - SVGAnimatedTypeAnimator(AnimatedPropertyType type, SVGAnimationElement* animationElement, SVGElement* contextElement)
|
| - : m_type(type)
|
| - , m_animationElement(animationElement)
|
| - , m_contextElement(contextElement)
|
| - {
|
| - }
|
| + SVGAnimatedTypeAnimator(AnimatedPropertyType, SVGAnimationElement*, SVGElement*);
|
|
|
| // Helpers for animators that operate on single types, eg. just one SVGAnimatedInteger.
|
| template<typename AnimValType>
|
|
|