2011-02-20 Dirk Schulze <krit@webkit.org>
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Feb 2011 22:27:58 +0000 (22:27 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Feb 2011 22:27:58 +0000 (22:27 +0000)
commit1ab3edb642b7a76b9bd6f1c4c5281e3a9f7becc5
tree20343186d605979dd67f236ace99612c1059e3e0
parent0e2985760ba5289869574100824c537856d59d5c
2011-02-20  Dirk Schulze  <krit@webkit.org>

        Reviewed by Nikolas Zimmermann.

        SVG animation - analyze attribute type for animation
        https://bugs.webkit.org/show_bug.cgi?id=54542

        Check dynamic update of attributeName. The test fails at the moment, because of some wrong
        internal mapping. Tested update manually with gdb. Working on a fix to get this test pass
        as well.

        * svg/animations/animate-dynamic-update-attributeName-expected.txt: Added.
        * svg/animations/animate-dynamic-update-attributeName.html: Added.
        * svg/animations/script-tests/animate-dynamic-update-attributeName.js: Added.
        (sample1):
        (sample2):
        (sample3):
        (executeTest):
2011-02-20  Dirk Schulze  <krit@webkit.org>

        Reviewed by Nikolas Zimmermann.

        SVG animation - analyze attribute type for animation
        https://bugs.webkit.org/show_bug.cgi?id=54542

        Analyze animated attribute type to determine the kind of animation. Removed enum PropertyType and replace it
        with AnimatedAttributeType instead. More cleanup of the animation code.
        Added missing fillAttributeToPropertyTypeMap() for SVGGElement.

        Use QualifiedName instead of AtomicStrings for attribute names. This makes it easier to handle animated attributes
        from a different namespace like xlink:href. The rest of the SVG code is using QualifiedNames as well.

        No change of functionality on the animation code. The changes for the <g>-element affect animateTransform. Sadly
        animateTransform is not supported by our SVG animation test script at the moment. Can still be tested manually
        with the W3C test suite in trunk.

        The change on SVGUseElement gets covered by animate-elem-39-t.svg

        Test: svg/animations/animate-dynamic-update-attributeName.html

        * svg/SVGAnimateElement.cpp:
        (WebCore::SVGAnimateElement::SVGAnimateElement):
        (WebCore::SVGAnimateElement::hasValidAttributeType):
        (WebCore::SVGAnimateElement::determineAnimatedAttributeType):
        (WebCore::SVGAnimateElement::calculateAnimatedValue):
        (WebCore::inheritsFromProperty):
        (WebCore::SVGAnimateElement::calculateFromAndToValues):
        (WebCore::SVGAnimateElement::calculateFromAndByValues):
        (WebCore::SVGAnimateElement::resetToBaseValue):
        (WebCore::SVGAnimateElement::applyResultsToTarget):
        (WebCore::SVGAnimateElement::calculateDistance):
        * svg/SVGAnimateElement.h:
        * svg/SVGAnimateMotionElement.cpp:
        (WebCore::SVGAnimateMotionElement::hasValidAttributeType):
        (WebCore::parsePoint):
        (WebCore::SVGAnimateMotionElement::resetToBaseValue):
        (WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
        (WebCore::SVGAnimateMotionElement::calculateDistance):
        * svg/SVGAnimateMotionElement.h:
        * svg/SVGAnimateTransformElement.cpp:
        (WebCore::SVGAnimateTransformElement::hasValidAttributeType):
        (WebCore::SVGAnimateTransformElement::determineAnimatedAttributeType):
        (WebCore::SVGAnimateTransformElement::resetToBaseValue):
        (WebCore::SVGAnimateTransformElement::calculateAnimatedValue):
        (WebCore::SVGAnimateTransformElement::calculateFromAndByValues):
        (WebCore::SVGAnimateTransformElement::applyResultsToTarget):
        (WebCore::SVGAnimateTransformElement::calculateDistance):
        * svg/SVGAnimateTransformElement.h:
        * svg/SVGAnimationElement.cpp:
        (WebCore::parseKeyTimes):
        (WebCore::parseKeySplines):
        (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty):
        (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue):
        (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
        (WebCore::solveEpsilon):
        (WebCore::SVGAnimationElement::calculatePercentFromKeyPoints):
        (WebCore::SVGAnimationElement::currentValuesFromKeyPoints):
        (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
        (WebCore::SVGAnimationElement::startedActiveInterval):
        * svg/SVGAnimationElement.h:
        * svg/SVGFilterElement.cpp:
        (WebCore::SVGFilterElement::fillAttributeToPropertyTypeMap):
        * svg/SVGGElement.cpp:
        (WebCore::SVGGElement::attributeToPropertyTypeMap):
        (WebCore::SVGGElement::fillAttributeToPropertyTypeMap): Added to fill the animated attribute map for this element.
        * svg/SVGGElement.h:
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::fillAttributeToPropertyTypeMap): Changed attribute type to AnimatedString for xlink:href.
        * svg/animation/SMILTimeContainer.cpp:
        (WebCore::SMILTimeContainer::baseValueFor):
        (WebCore::SMILTimeContainer::updateAnimations):
        * svg/animation/SMILTimeContainer.h:
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::SVGSMILElement):
        (WebCore::constructQualifiedName): Create a QualifiedName from a attribute name.
        (WebCore::SVGSMILElement::insertedIntoDocument): Update local varaible of attribute name.
        (WebCore::SVGSMILElement::removedFromDocument): Ditto.
        (WebCore::SVGSMILElement::attributeChanged): Ditto.
        * svg/animation/SVGSMILElement.h:
        (WebCore::SVGSMILElement::attributeName):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/animations/animate-dynamic-update-attributeName-expected.txt [new file with mode: 0644]
LayoutTests/svg/animations/animate-dynamic-update-attributeName.html [new file with mode: 0644]
LayoutTests/svg/animations/script-tests/animate-dynamic-update-attributeName.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGAnimateElement.cpp
Source/WebCore/svg/SVGAnimateElement.h
Source/WebCore/svg/SVGAnimateMotionElement.cpp
Source/WebCore/svg/SVGAnimateMotionElement.h
Source/WebCore/svg/SVGAnimateTransformElement.cpp
Source/WebCore/svg/SVGAnimateTransformElement.h
Source/WebCore/svg/SVGAnimationElement.cpp
Source/WebCore/svg/SVGAnimationElement.h
Source/WebCore/svg/SVGFilterElement.cpp
Source/WebCore/svg/SVGGElement.cpp
Source/WebCore/svg/SVGGElement.h
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/animation/SMILTimeContainer.cpp
Source/WebCore/svg/animation/SMILTimeContainer.h
Source/WebCore/svg/animation/SVGSMILElement.cpp
Source/WebCore/svg/animation/SVGSMILElement.h