SMIL:CSS Animation: Difference between revisions

Line 17: Line 17:
=== Implementing <code>getOverrideStyle()</code> ===
=== Implementing <code>getOverrideStyle()</code> ===
Note that Gecko doesn't currently implement <code>getOverrideStyle()</code>.  Here's a basic outline of how this function could be implemented (& is implemeted in the patch linked above):
Note that Gecko doesn't currently implement <code>getOverrideStyle()</code>.  Here's a basic outline of how this function could be implemented (& is implemeted in the patch linked above):
* Add a new <code>nsDOMCSSDeclaration</code> member variable on each <code>nsStyledElement</code>, to be used as a backing store for that element's override style.
* Add a new <code>nsRefPtr<nsDOMCSSDeclaration> mOverrideStyle</code> member variable on each <code>nsStyledElement</code>, to be used as a backing store for that element's override style.
* Internally, this can behave much like SVG's content style rule.  (See mContentStyleRule in [http://mxr.mozilla.org/seamonkey/source/content/svg/content/src/nsSVGElement.h nsSVGElement.h] and [http://mxr.mozilla.org/seamonkey/source/content/svg/content/src/nsSVGElement.cpp nsSVGElement.cpp] )
* I've based the implementation of this largely on the content style rule in SVG.  (See <code>mContentStyleRule</code> in [http://mxr.mozilla.org/seamonkey/source/content/svg/content/src/nsSVGElement.h nsSVGElement.h] and [http://mxr.mozilla.org/seamonkey/source/content/svg/content/src/nsSVGElement.cpp nsSVGElement.cpp] )
* The 'override style' is queryable (& editable) via a new method <code>nsIContent::GetOverrideStyle</code>.  By default, this has an empty implementation, but nsStyledElement overrides this method to return its private nsDOMCSSDeclaration.
* The override style is queryable (& editable) via a new method <code>nsIContent::GetOverrideStyle</code>.  By default, this method has an empty implementation, but <code>nsStyledElement</code> overrides this method to return its <code>mOverrideStyle</code>.
* See [http://hg.mozilla.org/users/dholbert_mozilla.com/smil-patches/file/tip/getoverridestyle.patch patch] for more details (it's fairly small)
* See [http://hg.mozilla.org/users/dholbert_mozilla.com/smil-patches/file/tip/getoverridestyle.patch patch] for more details (it's fairly small)
Confirmed users
490

edits