On Wednesday 2010-01-13 16:04 -0600, Valentine V wrote:
>     nsCOMPtr<nsIDOMCSSStyleDeclaration> spComputedStyle = NULL;
>     rv = spDomView->GetComputedStyle(domElement, EmptyString(),
> getter_AddRefs(spComputedStyle));
> 
>     if(NS_SUCCEEDED(rv) && spComputedStyle)
>     {
>       ...
>       strPropertyName.AssignLiteral("font-size");
>       strPropertyValue.AssignLiteral("16px");
>       nsresult rv = spComputedStyle.setProperty(strPropertyName,
> strPropertyValue, EmptyString());

The result of getComputedStyle is in general read-only, as described
in http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-ViewCSS .  If
you want to set style, you should set style attributes, manipulate
element.style (which represents the style attribute) or add rules to
a style sheet.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to