On Aug 4, 10:34 pm, Boris Zbarsky <[EMAIL PROTECTED]> wrote:
> herman wrote:
> > If I get nsIDOMCSSStyleDeclaration* from calling GetComputedStyle(),
> > how can I get a pointer to nsComputedDOMStyle?
> > I need a pointer to nsComputedDOMStyle so that I can call the
> > function  GetBackgroundColor().
>
> Er... why do you need an nsComputedDOMStyle pointer for that, exactly?
> Why are the DOM apis not good enough for you here?
>
> -Boris

Thank you.
With  nsComputedDOMStyle*, I can call

 nsCOMPtr<nsIDOMCSSValue> cssValue;
    nsresult rv =  computedDOMStyle-
>GetBackgroundColor(getter_AddRefs(cssValue));

which return the css value in nsIDOMCSSValue.

But nsIDOMCSSStyleDeclaration*, I can only get the background color in
a nsAutoString.

like this:

 nsAutoString propertyValue;
  computedStyle->GetPropertyValue(propertyName,
                                  propertyValue);


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

Reply via email to