haikuwebkit/LayoutTests/svg/animations/animated-length-mutiple-ani...

23 lines
598 B
XML
Raw Permalink Normal View History

An SVG animated property animator can stop animation while other animators are still running https://bugs.webkit.org/show_bug.cgi?id=207417 <rdar://problem/59278306> Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-05-26 Reviewed by Simon Fraser. Source/WebCore: An SVG animated property can be animated by multiple animators. When one animator stops the animation, the animVal should not be deleted since it will be used by other animators. SVGAnimatedProperty will maintain a WeakHashSet<SVGAttributeAnimator> in which the animator will be added when the animation starts and will be removed when the the animation stops. When all the animators stops their animations, the animated property may delete the animVal or keep it if it can be referenced by JavaScript. Tests: svg/animations/animated-enum-mutiple-animators.svg svg/animations/animated-length-mutiple-animators.svg * svg/properties/SVGAnimatedDecoratedProperty.h: * svg/properties/SVGAnimatedPrimitiveProperty.h: * svg/properties/SVGAnimatedProperty.h: (WebCore::SVGAnimatedProperty::isAnimating const): (WebCore::SVGAnimatedProperty::startAnimation): (WebCore::SVGAnimatedProperty::stopAnimation): (WebCore::SVGAnimatedProperty::instanceStartAnimation): (WebCore::SVGAnimatedProperty::instanceStopAnimation): * svg/properties/SVGAnimatedPropertyAnimator.h: * svg/properties/SVGAnimatedPropertyList.h: * svg/properties/SVGAnimatedValueProperty.h: * svg/properties/SVGAttributeAnimator.h: LayoutTests: * svg/animations/animated-enum-mutiple-animators-expected.txt: Added. * svg/animations/animated-enum-mutiple-animators.svg: Added. * svg/animations/animated-length-mutiple-animators-expected.txt: Added. * svg/animations/animated-length-mutiple-animators.svg: Added. Canonical link: https://commits.webkit.org/225235@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-27 04:01:19 +00:00
<svg xmlns="http://www.w3.org/2000/svg">
<rect>
<animate attributeName="x"/>
<set attributeName="x" max="50ms" onend="onEnd()"/>
<set attributeName="x"/>
</rect>
<text x="10" y="20">Passes if it does not crash.</text>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function onEnd() {
if (window.testRunner) {
setTimeout(() => {
testRunner.notifyDone();
});
}
}
</script>
</svg>