Confirmed users
490
edits
| Line 16: | Line 16: | ||
=== 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 | 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. | |||
* 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] ) | |||
* 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. | |||
* See [http://hg.mozilla.org/users/dholbert_mozilla.com/smil-patches/file/tip/getoverridestyle.patch patch] for more details (it's fairly small) | |||