On 12/7/09 9:15 AM, martin wrote:
it doesn't pass the 'if (rules)' condition and I wasn't able to find out what's wrong.
You're calling this from C++, and presumably without JS on the stack, and therefore end up failing the security check GetCSSRules does. Had you checked the return value you would have known at least that you were failing a security check...
You may be able to work around this by pushing the document's JSContext on the JS context stack, though if that context can be running script in your situation and if that script is not same-origin with the stylesheet (or heck, if the document is not same-origin with the stylesheet) you won't get the rules.
If this is Gecko 1.9.2 or later, you can probably use pushContextPrincipal on the security manager to push a new jscontext and the stylesheet's principal; that would guarantee things to work.
-Boris _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
