Enable animVal support for SVGTransformList
authorzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Mar 2012 13:09:28 +0000 (13:09 +0000)
committerzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Mar 2012 13:09:28 +0000 (13:09 +0000)
commit9a0e262dca7d70bc8b64a6bd0f317ed567f36bfb
tree8e6e7e52f21dec12735dd8101502e61133d514e7
parenta9d8c366355690d3296e277e5bb6d0b559e6540e
Enable animVal support for SVGTransformList
https://bugs.webkit.org/show_bug.cgi?id=80758

Reviewed by Antti Koivisto.

Source/WebCore:

Enable animVal support for SVGTransformList. SVGTransformLists are only animatable
via <animateTransform>, not via <animate> directly. Still we can handle it in the
same framework as all other types used for <animate>, as we also need proper animVal
support for <animateTransform>.

This patch removes the special <animateTransform> implementation, and lets
SVGAnimateTransformElement inherit from SVGAnimateElement, just like its done
for SVGAnimateColorElement & SVGSetElement.

All existing code (calculateFromAndToValues/FromAndByValues/etc..) are moved from
SVGAnimateTransform right into the SVGAnimatedTransformListAnimator.

This doesn't change <animateTransform> behavior, it just simplies the code
and enables animVal support for SVGTransformLists - all covered by existing tests.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAllInOne.cpp:
* svg/SVGAnimateElement.cpp:
(WebCore::SVGAnimateElement::SVGAnimateElement):
(WebCore::SVGAnimateElement::determineAnimatedPropertyType):
(WebCore::SVGAnimateElement::calculateAnimatedValue):
(WebCore::SVGAnimateElement::applyResultsToTarget):
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement):
(WebCore::SVGAnimateTransformElement::hasValidAttributeType):
(WebCore::SVGAnimateTransformElement::parseAttribute):
* svg/SVGAnimateTransformElement.h:
(WebCore::SVGAnimateTransformElement::transformType):
(SVGAnimateTransformElement):
* svg/SVGAnimatedTransformList.cpp: Added.
(WebCore):
(WebCore::SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator):
(WebCore::SVGAnimatedTransformListAnimator::constructFromString):
(WebCore::SVGAnimatedTransformListAnimator::constructFromCopy):
(WebCore::SVGAnimatedTransformListAnimator::calculateFromAndToValues):
(WebCore::SVGAnimatedTransformListAnimator::calculateFromAndByValues):
(WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
* svg/SVGAnimatedTransformList.h:
(WebCore):
(SVGAnimatedTransformListAnimator):
(WebCore::SVGAnimatedTransformListAnimator::~SVGAnimatedTransformListAnimator):
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::~SVGAnimatedType):
(WebCore::SVGAnimatedType::createTransformList):
(WebCore):
(WebCore::SVGAnimatedType::transformList):
(WebCore::SVGAnimatedType::valueAsString):
(WebCore::SVGAnimatedType::setValueAsString):
(WebCore::SVGAnimatedType::supportsAnimVal):
(WebCore::SVGAnimatedType::setVariantValue):
* svg/SVGAnimatedType.h:
(WebCore):
(SVGAnimatedType):
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::parseAttribute):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::parseAttribute):
* svg/SVGStyledTransformableElement.cpp:
(WebCore::SVGStyledTransformableElement::parseAttribute):
* svg/SVGTextElement.cpp:
(WebCore::SVGTextElement::parseAttribute):
* svg/SVGTransform.cpp:
(WebCore::SVGTransform::transformTypePrefixForParsing):
(WebCore):
(WebCore::SVGTransform::valueAsString):
* svg/SVGTransform.h:
(SVGTransform):
* svg/SVGTransformList.cpp:
(WebCore::SVGTransformList::parse):
(WebCore):
* svg/SVGTransformList.h:
(SVGTransformList):
* svg/SVGTransformable.cpp:
(WebCore::SVGTransformable::parseTransformType):
* svg/SVGTransformable.h:
(WebCore):
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::setTransform):

LayoutTests:

Rebaseline tests after enabling animVal support SVGAnimateTransformElement/SVGTransformList.

* svg/animations/animate-gradient-transform-expected.txt:
* svg/animations/animateTransform-pattern-transform-expected.txt:
* svg/animations/script-tests/animate-gradient-transform.js:
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/animateTransform-pattern-transform.js:
(sample1):
(sample2):
(sample3):
(sample4):
(executeTest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
31 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/animations/animate-gradient-transform-expected.txt
LayoutTests/svg/animations/animateTransform-pattern-transform-expected.txt
LayoutTests/svg/animations/script-tests/animate-gradient-transform.js
LayoutTests/svg/animations/script-tests/animateTransform-pattern-transform.js
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/svg/SVGAllInOne.cpp
Source/WebCore/svg/SVGAnimateElement.cpp
Source/WebCore/svg/SVGAnimateTransformElement.cpp
Source/WebCore/svg/SVGAnimateTransformElement.h
Source/WebCore/svg/SVGAnimatedTransformList.cpp [new file with mode: 0644]
Source/WebCore/svg/SVGAnimatedTransformList.h
Source/WebCore/svg/SVGAnimatedType.cpp
Source/WebCore/svg/SVGAnimatedType.h
Source/WebCore/svg/SVGAnimatorFactory.h
Source/WebCore/svg/SVGGradientElement.cpp
Source/WebCore/svg/SVGPatternElement.cpp
Source/WebCore/svg/SVGStyledTransformableElement.cpp
Source/WebCore/svg/SVGTextElement.cpp
Source/WebCore/svg/SVGTransform.cpp
Source/WebCore/svg/SVGTransform.h
Source/WebCore/svg/SVGTransformList.cpp
Source/WebCore/svg/SVGTransformList.h
Source/WebCore/svg/SVGTransformable.cpp
Source/WebCore/svg/SVGTransformable.h
Source/WebCore/svg/SVGViewSpec.cpp