- From: L. David Baron <dbaron@dbaron.org>
- Date: Thu, 10 May 2007 10:35:56 -0700
On Thursday 2007-05-10 11:08 +0200, Kristof Zelechovski wrote:
> Internet Explorer uses style sheet objects instead; the code would be
> similar to
>
> document.styleSheets[0].addRule(".TBW", "border-color: red")
>
> While it is nonstandard, it would be a good candidate for standardizing
It's already standardized (and implemented at least in Mozilla, for
many years now); see:
http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-DocumentStyle
http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet
except that there's no addRule method (there's instead insertRule,
although appendRule would be nice), and insertRule takes the rule as
a single string, not a separate selector and declaration.
-David
--
L. David Baron <URL: http://dbaron.org/ >
Technical Lead, Layout & CSS, Mozilla Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20070510/2c490625/attachment.pgp>
Received on Thursday, 10 May 2007 10:35:56 UTC