469,271 Members | 1,718 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Retrieving Unknown CSS Rules

For retrieving CSS rules that can not be interpreted by an layout
engine I can use the UnknownRule interface of DOM. Unfortunately in
Gecko (Firefox 1.0.5), I cannot access such rules using
document.styleSheets[0].cssRules because only "known rules" are
referenced. Is there another way to get the UnkownRule(s) in Gecko?

I tried KHTML (Konqueror 3.4), which references all CSS rules including
UnknownRules. Unfortunately, I cannot get the text of the rules. While
Gecko implements cssTextdocument.styleSheets[0].cssRules[0].cssText,
Konqueror does not. Is there a way to access the text of the rule in
KHTML?

Thanks,
Christoph

Aug 23 '05 #1
5 1591
In KHTML it is document.styleSheets[0].cssRules[0].style.cssText

Aug 23 '05 #2

Christoph wrote:
In KHTML it is document.styleSheets[0].cssRules[0].style.cssText


cssText is supposed to be "The parsable textual representation of the
rule". What kind of rule do you have exactly that you want to access
using the DOM? If Mozilla can't parse your rule it will hardly give you
any "parsable textual representation".

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 23 '05 #3

Martin Honnen wrote:
Christoph wrote:
In KHTML it is document.styleSheets[0].cssRules[0].style.cssText


cssText is supposed to be "The parsable textual representation of the
rule". What kind of rule do you have exactly that you want to access
using the DOM? If Mozilla can't parse your rule it will hardly give you
any "parsable textual representation".

--

Okay well the 'parsable textual representation of the rule' thing is
pretty irritating. In practice it seems to mean that the browser knows
best what you want to do with your application. Another example of this
browser nannyism would be returning RGB(0,0,255) for style.color when
color:blue.

According to the CSS spec implementors should ignore not understood
properties.
I believe the W3 dropped UnknownRule

http://lists.w3.org/Archives/Public/...3Oct/0347.html
Which just gives me that "W3 sucks" feeling.

Aug 26 '05 #4
Thanks, according to http://www.quirksmode.org/dom/w3c_css.html it
depends on the browser. (My rule is parsable)

Aug 29 '05 #5
Since I want to test conceived extensions to CSS in practice, I love
the UnknownRule interface.

Aug 29 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Marcus | last post: by
2 posts views Thread by Rob Cowie | last post: by
reply views Thread by Jason | last post: by
4 posts views Thread by John Dann | last post: by
11 posts views Thread by jarod1701 | last post: by
7 posts views Thread by Larry Bud | last post: by
23 posts views Thread by Himanshu Chauhan | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.