haikuwebkit/LayoutTests/svg/animations/animate-path-animation-qQ-t...

142 lines
6.8 KiB
Plaintext
Raw Permalink Normal View History

2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
SVG 1.1 dynamic animation tests
Test path animation where coordinate modes of start and end differ. You should see PASS messages
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Implement animatedPathSegList support for SVGPathElement https://bugs.webkit.org/show_bug.cgi?id=83140 Reviewed by Zoltan Herczeg. Source/WebCore: Add the last missing piece of animVal support: animations of the SVGPathElement's 'd' attribute should be reflected in the 'animatedPathSegList' not the 'pathSegList'. The SVGAnimatedPathAnimator is special as it doesn't operate on the SVGPathSegList types directly, but on the SVGPathByteStreams for performance reasons. The SVGPathSegLists are refcounted and exposed to JS, thus require lots of memory, compared to a simple byte stream, which SVGPathByteStream is. Only build an 'animatedPathSegList' while animating if its actually observed by the bindings, as this operation is heavy. This marks the finish of the animVal patch series: no more string round trips during animation. Previously paths were animated as byte streams, then converted to a String passed to pathElement->setAttribute("d", "newString"), parsed again to a byte stream, etc. A follow-up patch will remove the last crufts of direct setAttribute() animation. Extend all existing animated SVGPathElement tests to cover animatedPathSegList. * svg/SVGAnimatedColor.h: (WebCore::SVGAnimatedColorAnimator::startAnimValAnimation): (WebCore::SVGAnimatedColorAnimator::stopAnimValAnimation): (WebCore::SVGAnimatedColorAnimator::resetAnimValToBaseVal): (WebCore::SVGAnimatedColorAnimator::animValWillChange): (WebCore::SVGAnimatedColorAnimator::animValDidChange): (SVGAnimatedColorAnimator): * svg/SVGAnimatedPath.cpp: (WebCore::SVGAnimatedPathAnimator::constructFromString): (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): (WebCore): (WebCore::SVGAnimatedPathAnimator::stopAnimValAnimation): (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal): (WebCore::SVGAnimatedPathAnimator::animValWillChange): (WebCore::SVGAnimatedPathAnimator::animValDidChange): (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue): * svg/SVGAnimatedPath.h: (SVGAnimatedPathAnimator): * svg/SVGAnimatedType.cpp: (WebCore::SVGAnimatedType::valueAsString): (WebCore::SVGAnimatedType::setValueAsString): (WebCore::SVGAnimatedType::supportsAnimVal): * svg/SVGAnimatedTypeAnimator.h: (SVGAnimatedTypeAnimator): (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName): * svg/SVGPathElement.cpp: (WebCore::SVGPathElement::SVGPathElement): (WebCore::SVGPathElement::getTotalLength): (WebCore::SVGPathElement::getPointAtLength): (WebCore::SVGPathElement::getPathSegAtLength): (WebCore::SVGPathElement::parseAttribute): (WebCore::SVGPathElement::svgAttributeChanged): (WebCore::SVGPathElement::pathByteStream): (WebCore): (WebCore::SVGPathElement::lookupOrCreateDWrapper): (WebCore::SVGPathElement::pathSegList): (WebCore::SVGPathElement::animatedPathSegList): (WebCore::SVGPathElement::pathSegListChanged): * svg/SVGPathElement.h: (WebCore): (SVGPathElement): (WebCore::SVGPathElement::isAnimValObserved): * svg/SVGPathParserFactory.cpp: (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromSVGPathSegList): (WebCore::SVGPathParserFactory::buildSVGPathByteStreamFromString): (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream): * svg/SVGPathParserFactory.h: (SVGPathParserFactory): * svg/SVGPathSegWithContext.h: * svg/properties/SVGAnimatedListPropertyTearOff.h: (SVGAnimatedListPropertyTearOff): (WebCore::SVGAnimatedListPropertyTearOff::baseVal): (WebCore::SVGAnimatedListPropertyTearOff::animVal): (WebCore::SVGAnimatedListPropertyTearOff::removeItemFromList): (WebCore::SVGAnimatedListPropertyTearOff::detachListWrappers): (WebCore::SVGAnimatedListPropertyTearOff::currentAnimatedValue): (WebCore::SVGAnimatedListPropertyTearOff::animationStarted): (WebCore::SVGAnimatedListPropertyTearOff::animationEnded): (WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded): * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: (WebCore::SVGAnimatedPathSegListPropertyTearOff::baseVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animVal): (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList): (SVGAnimatedPathSegListPropertyTearOff): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animationStarted): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animationEnded): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animatedPathByteStream): (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: (WebCore::SVGAnimatedTransformListPropertyTearOff::baseVal): (WebCore::SVGAnimatedTransformListPropertyTearOff::animVal): * svg/properties/SVGListProperty.h: (WebCore::SVGListProperty::setValuesAndWrappers): (WebCore::SVGListProperty::SVGListProperty): (WebCore::SVGListProperty::~SVGListProperty): (SVGListProperty): LayoutTests: Update all tests animating the SVGPathElement's 'd' attribute to verify 'animatedPathSegList' now gets animated, not 'pathSegList'. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: * svg/animations/animate-path-animation-Qq-Tt-expected.txt: * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: * svg/animations/animate-path-to-animation-expected.txt: * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: (checkBaseVal): (sample1): (sample2): (sample3): (sample4): * svg/animations/script-tests/animate-path-to-animation.js: (checkBaseVal): (sample1): (sample2): (sample3): * svg/animations/script-tests/svgpath-animation-1.js: (checkBaseVal): (sample1): (sample2): (sample3): * svg/animations/script-tests/svgtransform-animation-1.js: * svg/animations/svgpath-animation-1-expected.txt: Canonical link: https://commits.webkit.org/100525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-04 13:52:46 +00:00
PASS path.animatedPathSegList.numberOfItems is 4
PASS path.animatedPathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.animatedPathSegList.getItem(0).x is -30
PASS path.animatedPathSegList.getItem(0).y is -30
PASS path.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "q"
PASS path.animatedPathSegList.getItem(1).x is 30
PASS path.animatedPathSegList.getItem(1).y is 30
PASS path.animatedPathSegList.getItem(1).x1 is 30
PASS path.animatedPathSegList.getItem(1).y1 is 0
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "t"
PASS path.animatedPathSegList.getItem(2).x is -30
PASS path.animatedPathSegList.getItem(2).y is 30
PASS path.animatedPathSegList.getItem(3).pathSegTypeAsLetter is "Z"
PASS path.pathSegList.numberOfItems is 4
PASS path.pathSegList.getItem(0).pathSegTypeAsLetter is "M"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(0).x is -30
PASS path.pathSegList.getItem(0).y is -30
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 "q"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(1).x is 30
PASS path.pathSegList.getItem(1).y is 30
PASS path.pathSegList.getItem(1).x1 is 30
PASS path.pathSegList.getItem(1).y1 is 0
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(2).pathSegTypeAsLetter is "t"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(2).x is -30
PASS path.pathSegList.getItem(2).y is 30
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(3).pathSegTypeAsLetter is "Z"
PASS path.animatedPathSegList.numberOfItems is 4
PASS path.animatedPathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.animatedPathSegList.getItem(0).x is -30
PASS path.animatedPathSegList.getItem(0).y is -30
PASS path.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "q"
PASS path.animatedPathSegList.getItem(1).x is 37.5
PASS path.animatedPathSegList.getItem(1).y is 30
PASS path.animatedPathSegList.getItem(1).x1 is 37.5
PASS path.animatedPathSegList.getItem(1).y1 is 0
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "t"
PASS path.animatedPathSegList.getItem(2).x is -37.5
PASS path.animatedPathSegList.getItem(2).y is 30
PASS path.animatedPathSegList.getItem(3).pathSegTypeAsLetter is "Z"
PASS path.pathSegList.numberOfItems is 4
PASS path.pathSegList.getItem(0).pathSegTypeAsLetter is "M"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(0).x is -30
PASS path.pathSegList.getItem(0).y is -30
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 "q"
PASS path.pathSegList.getItem(1).x is 30
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(1).y is 30
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).x1 is 30
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(1).y1 is 0
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(2).pathSegTypeAsLetter is "t"
PASS path.pathSegList.getItem(2).x is -30
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(2).y is 30
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(3).pathSegTypeAsLetter is "Z"
PASS path.animatedPathSegList.numberOfItems is 4
PASS path.animatedPathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.animatedPathSegList.getItem(0).x is -30
PASS path.animatedPathSegList.getItem(0).y is -30
PASS path.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "Q"
PASS path.animatedPathSegList.getItem(1).x is 22.5
PASS path.animatedPathSegList.getItem(1).y is 0
PASS path.animatedPathSegList.getItem(1).x1 is 22.5
PASS path.animatedPathSegList.getItem(1).y1 is -30
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "T"
PASS path.animatedPathSegList.getItem(2).x is -30
PASS path.animatedPathSegList.getItem(2).y is 30
PASS path.animatedPathSegList.getItem(3).pathSegTypeAsLetter is "Z"
PASS path.pathSegList.numberOfItems is 4
PASS path.pathSegList.getItem(0).pathSegTypeAsLetter is "M"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(0).x is -30
PASS path.pathSegList.getItem(0).y is -30
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 "q"
PASS path.pathSegList.getItem(1).x is 30
PASS path.pathSegList.getItem(1).y is 30
PASS path.pathSegList.getItem(1).x1 is 30
PASS path.pathSegList.getItem(1).y1 is 0
PASS path.pathSegList.getItem(2).pathSegTypeAsLetter is "t"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(2).x is -30
PASS path.pathSegList.getItem(2).y is 30
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(3).pathSegTypeAsLetter is "Z"
PASS path.animatedPathSegList.numberOfItems is 4
PASS path.animatedPathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.animatedPathSegList.getItem(0).x is -30
PASS path.animatedPathSegList.getItem(0).y is -30
PASS path.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "Q"
PASS path.animatedPathSegList.getItem(1).x is 30
PASS path.animatedPathSegList.getItem(1).y is 0
PASS path.animatedPathSegList.getItem(1).x1 is 30
PASS path.animatedPathSegList.getItem(1).y1 is -30
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "T"
PASS path.animatedPathSegList.getItem(2).x is -30
PASS path.animatedPathSegList.getItem(2).y is 30
PASS path.animatedPathSegList.getItem(3).pathSegTypeAsLetter is "Z"
PASS path.pathSegList.numberOfItems is 4
PASS path.pathSegList.getItem(0).pathSegTypeAsLetter is "M"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(0).x is -30
PASS path.pathSegList.getItem(0).y is -30
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 "q"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(1).x is 30
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).y is 30
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(1).x1 is 30
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).y1 is 0
PASS path.pathSegList.getItem(2).pathSegTypeAsLetter is "t"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(2).x is -30
PASS path.pathSegList.getItem(2).y is 30
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(3).pathSegTypeAsLetter is "Z"
PASS path.animatedPathSegList.numberOfItems is 4
PASS path.animatedPathSegList.getItem(0).pathSegTypeAsLetter is "M"
PASS path.animatedPathSegList.getItem(0).x is -30
PASS path.animatedPathSegList.getItem(0).y is -30
PASS path.animatedPathSegList.getItem(1).pathSegTypeAsLetter is "q"
PASS path.animatedPathSegList.getItem(1).x is 30
PASS path.animatedPathSegList.getItem(1).y is 30
PASS path.animatedPathSegList.getItem(1).x1 is 30
PASS path.animatedPathSegList.getItem(1).y1 is 0
PASS path.animatedPathSegList.getItem(2).pathSegTypeAsLetter is "t"
PASS path.animatedPathSegList.getItem(2).x is -30
PASS path.animatedPathSegList.getItem(2).y is 30
PASS path.animatedPathSegList.getItem(3).pathSegTypeAsLetter is "Z"
PASS path.pathSegList.numberOfItems is 4
PASS path.pathSegList.getItem(0).pathSegTypeAsLetter is "M"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(0).x is -30
PASS path.pathSegList.getItem(0).y is -30
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 "q"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(1).x is 30
PASS path.pathSegList.getItem(1).y is 30
PASS path.pathSegList.getItem(1).x1 is 30
PASS path.pathSegList.getItem(1).y1 is 0
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(2).pathSegTypeAsLetter is "t"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS path.pathSegList.getItem(2).x is -30
PASS path.pathSegList.getItem(2).y is 30
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(3).pathSegTypeAsLetter is "Z"
2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 Added tests to check the correct behavior on path animations, where the coordinate modes of the start path differs from the one on the end path. * svg/animations/animate-path-animation-Cc-Ss-expected.txt: Added. * svg/animations/animate-path-animation-Cc-Ss.html: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh-expected.txt: Added. * svg/animations/animate-path-animation-Ll-Vv-Hh.html: Added. * svg/animations/animate-path-animation-Qq-Tt-expected.txt: Added. * svg/animations/animate-path-animation-Qq-Tt.html: Added. * svg/animations/animate-path-animation-cC-sS-inverse-expected.txt: Added. * svg/animations/animate-path-animation-cC-sS-inverse.html: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse-expected.txt: Added. * svg/animations/animate-path-animation-lL-vV-hH-inverse.html: Added. * svg/animations/animate-path-animation-qQ-tT-inverse-expected.txt: Added. * svg/animations/animate-path-animation-qQ-tT-inverse.html: Added. * svg/animations/animate-path-nested-transforms.html: Cleanup. * svg/animations/animate-text-nested-transforms.html: Cleanup. * svg/animations/resources/SVGAnimationTestCase.js: (shouldBeCloseEnough): For debug output of values with tolerance level. (startTest): (sampleAnimation): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: Added. (sample1): (sample2): (sample3): (sample4): (executeTest): 2011-01-27 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVG animation of Paths with segments of different coordinate modes on begin and end https://bugs.webkit.org/show_bug.cgi?id=52984 At the moment we just support SVG path animations, if the number of segments on the given start path is the same as the number of segments on the given end path. But a segment on a given position must be identical on both paths as well. Not only the segment type, also the coordinate mode of the segments must be identical. If MoveToRel is on the second position on the start path a MoveToRel must be on the second position of the end path too. According to the SVG spec, at least the coordinate mode can differ. Means, if we have MoveToRel in the start path, we can use MoveToAbs on the same position in the end path. This patch fixes the blending code to follow the spec here. It was necessary to track the current position of both paths, transform coordinates to the same coordinate mode and transform the resulting animation coordinate back to the coordinate mode of either the start or the end path. Which mode is taken depends on the progress of the animation. Tests: svg/animations/animate-path-animation-Cc-Ss.html svg/animations/animate-path-animation-Ll-Vv-Hh.html svg/animations/animate-path-animation-Qq-Tt.html svg/animations/animate-path-animation-cC-sS-inverse.html svg/animations/animate-path-animation-lL-vV-hH-inverse.html svg/animations/animate-path-animation-qQ-tT-inverse.html * svg/SVGPathBlender.cpp: (WebCore::blendFloatPoint): (WebCore::blendAnimatedFloat): (WebCore::SVGPathBlender::blendAnimatedDimensionalFloat): (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::coordinateModeOfCommand): (WebCore::isSegmentEqual): (WebCore::SVGPathBlender::blendAnimatedPath): (WebCore::SVGPathBlender::cleanup): * svg/SVGPathBlender.h: Canonical link: https://commits.webkit.org/67047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-01-27 21:03:14 +00:00
PASS successfullyParsed is true
TEST COMPLETE