Re: CSS Animations Targeting SVG attributes

On Tue, Mar 15, 2011 at 7:47 AM, Dean Jackson <> wrote:

> It seems that the SVG WG would like to propose option 3 to the FX TF.
> I don't think this is a great solution, for two reasons:

Personally I don't think there are any "great" solutions. They all involve

1. You lose the ability to do transitions with style changes. Instead you
> have to run some script to update the DOM. In most cases I believe we should
> be encouraging authors to take a state-based approach via CSS when building
> documents. In other words, always try to represent changes in the document
> via a single change to a CSS class on an ancestor element. This is
> conceptually similar to what :hover does. Breaking this and requiring script
> for all updates seems brutal.

What Cameron said --- authors can introduce a CSS animation to do this.

2. It requires we change CSS parsing rules to allow attr(x) on the left side
> of a rule. While this is only inside @keyframes, I expect all
> implementations share the code here with the rest of their CSS parser.

Yes, but you can just reject attr(x) properties outside a @keyframes
context. Only @keyframes needs to support property storage for attr(x). This
may be helpful.

Could we investigate option 2 a little more?

It seems that any version of option 2 is going to require a large number of
new CSS properties, most of which will only apply to a small number of
specific SVG elements. They will all have to participate in the cascade, in
getComputedStyle, in CSSStyleDeclaration, etc. That seems like a significant
downside to me.

"Now the Bereans were of more noble character than the Thessalonians, for
they received the message with great eagerness and examined the Scriptures
every day to see if what Paul said was true." [Acts 17:11]

Received on Monday, 14 March 2011 20:48:55 UTC