haikuwebkit/LayoutTests/svg/animations/animateTransform-accumulati...

13 lines
506 B
XML
Raw Permalink Normal View History

Fix repetitions & by animation support for SVGAnimateTransformElement https://bugs.webkit.org/show_bug.cgi?id=85051 Reviewed by Antti Koivisto. Source/WebCore: Repetitions are currently handled by adjusting percentage (percentage += repeatCount). This doesn't work for <animateTransform> as each repetition has to be post-multiplied to the animated transform list. Fix that. By-animations are equal to values="0;by" animations in SMIL. '0' is the neutral element of addition, which is the _zero_ matrix, not the identity matrix for SVGTransform. Add a new construction mode to SVGTransform to be able to construct zero transforms. Tests: svg/animations/animateTransform-accumulation-expected.svg svg/animations/animateTransform-accumulation.svg svg/animations/animateTransform-by-scale-expected.svg svg/animations/animateTransform-by-scale.svg svg/animations/animateTransform-from-by-from-to-comparision-expected.svg svg/animations/animateTransform-from-by-from-to-comparision.svg svg/animations/animateTransform-from-by-scale-additive-sum-expected.svg svg/animations/animateTransform-from-by-scale-additive-sum.svg svg/animations/animateTransform-from-by-scale-expected.svg svg/animations/animateTransform-from-by-scale.svg svg/animations/animateTransform-rotate-around-point-expected.svg svg/animations/animateTransform-rotate-around-point.svg svg/animations/animateTransform-skewX-expected.svg svg/animations/animateTransform-skewX.svg svg/animations/animateTransform-skewY-expected.svg svg/animations/animateTransform-skewY.svg svg/animations/animateTransform-translate-expected.svg svg/animations/animateTransform-translate.svg svg/animations/multiple-animateTransform-additive-sum-expected.svg svg/animations/multiple-animateTransform-additive-sum.svg * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimatedTransformList.cpp: (WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes): (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue): * svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::adjustFromToListValues): * svg/SVGTransform.cpp: (WebCore::SVGTransform::SVGTransform): * svg/SVGTransform.h: * svg/SVGTransformDistance.cpp: (WebCore::SVGTransformDistance::SVGTransformDistance): (WebCore::SVGTransformDistance::scaledDistance): (WebCore::SVGTransformDistance::addSVGTransforms): (WebCore::SVGTransformDistance::addToSVGTransform): (WebCore::SVGTransformDistance::distance): * svg/SVGTransformDistance.h: (SVGTransformDistance): LayoutTests: Enable <animateTransform> test in additive-type-by-animation, which was disabled as it triggered assertions before this patch. Add lots of new <animateTransform> covering additive/accumulative animations using reftests, for all animateTransform types (translate/rotate/skewX/skewY/scale). * svg/animations/additive-type-by-animation-expected.txt: * svg/animations/animateTransform-accumulation-expected.svg: Added. * svg/animations/animateTransform-accumulation.svg: Added. * svg/animations/animateTransform-by-scale-expected.svg: Added. * svg/animations/animateTransform-by-scale.svg: Added. * svg/animations/animateTransform-from-by-from-to-comparision-expected.svg: Added. * svg/animations/animateTransform-from-by-from-to-comparision.svg: Added. * svg/animations/animateTransform-from-by-scale-additive-sum-expected.svg: Added. * svg/animations/animateTransform-from-by-scale-additive-sum.svg: Added. * svg/animations/animateTransform-from-by-scale-expected.svg: Added. * svg/animations/animateTransform-from-by-scale.svg: Added. * svg/animations/animateTransform-rotate-around-point-expected.svg: Added. * svg/animations/animateTransform-rotate-around-point.svg: Added. * svg/animations/animateTransform-skewX-expected.svg: Added. * svg/animations/animateTransform-skewX.svg: Added. * svg/animations/animateTransform-skewY-expected.svg: Added. * svg/animations/animateTransform-skewY.svg: Added. * svg/animations/animateTransform-translate-expected.svg: Added. * svg/animations/animateTransform-translate.svg: Added. * svg/animations/multiple-animateTransform-additive-sum-expected.svg: Added. * svg/animations/multiple-animateTransform-additive-sum.svg: Added. * svg/animations/resources/additive-type-by-animation.svg: * svg/animations/script-tests/additive-type-by-animation.js: (checkBaseVal): (sample1): (sample2): (sample3): * svg/animations/script-tests/svgtransform-animation-1.js: (sample1): (sample2): (sample3): (sample4): (sample5): (sample6): (sample7): (executeTest): * svg/animations/script-tests/svgtransform-animation-discrete.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/svgtransform-animation-1-expected.txt: * svg/animations/svgtransform-animation-discrete-expected.txt: Canonical link: https://commits.webkit.org/102562@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-27 14:10:59 +00:00
<?xml version="1.0"?>
<svg viewBox="0 0 500 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<path id="fromto" d="M-25,0C120,-40 -80,-60 20,25zM20 10q-10 -10 2 -10"/>
</defs>
<rect x="0" y="0" width="500" height="300" fill="#fff" />
<g fill="none" stroke-width="10">
<use xlink:href="#fromto" stroke="#800" x="40" y="50" transform="translate(90 120)"/>
<use xlink:href="#fromto" stroke="#88f" x="40" y="50" transform="translate(90 120)"/>
</g>
</svg>