Retrieving Unknown CSS Rules

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christoph

    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.styleS heets[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

  • Christoph

    #2
    Re: Retrieving Unknown CSS Rules

    In KHTML it is document.styleS heets[0].cssRules[0].style.cssText

    Comment

    • Martin Honnen

      #3
      Re: Retrieving Unknown CSS Rules


      Christoph wrote:
      [color=blue]
      > In KHTML it is document.styleS heets[0].cssRules[0].style.cssText[/color]

      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

      Comment

      • pantagruel

        #4
        Re: Retrieving Unknown CSS Rules


        Martin Honnen wrote:[color=blue]
        > Christoph wrote:
        >[color=green]
        > > In KHTML it is document.styleS heets[0].cssRules[0].style.cssText[/color]
        >
        > 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" .
        >
        > --
        >[/color]
        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




        Which just gives me that "W3 sucks" feeling.

        Comment

        • Christoph

          #5
          Re: Retrieving Unknown CSS Rules

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

          Comment

          • Christoph

            #6
            Re: Retrieving Unknown CSS Rules

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

            Comment

            Working...