Last Comment Bug 688430 - "width" and "height" are not animatable as CSS properties
: "width" and "height" are not animatable as CSS properties
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: SVG (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on: 764851
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-22 06:12 PDT by Boris Zbarsky [:bz] (Out June 25-July 6)
Modified: 2012-06-16 21:04 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Boris Zbarsky [:bz] (Out June 25-July 6) 2011-09-22 06:12:36 PDT
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?
Comment 1 Robert Longson 2011-09-22 06:22:15 PDT
width and height amongst others are attributes only in SVG and are not mapped to style. You can animate the attributes directly though.
Comment 2 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-09-22 06:35:13 PDT
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.
Comment 3 Robert Longson 2011-09-22 07:18:54 PDT
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.
Comment 4 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-09-22 07:36:07 PDT
Yes, I'm well aware of that.  I'm talking about the particular case of attributeType="CSS" in the SMIL.
Comment 5 Robert Longson 2011-09-22 08:22:42 PDT
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.
Comment 6 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-09-22 08:36:14 PDT
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?
Comment 7 Robert Longson 2011-09-22 08:44:30 PDT
(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?

Absolutely.
Comment 8 Jonathan Watt [:jwatt] (Away Jun. 27 - Jul. 13) 2012-02-01 08:16:59 PST
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.
Comment 9 Robert Longson 2012-06-16 13:48:05 PDT
bug 764851 fixes this.

Note You need to log in before you can comment on or make changes to this bug.