Retrieving Unknown CSS Rules

C

Christoph

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
 
M

Martin Honnen

Christoph said:
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".
 
P

pantagruel

Martin said:
Christoph said:
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/www-style/2003Oct/0347.html


Which just gives me that "W3 sucks" feeling.
 
C

Christoph

Since I want to test conceived extensions to CSS in practice, I love
the UnknownRule interface.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
EmeliaBryc

Latest Threads

Top