haikuwebkit/LayoutTests/svg/animations/svgpath-animation-1-expecte...

152 lines
7.3 KiB
Plaintext
Raw Permalink Normal View History

Reviewed by Rob Buis. Source/WebCore: SVGAnimatedPath needs fallback for 'by' animation https://bugs.webkit.org/show_bug.cgi?id=63865 Added fallback to 'to' animation for 'by' animated SVGAnimatedPathAnimator. Clenup of SVGAnimateElement. Removed all switches since we support all AnimatedTypes with the exception of AnimatedEnumeration. AnimatedEnumeration gets animated as AnimatedString at the moment. Test: svg/animations/svgpath-animation-1.html * svg/SVGAnimateElement.cpp: (WebCore::getPropertyValue): (WebCore::inheritsFromProperty): (WebCore::attributeValueIsCurrentColor): (WebCore::SVGAnimateElement::adjustForCurrentColor): (WebCore::SVGAnimateElement::determineAnimatedAttributeType): (WebCore::SVGAnimateElement::calculateAnimatedValue): (WebCore::SVGAnimateElement::calculateFromAndToValues): (WebCore::SVGAnimateElement::calculateFromAndByValues): (WebCore::SVGAnimateElement::resetToBaseValue): (WebCore::SVGAnimateElement::applyResultsToTarget): (WebCore::SVGAnimateElement::calculateDistance): * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::calculateFromAndByValues): LayoutTests: SVGAnimatedPath needs fallback for 'by' animation https://bugs.webkit.org/show_bug.cgi?id=63865 Test fallback to 'to' animation for 'by' animated SVGPath. * svg/animations/script-tests/svgpath-animation-1.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Added. * svg/animations/svgpath-animation-1.html: Added. Canonical link: https://commits.webkit.org/79847@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-07-07 18:43:44 +00:00
SVG 1.1 dynamic animation tests
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
Test 'by' animation on path. You should see a green 100x100 path and only PASS messages
Reviewed by Rob Buis. Source/WebCore: SVGAnimatedPath needs fallback for 'by' animation https://bugs.webkit.org/show_bug.cgi?id=63865 Added fallback to 'to' animation for 'by' animated SVGAnimatedPathAnimator. Clenup of SVGAnimateElement. Removed all switches since we support all AnimatedTypes with the exception of AnimatedEnumeration. AnimatedEnumeration gets animated as AnimatedString at the moment. Test: svg/animations/svgpath-animation-1.html * svg/SVGAnimateElement.cpp: (WebCore::getPropertyValue): (WebCore::inheritsFromProperty): (WebCore::attributeValueIsCurrentColor): (WebCore::SVGAnimateElement::adjustForCurrentColor): (WebCore::SVGAnimateElement::determineAnimatedAttributeType): (WebCore::SVGAnimateElement::calculateAnimatedValue): (WebCore::SVGAnimateElement::calculateFromAndToValues): (WebCore::SVGAnimateElement::calculateFromAndByValues): (WebCore::SVGAnimateElement::resetToBaseValue): (WebCore::SVGAnimateElement::applyResultsToTarget): (WebCore::SVGAnimateElement::calculateDistance): * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::calculateFromAndByValues): LayoutTests: SVGAnimatedPath needs fallback for 'by' animation https://bugs.webkit.org/show_bug.cgi?id=63865 Test fallback to 'to' animation for 'by' animated SVGPath. * svg/animations/script-tests/svgpath-animation-1.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Added. * svg/animations/svgpath-animation-1.html: Added. Canonical link: https://commits.webkit.org/79847@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-07-07 18:43:44 +00:00
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"
Reviewed by Rob Buis. Source/WebCore: SVGAnimatedPath needs fallback for 'by' animation https://bugs.webkit.org/show_bug.cgi?id=63865 Added fallback to 'to' animation for 'by' animated SVGAnimatedPathAnimator. Clenup of SVGAnimateElement. Removed all switches since we support all AnimatedTypes with the exception of AnimatedEnumeration. AnimatedEnumeration gets animated as AnimatedString at the moment. Test: svg/animations/svgpath-animation-1.html * svg/SVGAnimateElement.cpp: (WebCore::getPropertyValue): (WebCore::inheritsFromProperty): (WebCore::attributeValueIsCurrentColor): (WebCore::SVGAnimateElement::adjustForCurrentColor): (WebCore::SVGAnimateElement::determineAnimatedAttributeType): (WebCore::SVGAnimateElement::calculateAnimatedValue): (WebCore::SVGAnimateElement::calculateFromAndToValues): (WebCore::SVGAnimateElement::calculateFromAndByValues): (WebCore::SVGAnimateElement::resetToBaseValue): (WebCore::SVGAnimateElement::applyResultsToTarget): (WebCore::SVGAnimateElement::calculateDistance): * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::calculateFromAndByValues): LayoutTests: SVGAnimatedPath needs fallback for 'by' animation https://bugs.webkit.org/show_bug.cgi?id=63865 Test fallback to 'to' animation for 'by' animated SVGPath. * svg/animations/script-tests/svgpath-animation-1.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Added. * svg/animations/svgpath-animation-1.html: Added. Canonical link: https://commits.webkit.org/79847@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-07-07 18:43:44 +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"
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(0).x is 40
PASS path.animatedPathSegList.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.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "L"
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(1).x is 110
PASS path.animatedPathSegList.getItem(1).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.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "L"
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(2).x is 110
PASS path.animatedPathSegList.getItem(2).y is 110
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.getItem(3).pathSegTypeAsLetter is "L"
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(3).x is 40
PASS path.animatedPathSegList.getItem(3).y is 110
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.getItem(4).pathSegTypeAsLetter is "Z"
PASS path.pathSegList.numberOfItems is 5
PASS path.pathSegList.getItem(0).pathSegTypeAsLetter is "M"
Reviewed by Rob Buis. Source/WebCore: SVGAnimatedPath needs fallback for 'by' animation https://bugs.webkit.org/show_bug.cgi?id=63865 Added fallback to 'to' animation for 'by' animated SVGAnimatedPathAnimator. Clenup of SVGAnimateElement. Removed all switches since we support all AnimatedTypes with the exception of AnimatedEnumeration. AnimatedEnumeration gets animated as AnimatedString at the moment. Test: svg/animations/svgpath-animation-1.html * svg/SVGAnimateElement.cpp: (WebCore::getPropertyValue): (WebCore::inheritsFromProperty): (WebCore::attributeValueIsCurrentColor): (WebCore::SVGAnimateElement::adjustForCurrentColor): (WebCore::SVGAnimateElement::determineAnimatedAttributeType): (WebCore::SVGAnimateElement::calculateAnimatedValue): (WebCore::SVGAnimateElement::calculateFromAndToValues): (WebCore::SVGAnimateElement::calculateFromAndByValues): (WebCore::SVGAnimateElement::resetToBaseValue): (WebCore::SVGAnimateElement::applyResultsToTarget): (WebCore::SVGAnimateElement::calculateDistance): * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::calculateFromAndByValues): LayoutTests: SVGAnimatedPath needs fallback for 'by' animation https://bugs.webkit.org/show_bug.cgi?id=63865 Test fallback to 'to' animation for 'by' animated SVGPath. * svg/animations/script-tests/svgpath-animation-1.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Added. * svg/animations/svgpath-animation-1.html: Added. Canonical link: https://commits.webkit.org/79847@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-07-07 18:43:44 +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"
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(0).x is 40
PASS path.animatedPathSegList.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.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "L"
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(1).x is 110
PASS path.animatedPathSegList.getItem(1).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.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "L"
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(2).x is 110
PASS path.animatedPathSegList.getItem(2).y is 110
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.getItem(3).pathSegTypeAsLetter is "L"
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(3).x is 40
PASS path.animatedPathSegList.getItem(3).y is 110
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.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"
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(1).x is 160
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.getItem(1).y is 40
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "L"
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(2).x is 160
PASS path.animatedPathSegList.getItem(2).y is 160
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.getItem(3).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(3).x is 40
Fix repetitions & by animation support for path animations https://bugs.webkit.org/show_bug.cgi?id=85071 Reviewed by Antti Koivisto. Source/WebCore: Implement additive="sum" / by-animation support for path animations, eg. <path d="M 10 10 L 10 100 Z"> <animate attributeName="d" begin="0s" dur="4s" by="M 0 0 L 90 0 Z"/> <path> animates the d attribute to "M 10 10 L 100 100 0 Z". Now only <animateColor> and <animateMotion> are left to be fixed, all other types are working as expected now in all additive/accumulate/from-by/by/from-to animations. Tests: svg/animations/path-animation-expected.svg svg/animations/repeating-path-animation-expected.svg svg/animations/repeating-path-animation.svg * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes): Implemented, to support by-animations, instead of falling back to to-animations. (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): Handle repetitions, accumulation & addition. * svg/SVGPathBlender.cpp: Allow empty from source everywhere, use default values if no from value is specified, needed for by-animations. (WebCore::SVGPathBlender::SVGPathBlender): (WebCore::SVGPathBlender::blendAnimatedDimensonalFloat): (WebCore::SVGPathBlender::blendAnimatedFloatPoint): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::addAnimatedPath): (WebCore::SVGPathBlender::blendAnimatedPath): * svg/SVGPathBlender.h: Add new addAnimatedPath function. (SVGPathBlender): * svg/SVGPathByteStream.h: (SVGPathByteStream): Make SVGPathByteStreams copyable, needed for SVGAnimatedPathAnimator. (WebCore::SVGPathByteStream::size): Returns size of the SVGPathByteStream. * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): Allow empty from streams, needed for by animations. (WebCore::SVGPathParserFactory::addToSVGPathByteStream): Add 'byStream' 'repeatCount' times to 'toStream'. Both streams must match in size. * svg/SVGPathParserFactory.h: Add new addToSVGPathByteStream function. * svg/SVGPointList.cpp: Remove dead code. * svg/SVGPointList.h: Ditto. (SVGPointList): LayoutTests: * svg/animations/path-animation.svg: Added. * svg/animations/path-animation-expected.svg: Added. * svg/animations/repeating-path-animation-expected.svg: Added. * svg/animations/repeating-path-animation.svg: Added. * svg/animations/script-tests/svgpath-animation-1.js: Correct testcase, now that by animations are supported. (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/102676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 08:27:08 +00:00
PASS path.animatedPathSegList.getItem(3).y is 160
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 160
PASS path.animatedPathSegList.getItem(1).y is 40
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(2).x is 160
PASS path.animatedPathSegList.getItem(2).y is 160
PASS path.animatedPathSegList.getItem(3).pathSegTypeAsLetter is "L"
PASS path.animatedPathSegList.getItem(3).x is 40
PASS path.animatedPathSegList.getItem(3).y is 160
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.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"
Reviewed by Rob Buis. Source/WebCore: SVGAnimatedPath needs fallback for 'by' animation https://bugs.webkit.org/show_bug.cgi?id=63865 Added fallback to 'to' animation for 'by' animated SVGAnimatedPathAnimator. Clenup of SVGAnimateElement. Removed all switches since we support all AnimatedTypes with the exception of AnimatedEnumeration. AnimatedEnumeration gets animated as AnimatedString at the moment. Test: svg/animations/svgpath-animation-1.html * svg/SVGAnimateElement.cpp: (WebCore::getPropertyValue): (WebCore::inheritsFromProperty): (WebCore::attributeValueIsCurrentColor): (WebCore::SVGAnimateElement::adjustForCurrentColor): (WebCore::SVGAnimateElement::determineAnimatedAttributeType): (WebCore::SVGAnimateElement::calculateAnimatedValue): (WebCore::SVGAnimateElement::calculateFromAndToValues): (WebCore::SVGAnimateElement::calculateFromAndByValues): (WebCore::SVGAnimateElement::resetToBaseValue): (WebCore::SVGAnimateElement::applyResultsToTarget): (WebCore::SVGAnimateElement::calculateDistance): * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::calculateFromAndByValues): LayoutTests: SVGAnimatedPath needs fallback for 'by' animation https://bugs.webkit.org/show_bug.cgi?id=63865 Test fallback to 'to' animation for 'by' animated SVGPath. * svg/animations/script-tests/svgpath-animation-1.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/svgpath-animation-1-expected.txt: Added. * svg/animations/svgpath-animation-1.html: Added. Canonical link: https://commits.webkit.org/79847@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-07-07 18:43:44 +00:00
PASS successfullyParsed is true
TEST COMPLETE