2011-02-15 Dirk Schulze <krit@webkit.org>
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Feb 2011 11:16:12 +0000 (11:16 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Feb 2011 11:16:12 +0000 (11:16 +0000)
commit4b877df76434fd0f754a07929678d4494d1db485
tree02f8e34c489d6580521e29dd3648e1c69c3daae3
parent9710cb24403b696a74efe51e6bf2c018aaccea64
2011-02-15  Dirk Schulze  <krit@webkit.org>

        Reviewed by Nikolas Zimmermann.

        SVG animation doesn't support attribute value 'inherit'
        https://bugs.webkit.org/show_bug.cgi?id=54410

        Check support for 'inherit' and 'currentColor' on SVG animations.

        * svg/animations/animate-currentColor-expected.txt: Added.
        * svg/animations/animate-currentColor.html: Added.
        * svg/animations/animate-inherit-css-property-expected.txt: Added.
        * svg/animations/animate-inherit-css-property.html: Added.
        * svg/animations/script-tests/animate-currentColor.js: Added.
        (sample1):
        (sample2):
        (sample3):
        (executeTest):
        * svg/animations/script-tests/animate-inherit-css-property.js: Added.
        (sample1):
        (sample2):
        (sample3):
        (executeTest):
2011-02-15  Dirk Schulze  <krit@webkit.org>

        Reviewed by Nikolas Zimmermann.

        SVG animation doesn't support attribute value 'inherit'
        https://bugs.webkit.org/show_bug.cgi?id=54410

        SVG animation does not support 'inherit' as value for CSS property animations. With the patch, SVG determines
        if the attribute of the target element is an animatable CSS Property and computes the style during the
        animation.

        This fixes the following tests on the W3C test suite:
        * animate-elem-84-t.svg
        * animate-elem-85-t.svg

        Tests: svg/animations/animate-currentColor.html
               svg/animations/animate-inherit-css-property.html

        * svg/SVGAnimateElement.cpp:
        (WebCore::adjustForCurrentColor):
        (WebCore::adjustForInheritance):
        (WebCore::SVGAnimateElement::calculateAnimatedValue): When a property value is 'inherit' or 'currentColor'
        during the animation, get the computed style of the property since the values could be animated themselves.
        (WebCore::inheritsFromProperty):
        (WebCore::attributeValueIsCurrentColor):
        (WebCore::SVGAnimateElement::calculateFromAndToValues): Check if 'from', 'by' or 'to' value has the
        string 'inherit' or 'currentColor' and if the attribute supports one of these values.
        (WebCore::SVGAnimateElement::calculateFromAndByValues): Ditto.
        * svg/SVGAnimateElement.h:
        * svg/SVGAnimationElement.cpp:
        (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty): Check if target element is stylable and
        the attribute is an animatable CSS property by using the CSS property map in SVGStyledElement.
        (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue): s/target/targetElement/ for consistency.
        * svg/SVGAnimationElement.h:
        * svg/SVGStyledElement.cpp:
        (WebCore::SVGStyledElement::isAnimatableCSSProperty): Checks if the CSS property is animatable.
        * svg/SVGStyledElement.h:
        * svg/animation/SMILTimeContainer.cpp: Use the new function isTargetAttributeCSSProperty to determine
        if the target element is stylable and the attribute is an animatable CSS property.
        (WebCore::SMILTimeContainer::baseValueFor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/animations/animate-currentColor-expected.txt [new file with mode: 0644]
LayoutTests/svg/animations/animate-currentColor.html [new file with mode: 0644]
LayoutTests/svg/animations/animate-inherit-css-property-expected.txt [new file with mode: 0644]
LayoutTests/svg/animations/animate-inherit-css-property.html [new file with mode: 0644]
LayoutTests/svg/animations/script-tests/animate-currentColor.js [new file with mode: 0644]
LayoutTests/svg/animations/script-tests/animate-inherit-css-property.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGAnimateElement.cpp
Source/WebCore/svg/SVGAnimateElement.h
Source/WebCore/svg/SVGAnimationElement.cpp
Source/WebCore/svg/SVGAnimationElement.h
Source/WebCore/svg/SVGStyledElement.cpp
Source/WebCore/svg/SVGStyledElement.h
Source/WebCore/svg/animation/SMILTimeContainer.cpp