Mozilla Blues II

I blogged about Mozilla and custom CSS properties a few weeks ago, and I found that I am not completely correct. Custom CSS properties can be retrieved in Mozilla…. just not easily. After toying around with it (and thanks to the DOM Inspector) I have come up with a way to retrieve Custom CSS in Mozilla.

The bad news, however, is that it is far more work than I’m willing to put into the little project. It is also very restrictive. Here is the general process:

Custom CSS properties must be in a style tag in the HTML document; they cannot be in an external stylesheet. This style tag can, for ease of use, have an id attribute to retrieve the node using the getElementById() method. The node has one child, a text node, with consists of the entire text in the style tag. So now you have to parse through all this text (regexps), find the custom CSS properties, and then you can use the value of the property. Oh yeah, in order for it to be of any use, you have to associate the CSS property with the appropriate selector. I realize some people would eat this up and love to do it. I, on the other hand, have better things to do with my time on the computer (Desert Combat and UT2004, mmm’kay) so I won’t be tackling this anytime soon (if ever).

I spent some time talking with Foo this morning, and I’ve come to the conclusion to use XML for specific DHTML settings. While it isn’t the best thing I can think of, at least I can retrieve everything using the DOM.

<sarcasm>Thanks, Mozilla. You sure did make a wonderful rendering engine. </sarcasm>

Screw XUL. Gimme more power through the DOM.
6/17/2004 12:00:00 AM | Tags:
© 2008 Jeremy McPeak