Created attachment 451655 [details] SVG SMIL restart.svg test case The attached restart.svg test case shows three rectangles with SMIL animations and the restart attribute set to different values: "never", "always" and "whenNotActive". The green rectangles (restart="always" and restart="whenNotActive") behave correctly. However, the blue rectangle with restart="never" does not behave correctly on Safari. Steps to reproduce: 1. Open restart.svg 2. Click the blue rectangle. 3. Wait until the blue rectangle has moved up for a second and jumps back to its original position. 4. Click the blue rectangle again. The blue rectangle should not move again, but Safari moves it again. Safari behavior for restart="never" seems to match restart="whenNotActive". Expected result: The blue rectangle is moved only once for the first click. Subsequent clicks don't animate the blue rectangle. Firefox and Chrome show the expected result. Tested on Safari Version 15.3 (16612.4.9.1.7, 16612) and Safari Technology Preview Release 139 (Safari 15.4, WebKit 16613.1.14.41.2). Here's the relevant specification: https://svgwg.org/specs/animations/#RestartAttribute
It looks like "never" and "whenNotActive" behave the same.
The "restart" value is not checked when we compute a new interval in SVGSMILElement::beginListChanged().
Created attachment 451888 [details] Patch
Comment on attachment 451888 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451888&action=review > Source/WebCore/ChangeLog:8 > + Test: svg/animations/restart-never-and-begin-click.html WPT?
Created attachment 452164 [details] Patch for landing
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/32856
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Thank you for fixing this so fast! I noticed that restart-never-and-begin-click.html in the Patch (attachment 451888 [details]) says: "Setting restart='always' prevents animation with begin='click' from restarting". Shouldn't it say "Setting restart='never' "?
(In reply to kari.pihkala from comment #8) > Thank you for fixing this so fast! You're welcome. Thanks for filing the bug! > I noticed that restart-never-and-begin-click.html in the Patch (attachment > 451888 [details]) says: "Setting restart='always' prevents animation with > begin='click' from restarting". Shouldn't it say "Setting restart='never' "? Oh, indeed! I will fix this when I finally commit the change.
Created attachment 452202 [details] Patch for landing
Committed r290010 (247396@trunk): <https://commits.webkit.org/247396@trunk>
<rdar://problem/89080968>