Re: Animating SVG with CSS

Tab Atkins Jr.:

>
> All CSS properties can be animated with CSS Animations or Transitions.
> This isn't something controllable by the host language, it's a
> property of CSS.  (They can also be animated by Web Animations, as
> they animate CSS as well.)
>

SVG 1.x has a chapter, that defines, which features/properties are shared in
which way with CSS. Because this predates any CSS animation draft,
such a draft is not applicable...

...
>
> Yes, many more SVG attributes are migrating into properties, which
> means CSS Animations will work more widely; you'll be able to animate,
> for example, the x/y coordinates of shapes.
>

As already discussed, this creates (minor) trouble, if there are authors
using CSS decoration both for (X)HTML and SVG content
with not very specific selectors.
Because CSS properties like x, y, width and height are not applicable
for SVG 1.x content, there is no need for specific selectors.
If viewer nevertheless overwrite such attributes with CSS property settings,
obviously this will cause nonsense for SVG 1.x content.
But of course, I do not know, if there are many SVG authors at all, using
CSS (beyond the abuse of the style attribute, that has a high priority anyway) 
at all. I do, but typically my selectors are more specific, because I know 
about the large bug and backwards incompatibility probability of typical 
implementations ;o)


 L2L 2L:

>SMIL is dead.... I'm truly waiting on web animation api... 
>So I might just go to canvas. 

Well, CSS and Java/ECMA-script is for decoration only,
it does not matter for content, for this it is not really an
alternative.

The HTML5 draft notes about canvas:
"Authors should not use the canvas element in a document when a more suitable 
element is available."
And
"When authors use the canvas element, they must also provide content that, 
when presented to the user, conveys essentially the same function or purpose 
as the canvas' bitmap."
Sometimes the HTML5 draft is better than one might assume ;o)

For content obviously there are always more suitable structures available and
even for decoration typically SVG or server side generated raster images will 
do the job. Decorative games (without providing relevant information at 
all) - no problem with SVG+Java/ECMA-script.


Olaf

Received on Thursday, 18 September 2014 09:15:36 UTC