[whatwg] Style sheet objects (was Re: HTML5 is now also hosted by the W3C)

L. David Baron dbaron at dbaron.org
Thu May 10 10:35:56 PDT 2007


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-0001.pgp>


More information about the whatwg mailing list