nsIDOMCSSStyleSheet.getCssRules()

gecko <[email protected]> Fri, 24 Apr 2009 06:59:49 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.java
Organization http://groups.google.com
Message-ID <d42fd471-6b09-4179-9dff-684a32b7d58d@o14g2000vbo.googlegroups.com>
Hello,

I try to call the methode getCssRules() but it keeps returning an
error.

I call it using queryInterface over every item in
nsIDOMStyleSheetList; here is the code :

        for (int i = 0; i < getStyleSheets().getLength(); i++) {

                                        nsIDOMStyleSheet domStyleSheet
= documentStyle
                                                        .getStyleSheets
().item(i);

                                         nsIDOMCSSStyleSheet
cssStyleSheet = null;

                                         try {
                                                   cssStyleSheet =
(nsIDOMCSSStyleSheet)
documentStyle.getStyleSheets()
                                                                            .item
(i)
                                                                            .queryInterface
(

nsIDOMCSSStyleSheet.NS_IDOMCSSSTYLESHEET_IID);

                                         } catch (XPCOMException e) {}

                                        System.out.println
("CSSStyleSheet : "
                                        + cssStyleSheet.getCssRules
().item(i));

                                }
          }

but it keeps returning the following error :

The function "cssRules" returned an error condition  (0x805303e8)
 at org.mozilla.xpcom.internal.XPCOMJavaProxy.callXPCOMMethod(Native
Method)

is this the right way to do it or am I missing something?