Re: Animating SVG attributes from Web Animations

On Mon, Jun 22, 2015 at 12:10 AM, Shane Stephens <shans@google.com> wrote:
> On Wed, Jun 17, 2015 at 6:53 AM Amelia Bellamy-Royds
> <amelia.bellamy.royds@gmail.com> wrote:
>> Although the SVG WG agreed to neuter `attributeType` for SMIL animations
>> (so that the animation always applies to a style property if one exists by
>> that name), we really did not think through the complications that arise
>> when the style and attribute have different syntax or applications (e.g.,
>> transform or  font-size without units, or when an attribute has an effect on
>> a given element but a style property isn't, but that style property exists
>> for other elements (various elements are currently excluded from the new SVG
>> layout properties, such as text and gradients).
>>
>> Until we clean up all those complications, I'm not sure about adopting the
>> same approach for automatic-resolution of property names in Web Animations.
>> (And the SVG WG has put work on animations aside for now, so we will likely
>> synchronize with Web Animations rather than expecting you to do the
>> reverse.)
>
> That's interesting. We'll work through the implications of automatic
> promotion in a Web Animations meeting to see if we think there are going to
> be problems.

Hm, I don't actually see what the problem is.  If you're animating
'fill', you use the fill property's syntax.  If you're animating
'svgFill', you use the fill attribute's syntax.  If those don't
match... that seems fine?  What's the issue?

> Either way, the same cascade questions apply. Dirk's suggestion of
> restricting an animation to one or the other doesn't make any problems go
> away - it just makes the Web Animations API less expressive. Having said
> that, it'll still achieve my original goal of allowing promotion to happen
> unimpeded so I won't be too upset if we end up taking that approach.

I'd be rather upset.  There's no reason to disconnect the two, as long
as it's clear what is being animated.  It's just siloing, and that's
annoying.

> My current inclination is:
> (1) adopt the 'svg' prefix (or if there are reasons that it won't work, fall
> back to Dirk's suggestion).
> (2) maintain the cascade - it's not perfect, but it works and it's baked in
> at this point. This means that, yes, if you have an attribute animation and
> you specify a CSS property then the property will win.
> (3) gently nudge everyone towards a future world in which everything gets
> resolved at the CSS level. This should mitigate (2) in the long run.

Strongly agree with these three.

~TJ

Received on Monday, 22 June 2015 18:46:43 UTC