hap497
2010-05-21 05:41:46 UTC
Hi,
If I have a pointer to nsIDOMNSHTMLElement* element, how can I call
the GetStyle()?
In nsGenericHTMLElement.h, it said
// nsIDOMNSHTMLElement methods. Note that these are non-virtual
// methods, implementations are expected to forward calls to these
// methods.
// Forward to GetStyle which is protected in the super-class
inline nsresult GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
But when I do
nsIDOMNSHTMLElement* element;
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
nsresult result = element->GetStyle(getter_AddRefs(cssDecl));
My code will not compile.
So can I safely cast my nsIDOMNSHTMLElement* to nsGenericHTMLElement*
and call GetStyle() that way?
Thank you.
If I have a pointer to nsIDOMNSHTMLElement* element, how can I call
the GetStyle()?
In nsGenericHTMLElement.h, it said
// nsIDOMNSHTMLElement methods. Note that these are non-virtual
// methods, implementations are expected to forward calls to these
// methods.
// Forward to GetStyle which is protected in the super-class
inline nsresult GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
But when I do
nsIDOMNSHTMLElement* element;
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
nsresult result = element->GetStyle(getter_AddRefs(cssDecl));
My code will not compile.
So can I safely cast my nsIDOMNSHTMLElement* to nsGenericHTMLElement*
and call GetStyle() that way?
Thank you.