nsSMILCSSProperty::IsPropertyAnimatable returns false for eCSSProperty_width/height.
Is this on purpose? If so, why? At the very least, it would be good to document the code.
Note that getComputedStyle doesn't actually return computed style for these properties, so maybe that's the issue?
width and height amongst others are attributes only in SVG and are not mapped to style. You can animate the attributes directly though.
Yes, but shouldn't you be able to animate the CSS properties anyway? In particular, this is useful when applying SMIL animations to non-SVG elements.
SVG divides things into regular and presentation attributes: http://www.w3.org/TR/SVG/attindex.html#RegularAttributes
presentataion map to style/css, regular don't, although the SVG specification describes presentation attributes as CSS styles that you can specify as attributes which comes to the same thing.
SVG regular attributes are complicated things with a baseVal and an animVal that html doesn't have.
Yes, I'm well aware of that. I'm talking about the particular case of attributeType="CSS" in the SMIL.
You mean when animating html where width and height are styles. If so then yes we should be able to do that with attributeType="CSS" even though that should not work to animate SVG elements that have width and height as there they are only regular attributes.
Right. I'm just saying that when attributeType="CSS" we should change the computed value of "width" and "height", period. It just happens that SVG elements ignore that computed value, as I understand, so won't be affected by it. Sound about right?
(In reply to Boris Zbarsky (:bz) from comment #6)
> Right. I'm just saying that when attributeType="CSS" we should change the
> computed value of "width" and "height", period. It just happens that SVG
> elements ignore that computed value, as I understand, so won't be affected
> by it. Sound about right?
Actually we do map 'width' and 'height' into style for outer-<svg>, but only if those attributes are explicitly set. Anyway, regardless, on outer-<svg>, the CSS properties count. Seems like IsPropertyAnimatable() is currently too simplistic an interface to account for that though.
bug 764851 fixes this.