Bug 158212 - Cannot animate 'r' property of SVG using CSS
Summary: Cannot animate 'r' property of SVG using CSS
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari 9
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-30 12:20 PDT by Mike Lawther
Modified: 2016-10-05 18:30 PDT (History)
3 users (show)

See Also:


Attachments
Test for animating 'r' using CSS (405 bytes, image/svg+xml)
2016-05-30 12:20 PDT, Mike Lawther
no flags Details
Test for animating 'r' using SMIL (320 bytes, image/svg+xml)
2016-05-31 11:16 PDT, Said Abou-Hallawa
no flags Details
Test demonstrating that animating 'width' and 'height' using CSS does work (445 bytes, image/svg+xml)
2016-06-23 00:00 PDT, Mike Lawther
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Lawther 2016-05-30 12:20:15 PDT
Created attachment 280107 [details]
Test for animating 'r' using CSS

Tested using Webkit Nightly (9.1.1 (11601.6.17, r201498)) on OSX 10.11.5

The 'r' attribute of an SVG circle cannot be animated using CSS (see attached test). The attached test does work as expected in Chrome (tested using 52.0.2743.10 dev (64-bit)). 

With reference to https://bugs.webkit.org/show_bug.cgi?id=135978, I expected this to work.

fwiw, 'cx' and 'cy' cannot be animated with CSS either.
Comment 1 Said Abou-Hallawa 2016-05-31 11:16:58 PDT
Created attachment 280158 [details]
Test for animating 'r' using SMIL
Comment 2 Said Abou-Hallawa 2016-05-31 11:17:46 PDT
I think Chrome 45 deprecated SMIL in favor of CSS animations and Web animations. So I am not sure if WebKit has to do the same or it has to support both. The attached test case uses SMIL and it animates in WebKit and Gecko. Gecko does not animate the SVG with CSS animation.
Comment 3 Mike Lawther 2016-05-31 11:37:20 PDT
SMIL is an alternative to workaround this in Webkit, but it is also not compatible across browsers (eg IE/Edge do not support SMIL).

Gecko should support animating SVG with CSS, but there was a regression (https://bugzilla.mozilla.org/show_bug.cgi?id=908634).
Comment 4 Mike Lawther 2016-06-23 00:00:02 PDT
Created attachment 281900 [details]
Test demonstrating that animating 'width' and 'height' using CSS does work

I'll try another example. Attached is a similar test showing that WebKit does correctly animate the 'width' and 'height' properties of an SVG rect using CSS.

Animating 'r', 'cx, 'cy' etc using CSS is supposed to work. It's a (probably trivial) WebKit bug that they don't.
Comment 5 Dirk Schulze 2016-10-05 18:30:05 PDT
Animating those properties does work. Keep in mind that the properties REQUIRE length units just like with and height. Add a px at the end and they start animating.