>> It will remove it. setCssText is setting the _entire_ cssText -
>otherwise,
>> it should be called "appendCssText".
>>
>[[[
>Setting this attribute will result in the parsing of the new value and
>resetting of the properties in the declaration block. It also allows the
>insertion of additional properties and their values into the block.
>]]]
>
>-- Document Object Model CSS
>http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/css.html#CSS-CSSStyleDeclaration
>Wed, 10 May 2000 15:09:02 GMT
>
>Hum, the cssText description could be better. What about :
>
>Setting this attribute will result in the parsing of the new value and
>resetting of all the properties in the declaration block including
>theremoval or addition of properties.
Yes, this description is good. Can you please tell me what would happen
in the following case where I retrieve a CSSValue from the rule's style
declaration, and then make a call to the rule's setCssText method which
removes the value's property from the declaration? Does the outstanding
CSSValue reference become detached from its parent rule and simply perform
method calls on the old data [without affecting the rule's declaration
values] or does the reference become invalid and invalid state exceptions
are thrown on any of the value's method calls?
Example.
styleRule.setCssText("H1 { ascent: 10 }");
CSSValue styleValue = style.getPropertyCSSValue("ascent");
style.setCssText("H1 {} "); //**** ascent property is removed eventhough
a reference is outstanding ***//
( (CSSPrimitiveValue)styleValue).getFloatValue();
Does the last call throw an invalid state exception or does it return the
old value 10?
Thanks,
Blaine