CSS Transitions: Difference between revisions

Jump to navigation Jump to search
Line 79: Line 79:
** This essentially requires us to convert the nsCSSValue back to a string and call nsICSSDeclaration->SetPropertyValue(propId, string), which then re-parses the string into a nsCSSValue, etc...
** This essentially requires us to convert the nsCSSValue back to a string and call nsICSSDeclaration->SetPropertyValue(propId, string), which then re-parses the string into a nsCSSValue, etc...


On the other hand, for CSS Transitions, the animation is only initiated if the computed style of an element changes and the animation is between the previous computed style and the new computed style.  So if I was to use the existing SMIL/CSS framework to do the animation, I would need some general way to convert an arbitrary property's computed style value into a string (or we could add new API that would allow me to bypass the string portion and just convert directly from computed style to nsCSSValue/nsSMILValue)
On the other hand, for CSS Transitions, the animation is only initiated if the computed style of an element changes.  In this case, the animation is between the previous computed style and the new computed style.  So if we were going to use the existing SMIL/CSS framework to do the animation (and I do have a prototype which does this), I would need some general way to convert an arbitrary property's computed style value into a string (or we could add new API that would allow me to bypass the string portion and just convert directly from computed style to nsCSSValue/nsSMILValue, in which case we would need a general way to convert from a computed style to a nsCSSValue), and then we would follow the same code flow as described above.
* However, even if such a general facility existed to convert from computed style back into an nsCSSValue, it seems like we would be doing quite a bit of extra work parsing, reparsing, converting, etc.
* However, even if such a general facility existed to convert from computed style back into an nsCSSValue, it seems like we would be doing quite a bit of extra work parsing, reparsing, converting, etc.
* in the CSS transition case, it would be nice if we could interpolate the computed styles directly and then somehow set that computed style more directly rather than going through all of the intermediate parsing / conversion
* in the CSS transition case, it would be nice if we could interpolate the computed styles directly and then somehow set that computed style more directly rather than going through all of the intermediate parsing / conversion
14

edits

Navigation menu