Hi,

I am trying to use GetCSSStyleRules() of inDOMUtils to find all the
style rule of an element


nsIDOMElement* aElement; // points to an element in the DOM

 inDOMUtils domUtils;
   nsCOMPtr<nsISupportsArray> rules;
   domUtils.GetCSSStyleRules(aElement, getter_AddRefs(rules));

But in some cases, my program crashes with the following segmentation
fault:
(gdb) bt
#0  0xb41bd463 in ns_if_addref<nsIStyleRule*> (expr=0xdddddddd)
    at ../../dist/include/xpcom/nsISupportsUtils.h:114
#1  0xb41bca8d in nsInspectorCSSUtils::GetRuleNodeRule
(this=0xa4419c8,
    aNode=0x9db0e74, aRule=0xbfc88924)
    at /firefox3.0.3/mozilla/layout/style/nsInspectorCSSUtils.cpp:88
#2  0xb46b7779 in inDOMUtils::GetCSSStyleRules (this=0xbfc88ab4,
    aElement=0x9c8a3dc, _retval=0xbfc88b10)
    at /firefox3.0.3/mozilla/layout/inspector/src/inDOMUtils.cpp:180


Can someone please tell me why my program crashes? I am pretty sure
the element I pass to the GetCSSStyleRules() in inDOMUtils is a valid
pointer.  This is because I print out the tag name of the element. And
the tag name is valid.

Thank you for any pointers.




_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to