haikuwebkit/LayoutTests/svg/animations/animate-path-to-animation-e...

124 lines
5.9 KiB
Plaintext
Raw Permalink Normal View History

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. Canonical link: https://commits.webkit.org/66819@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-25 13:46:18 +00:00
SVG 1.1 dynamic animation tests
Test calcMode spline with to animation. You should see a green 100x100 path and only PASS messages
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Implement animatedPathSegList support for SVGPathElement https://bugs.webkit.org/show_bug.cgi?id=83140 Reviewed by Zoltan Herczeg. Source/WebCore: Add the last missing piece of animVal support: animations of the SVGPathElement's 'd' attribute should be reflected in the 'animatedPathSegList' not the 'pathSegList'. The SVGAnimatedPathAnimator is special as it doesn't operate on the SVGPathSegList types directly, but on the SVGPathByteStreams for performance reasons. The SVGPathSegLists are refcounted and exposed to JS, thus require lots of memory, compared to a simple byte stream, which SVGPathByteStream is. Only build an 'animatedPathSegList' while animating if its actually observed by the bindings, as this operation is heavy. This marks the finish of the animVal patch series: no more string round trips during animation. Previously paths were animated as byte streams, then converted to a String passed to pathElement->setAttribute("d", "newString"), parsed again to a byte stream, etc. A follow-up patch will remove the last crufts of direct setAttribute() animation. Extend all existing animated SVGPathElement tests to cover animatedPathSegList. * svg/SVGAnimatedColor.h: (WebCore::SVGAnimatedColorAnimator::startAnimValAnimation): (WebCore::SVGAnimatedColorAnimator::stopAnimValAnimation): (WebCore::SVGAnimatedColorAnimator::resetAnimValToBaseVal): (WebCore::SVGAnimatedColorAnimator::animValWillChange): (WebCore::SVGAnimatedColorAnimator::animValDidChange): (SVGAnimatedColorAnimator): * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::constructFromString): (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): (WebCore): (WebCore::SVGAnimatedPathAnimator::stopAnimValAnimation): (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal): (WebCore::SVGAnimatedPathAnimator::animValWillChange): (WebCore::SVGAnimatedPathAnimator::animValDidChange): (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): * svg/SVGAnimatedPath.h: (SVGAnimatedPathAnimator): * svg/SVGAnimatedType.cpp: (WebCore::SVGAnimatedType::valueAsString): (WebCore::SVGAnimatedType::setValueAsString): (WebCore::SVGAnimatedType::supportsAnimVal): * svg/SVGAnimatedTypeAnimator.h: (SVGAnimatedTypeAnimator): (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName): * svg/SVGPathElement.cpp: (WebCore::SVGPathElement::SVGPathElement): (WebCore::SVGPathElement::getTotalLength): (WebCore::SVGPathElement::getPointAtLength): (WebCore::SVGPathElement::getPathSegAtLength): (WebCore::SVGPathElement::parseAttribute): (WebCore::SVGPathElement::svgAttributeChanged): (WebCore::SVGPathElement::pathByteStream): (WebCore): (WebCore::SVGPathElement::lookupOrCreateDWrapper): (WebCore::SVGPathElement::pathSegList): (WebCore::SVGPathElement::animatedPathSegList): (WebCore::SVGPathElement::pathSegListChanged): * svg/SVGPathElement.h: (WebCore): (SVGPathElement): (WebCore::SVGPathElement::isAnimValObserved): * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromSVGPathSegList): (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromString): (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): * svg/SVGPathParserFactory.h: (SVGPathParserFactory): * svg/SVGPathSegWithContext.h: * svg/properties/SVGAnimatedListPropertyTearOff.h: (SVGAnimatedListPropertyTearOff): (WebCore::SVGAnimatedListPropertyTearOff::baseVal): (WebCore::SVGAnimatedListPropertyTearOff::animVal): (WebCore::SVGAnimatedListPropertyTearOff::removeItemFromList): (WebCore::SVGAnimatedListPropertyTearOff::detachListWrappers): (WebCore::SVGAnimatedListPropertyTearOff::currentAnimatedValue): (WebCore::SVGAnimatedListPropertyTearOff::animationStarted): (WebCore::SVGAnimatedListPropertyTearOff::animationEnded): (WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded): * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: (WebCore::SVGAnimatedPathSegListPropertyTearOff::baseVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList): (SVGAnimatedPathSegListPropertyTearOff): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animationStarted): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animationEnded): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animatedPathByteStream): (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: (WebCore::SVGAnimatedTransformListPropertyTearOff::baseVal): (WebCore::SVGAnimatedTransformListPropertyTearOff::animVal): * svg/properties/SVGListProperty.h: (WebCore::SVGListProperty::setValuesAndWrappers): (WebCore::SVGListProperty::SVGListProperty): (WebCore::SVGListProperty::~SVGListProperty): (SVGListProperty): LayoutTests: Update all tests animating the SVGPathElement's 'd' attribute to verify 'animatedPathSegList' now gets animated, not 'pathSegList'. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: * svg/animations/animate-path-animation-Qq-Tt-expected.txt: * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: * svg/animations/animate-path-to-animation-expected.txt: * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-to-animation.js: (checkBaseVal): (sample1): (sample2): (sample3): * svg/animations/script-tests/svgpath-animation-1.js: (checkBaseVal): (sample1): (sample2): (sample3): * svg/animations/script-tests/svgtransform-animation-1.js: * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/100525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-04 13:52:46 +00:00
PASS path.animatedPathSegList.numberOfItems is 5
PASS path.animatedPathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.animatedPathSegList.getItem(0).x is 40
PASS path.animatedPathSegList.getItem(0).y is 40
PASS path.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(1).x is 60
PASS path.animatedPathSegList.getItem(1).y is 40
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(2).x is 60
PASS path.animatedPathSegList.getItem(2).y is 60
PASS path.animatedPathSegList.getItem(3).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(3).x is 40
PASS path.animatedPathSegList.getItem(3).y is 60
PASS path.animatedPathSegList.getItem(4).pathSegTypeAsLetter is "Z"
PASS path.pathSegList.numberOfItems is 5
PASS path.pathSegList.getItem(0).pathSegTypeAsLetter is "M"
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. Canonical link: https://commits.webkit.org/66819@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-25 13:46:18 +00:00
PASS path.pathSegList.getItem(0).x is 40
PASS path.pathSegList.getItem(0).y is 40
Implement animatedPathSegList support for SVGPathElement https://bugs.webkit.org/show_bug.cgi?id=83140 Reviewed by Zoltan Herczeg. Source/WebCore: Add the last missing piece of animVal support: animations of the SVGPathElement's 'd' attribute should be reflected in the 'animatedPathSegList' not the 'pathSegList'. The SVGAnimatedPathAnimator is special as it doesn't operate on the SVGPathSegList types directly, but on the SVGPathByteStreams for performance reasons. The SVGPathSegLists are refcounted and exposed to JS, thus require lots of memory, compared to a simple byte stream, which SVGPathByteStream is. Only build an 'animatedPathSegList' while animating if its actually observed by the bindings, as this operation is heavy. This marks the finish of the animVal patch series: no more string round trips during animation. Previously paths were animated as byte streams, then converted to a String passed to pathElement->setAttribute("d", "newString"), parsed again to a byte stream, etc. A follow-up patch will remove the last crufts of direct setAttribute() animation. Extend all existing animated SVGPathElement tests to cover animatedPathSegList. * svg/SVGAnimatedColor.h: (WebCore::SVGAnimatedColorAnimator::startAnimValAnimation): (WebCore::SVGAnimatedColorAnimator::stopAnimValAnimation): (WebCore::SVGAnimatedColorAnimator::resetAnimValToBaseVal): (WebCore::SVGAnimatedColorAnimator::animValWillChange): (WebCore::SVGAnimatedColorAnimator::animValDidChange): (SVGAnimatedColorAnimator): * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::constructFromString): (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): (WebCore): (WebCore::SVGAnimatedPathAnimator::stopAnimValAnimation): (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal): (WebCore::SVGAnimatedPathAnimator::animValWillChange): (WebCore::SVGAnimatedPathAnimator::animValDidChange): (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): * svg/SVGAnimatedPath.h: (SVGAnimatedPathAnimator): * svg/SVGAnimatedType.cpp: (WebCore::SVGAnimatedType::valueAsString): (WebCore::SVGAnimatedType::setValueAsString): (WebCore::SVGAnimatedType::supportsAnimVal): * svg/SVGAnimatedTypeAnimator.h: (SVGAnimatedTypeAnimator): (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName): * svg/SVGPathElement.cpp: (WebCore::SVGPathElement::SVGPathElement): (WebCore::SVGPathElement::getTotalLength): (WebCore::SVGPathElement::getPointAtLength): (WebCore::SVGPathElement::getPathSegAtLength): (WebCore::SVGPathElement::parseAttribute): (WebCore::SVGPathElement::svgAttributeChanged): (WebCore::SVGPathElement::pathByteStream): (WebCore): (WebCore::SVGPathElement::lookupOrCreateDWrapper): (WebCore::SVGPathElement::pathSegList): (WebCore::SVGPathElement::animatedPathSegList): (WebCore::SVGPathElement::pathSegListChanged): * svg/SVGPathElement.h: (WebCore): (SVGPathElement): (WebCore::SVGPathElement::isAnimValObserved): * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromSVGPathSegList): (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromString): (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): * svg/SVGPathParserFactory.h: (SVGPathParserFactory): * svg/SVGPathSegWithContext.h: * svg/properties/SVGAnimatedListPropertyTearOff.h: (SVGAnimatedListPropertyTearOff): (WebCore::SVGAnimatedListPropertyTearOff::baseVal): (WebCore::SVGAnimatedListPropertyTearOff::animVal): (WebCore::SVGAnimatedListPropertyTearOff::removeItemFromList): (WebCore::SVGAnimatedListPropertyTearOff::detachListWrappers): (WebCore::SVGAnimatedListPropertyTearOff::currentAnimatedValue): (WebCore::SVGAnimatedListPropertyTearOff::animationStarted): (WebCore::SVGAnimatedListPropertyTearOff::animationEnded): (WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded): * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: (WebCore::SVGAnimatedPathSegListPropertyTearOff::baseVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList): (SVGAnimatedPathSegListPropertyTearOff): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animationStarted): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animationEnded): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animatedPathByteStream): (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: (WebCore::SVGAnimatedTransformListPropertyTearOff::baseVal): (WebCore::SVGAnimatedTransformListPropertyTearOff::animVal): * svg/properties/SVGListProperty.h: (WebCore::SVGListProperty::setValuesAndWrappers): (WebCore::SVGListProperty::SVGListProperty): (WebCore::SVGListProperty::~SVGListProperty): (SVGListProperty): LayoutTests: Update all tests animating the SVGPathElement's 'd' attribute to verify 'animatedPathSegList' now gets animated, not 'pathSegList'. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: * svg/animations/animate-path-animation-Qq-Tt-expected.txt: * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: * svg/animations/animate-path-to-animation-expected.txt: * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-to-animation.js: (checkBaseVal): (sample1): (sample2): (sample3): * svg/animations/script-tests/svgpath-animation-1.js: (checkBaseVal): (sample1): (sample2): (sample3): * svg/animations/script-tests/svgtransform-animation-1.js: * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/100525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-04 13:52:46 +00:00
PASS path.pathSegList.getItem(1).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(1).x is 60
PASS path.pathSegList.getItem(1).y is 40
PASS path.pathSegList.getItem(2).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(2).x is 60
PASS path.pathSegList.getItem(2).y is 60
PASS path.pathSegList.getItem(3).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(3).x is 40
PASS path.pathSegList.getItem(3).y is 60
PASS path.pathSegList.getItem(4).pathSegTypeAsLetter is "Z"
PASS path.animatedPathSegList.numberOfItems is 5
PASS path.animatedPathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.animatedPathSegList.getItem(0).x is 20
PASS path.animatedPathSegList.getItem(0).y is 20
PASS path.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(1).x is 80
PASS path.animatedPathSegList.getItem(1).y is 20
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(2).x is 80
PASS path.animatedPathSegList.getItem(2).y is 80
PASS path.animatedPathSegList.getItem(3).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(3).x is 20
PASS path.animatedPathSegList.getItem(3).y is 80
PASS path.animatedPathSegList.getItem(4).pathSegTypeAsLetter is "Z"
PASS path.pathSegList.numberOfItems is 5
PASS path.pathSegList.getItem(0).pathSegTypeAsLetter is "M"
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. Canonical link: https://commits.webkit.org/66819@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-25 13:46:18 +00:00
PASS path.pathSegList.getItem(0).x is 40
PASS path.pathSegList.getItem(0).y is 40
Implement animatedPathSegList support for SVGPathElement https://bugs.webkit.org/show_bug.cgi?id=83140 Reviewed by Zoltan Herczeg. Source/WebCore: Add the last missing piece of animVal support: animations of the SVGPathElement's 'd' attribute should be reflected in the 'animatedPathSegList' not the 'pathSegList'. The SVGAnimatedPathAnimator is special as it doesn't operate on the SVGPathSegList types directly, but on the SVGPathByteStreams for performance reasons. The SVGPathSegLists are refcounted and exposed to JS, thus require lots of memory, compared to a simple byte stream, which SVGPathByteStream is. Only build an 'animatedPathSegList' while animating if its actually observed by the bindings, as this operation is heavy. This marks the finish of the animVal patch series: no more string round trips during animation. Previously paths were animated as byte streams, then converted to a String passed to pathElement->setAttribute("d", "newString"), parsed again to a byte stream, etc. A follow-up patch will remove the last crufts of direct setAttribute() animation. Extend all existing animated SVGPathElement tests to cover animatedPathSegList. * svg/SVGAnimatedColor.h: (WebCore::SVGAnimatedColorAnimator::startAnimValAnimation): (WebCore::SVGAnimatedColorAnimator::stopAnimValAnimation): (WebCore::SVGAnimatedColorAnimator::resetAnimValToBaseVal): (WebCore::SVGAnimatedColorAnimator::animValWillChange): (WebCore::SVGAnimatedColorAnimator::animValDidChange): (SVGAnimatedColorAnimator): * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::constructFromString): (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): (WebCore): (WebCore::SVGAnimatedPathAnimator::stopAnimValAnimation): (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal): (WebCore::SVGAnimatedPathAnimator::animValWillChange): (WebCore::SVGAnimatedPathAnimator::animValDidChange): (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): * svg/SVGAnimatedPath.h: (SVGAnimatedPathAnimator): * svg/SVGAnimatedType.cpp: (WebCore::SVGAnimatedType::valueAsString): (WebCore::SVGAnimatedType::setValueAsString): (WebCore::SVGAnimatedType::supportsAnimVal): * svg/SVGAnimatedTypeAnimator.h: (SVGAnimatedTypeAnimator): (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName): * svg/SVGPathElement.cpp: (WebCore::SVGPathElement::SVGPathElement): (WebCore::SVGPathElement::getTotalLength): (WebCore::SVGPathElement::getPointAtLength): (WebCore::SVGPathElement::getPathSegAtLength): (WebCore::SVGPathElement::parseAttribute): (WebCore::SVGPathElement::svgAttributeChanged): (WebCore::SVGPathElement::pathByteStream): (WebCore): (WebCore::SVGPathElement::lookupOrCreateDWrapper): (WebCore::SVGPathElement::pathSegList): (WebCore::SVGPathElement::animatedPathSegList): (WebCore::SVGPathElement::pathSegListChanged): * svg/SVGPathElement.h: (WebCore): (SVGPathElement): (WebCore::SVGPathElement::isAnimValObserved): * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromSVGPathSegList): (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromString): (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): * svg/SVGPathParserFactory.h: (SVGPathParserFactory): * svg/SVGPathSegWithContext.h: * svg/properties/SVGAnimatedListPropertyTearOff.h: (SVGAnimatedListPropertyTearOff): (WebCore::SVGAnimatedListPropertyTearOff::baseVal): (WebCore::SVGAnimatedListPropertyTearOff::animVal): (WebCore::SVGAnimatedListPropertyTearOff::removeItemFromList): (WebCore::SVGAnimatedListPropertyTearOff::detachListWrappers): (WebCore::SVGAnimatedListPropertyTearOff::currentAnimatedValue): (WebCore::SVGAnimatedListPropertyTearOff::animationStarted): (WebCore::SVGAnimatedListPropertyTearOff::animationEnded): (WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded): * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: (WebCore::SVGAnimatedPathSegListPropertyTearOff::baseVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList): (SVGAnimatedPathSegListPropertyTearOff): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animationStarted): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animationEnded): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animatedPathByteStream): (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: (WebCore::SVGAnimatedTransformListPropertyTearOff::baseVal): (WebCore::SVGAnimatedTransformListPropertyTearOff::animVal): * svg/properties/SVGListProperty.h: (WebCore::SVGListProperty::setValuesAndWrappers): (WebCore::SVGListProperty::SVGListProperty): (WebCore::SVGListProperty::~SVGListProperty): (SVGListProperty): LayoutTests: Update all tests animating the SVGPathElement's 'd' attribute to verify 'animatedPathSegList' now gets animated, not 'pathSegList'. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: * svg/animations/animate-path-animation-Qq-Tt-expected.txt: * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: * svg/animations/animate-path-to-animation-expected.txt: * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-to-animation.js: (checkBaseVal): (sample1): (sample2): (sample3): * svg/animations/script-tests/svgpath-animation-1.js: (checkBaseVal): (sample1): (sample2): (sample3): * svg/animations/script-tests/svgtransform-animation-1.js: * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/100525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-04 13:52:46 +00:00
PASS path.pathSegList.getItem(1).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(1).x is 60
PASS path.pathSegList.getItem(1).y is 40
PASS path.pathSegList.getItem(2).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(2).x is 60
PASS path.pathSegList.getItem(2).y is 60
PASS path.pathSegList.getItem(3).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(3).x is 40
PASS path.pathSegList.getItem(3).y is 60
PASS path.pathSegList.getItem(4).pathSegTypeAsLetter is "Z"
PASS path.animatedPathSegList.numberOfItems is 5
PASS path.animatedPathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.animatedPathSegList.getItem(0).x is 0
PASS path.animatedPathSegList.getItem(0).y is 0
PASS path.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(1).x is 100
PASS path.animatedPathSegList.getItem(1).y is 0
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(2).x is 100
PASS path.animatedPathSegList.getItem(2).y is 100
PASS path.animatedPathSegList.getItem(3).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(3).x is 0
PASS path.animatedPathSegList.getItem(3).y is 100
PASS path.animatedPathSegList.getItem(4).pathSegTypeAsLetter is "Z"
PASS path.pathSegList.numberOfItems is 5
PASS path.pathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.pathSegList.getItem(0).x is 40
PASS path.pathSegList.getItem(0).y is 40
PASS path.pathSegList.getItem(1).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(1).x is 60
PASS path.pathSegList.getItem(1).y is 40
PASS path.pathSegList.getItem(2).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(2).x is 60
PASS path.pathSegList.getItem(2).y is 60
PASS path.pathSegList.getItem(3).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(3).x is 40
PASS path.pathSegList.getItem(3).y is 60
PASS path.pathSegList.getItem(4).pathSegTypeAsLetter is "Z"
PASS path.animatedPathSegList.numberOfItems is 5
PASS path.animatedPathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.animatedPathSegList.getItem(0).x is 40
PASS path.animatedPathSegList.getItem(0).y is 40
PASS path.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(1).x is 60
PASS path.animatedPathSegList.getItem(1).y is 40
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(2).x is 60
PASS path.animatedPathSegList.getItem(2).y is 60
PASS path.animatedPathSegList.getItem(3).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(3).x is 40
PASS path.animatedPathSegList.getItem(3).y is 60
PASS path.animatedPathSegList.getItem(4).pathSegTypeAsLetter is "Z"
PASS path.pathSegList.numberOfItems is 5
PASS path.pathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.pathSegList.getItem(0).x is 40
PASS path.pathSegList.getItem(0).y is 40
PASS path.pathSegList.getItem(1).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(1).x is 60
PASS path.pathSegList.getItem(1).y is 40
PASS path.pathSegList.getItem(2).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(2).x is 60
PASS path.pathSegList.getItem(2).y is 60
PASS path.pathSegList.getItem(3).pathSegTypeAsLetter is "L"
PASS path.pathSegList.getItem(3).x is 40
PASS path.pathSegList.getItem(3).y is 60
PASS path.pathSegList.getItem(4).pathSegTypeAsLetter is "Z"
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. Canonical link: https://commits.webkit.org/66819@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-25 13:46:18 +00:00
PASS successfullyParsed is true
TEST COMPLETE