Changeset 76589 in webkit


Ignore:
Timestamp:
Jan 25, 2011 5:46:18 AM (13 years ago)
Author:
krit@webkit.org
Message:

2011-01-25 Dirk Schulze <krit@webkit.org>

Reviewed by Nikolas Zimmermann.

SVG is missing to-animation support for Path
https://bugs.webkit.org/show_bug.cgi?id=52982

Added an animation test to check 'to' animations in combination with SVG paths.

  • svg/animations/animate-path-to-animation-expected.txt: Added.
  • svg/animations/animate-path-to-animation.html: Added.
  • svg/animations/script-tests/animate-path-to-animation.js: Added. (sample1): (sample2): (sample3): (executeTest):

2011-01-25 Dirk Schulze <krit@webkit.org>

Reviewed by Nikolas Zimmermann.

SVG is missing to-animation support for Path
https://bugs.webkit.org/show_bug.cgi?id=52982

SVG was missing 'to' animation support for SVG paths. Even the fallback to discrete
animation did not work and an assert was thrown, because of the missing m_fromPath.
This also influences a test of the W3C test suite. Subtest 2 of animate-elem-83-t.svg passes now.

Test: svg/animations/animate-path-to-animation.html

  • svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::calculateAnimatedValue): Take the value of the last SVGAnimateElement for m_fromPath, since 'to' animations are accumulative. (WebCore::SVGAnimateElement::calculateFromAndToValues): Added support for 'to' animations. (WebCore::SVGAnimateElement::resetToBaseValue): Set m_animatedPath on the first animation element to baseVal.
  • svg/SVGPathByteStream.h: (WebCore::SVGPathByteStream::copySVGPathByteStream): Return copy of current byte stream.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r76588 r76589  
     12011-01-25  Dirk Schulze  <krit@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        SVG is missing to-animation support for Path
     6        https://bugs.webkit.org/show_bug.cgi?id=52982
     7
     8        Added an animation test to check 'to' animations in combination with SVG paths.
     9
     10        * svg/animations/animate-path-to-animation-expected.txt: Added.
     11        * svg/animations/animate-path-to-animation.html: Added.
     12        * svg/animations/script-tests/animate-path-to-animation.js: Added.
     13        (sample1):
     14        (sample2):
     15        (sample3):
     16        (executeTest):
     17
    1182011-01-25  Nikolas Zimmermann  <nzimmermann@rim.com>
    219
  • trunk/Source/WebCore/ChangeLog

    r76587 r76589  
     12011-01-25  Dirk Schulze  <krit@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        SVG is missing to-animation support for Path
     6        https://bugs.webkit.org/show_bug.cgi?id=52982
     7
     8        SVG was missing 'to' animation support for SVG paths. Even the fallback to discrete
     9        animation did not work and an assert was thrown, because of the missing m_fromPath.
     10        This also influences a test of the W3C test suite. Subtest 2 of animate-elem-83-t.svg passes now.
     11
     12        Test: svg/animations/animate-path-to-animation.html
     13
     14        * svg/SVGAnimateElement.cpp:
     15        (WebCore::SVGAnimateElement::calculateAnimatedValue): Take the value of the last SVGAnimateElement for
     16        m_fromPath, since 'to' animations are accumulative.
     17        (WebCore::SVGAnimateElement::calculateFromAndToValues): Added support for 'to' animations.
     18        (WebCore::SVGAnimateElement::resetToBaseValue): Set m_animatedPath on the first animation element to baseVal.
     19        * svg/SVGPathByteStream.h:
     20        (WebCore::SVGPathByteStream::copySVGPathByteStream): Return copy of current byte stream.
     21
    1222011-01-25  Pavel Feldman  <pfeldman@chromium.org>
    223
  • trunk/Source/WebCore/svg/SVGAnimateElement.cpp

    r74472 r76589  
    139139    AnimationMode animationMode = this->animationMode();
    140140    if (m_propertyType == PathProperty) {
     141        if (animationMode == ToAnimation) {
     142            ASSERT(results->m_animatedPathPointer);
     143            m_fromPath = results->m_animatedPathPointer->copy();
     144        }
    141145        if (!percentage) {
    142146            ASSERT(m_fromPath);
     
    211215    } else if (m_propertyType == PathProperty) {
    212216        SVGPathParserFactory* factory = SVGPathParserFactory::self();
    213         if (factory->buildSVGPathByteStreamFromString(fromString, m_fromPath, UnalteredParsing)) {
    214             if (factory->buildSVGPathByteStreamFromString(toString, m_toPath, UnalteredParsing))
     217        if (factory->buildSVGPathByteStreamFromString(toString, m_toPath, UnalteredParsing)) {
     218            // For to-animations the from number is calculated later
     219            if (animationMode() == ToAnimation || factory->buildSVGPathByteStreamFromString(fromString, m_fromPath, UnalteredParsing))
    215220                return true;
    216221        }
     
    273278    } else if (m_propertyType == PathProperty) {
    274279        m_animatedPath.clear();
    275         m_animatedPathPointer = 0;
     280        SVGPathParserFactory* factory = SVGPathParserFactory::self();
     281        factory->buildSVGPathByteStreamFromString(baseString, m_animatedPath, UnalteredParsing);
     282        m_animatedPathPointer = m_animatedPath.get();
    276283        return;
    277284    } else if (m_propertyType == PointsProperty) {
  • trunk/Source/WebCore/svg/SVGPathByteStream.h

    r76248 r76589  
    5252    }
    5353
     54    PassOwnPtr<SVGPathByteStream> copy()
     55    {
     56        return adoptPtr(new SVGPathByteStream(m_data));
     57    }
     58
    5459    typedef Vector<unsigned char> Data;
    5560    typedef Data::const_iterator DataIterator;
     
    6368private:
    6469    SVGPathByteStream() { }
     70    SVGPathByteStream(Data& data)
     71        : m_data(data)
     72    {
     73    }
     74
    6575    Data m_data;
    6676};
Note: See TracChangeset for help on using the changeset viewer.