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

Attachment: pgplDMpa2iv1v.pgp
Description: PGP signature

Reply via email to