Re: Questions about the CSSPrimitiveValue interface.

Blaine Brodie wrote:
> Which of the following is the correct way to use setStringValue in the
> following cases?
> 
> setStringValue(CSS_STRING, "\"this way\"" );
> or
> setStringValue(CSS_STRING, "this way" );
> 
> setStringValue(CSS_URL, "url(###)" );
> or
> setStringValue(CSS_URL, "###" );
 
Our intent is to have:

setStringValue(CSS_STRING, "this way");
and
setStringValue(CSS_URI, "###");

The return value of getStringValue doesn't need to be parsed.

> > Also, what is expected to occur with CSSPrimitiveValue's
> > getPrimitiveType() method in the following case?  Assume I have a
> > CSSPrimitiveValue named 'primitiveValue'.  Also, assume that
> > primitiveValue's attached property can contain CSSValues of type
> > CSS_VALUE_LIST and CSS_PRIMITIVE_VALUE . What happens in the following
> >  situation?
> primitiveValue.setCssText("a, valid, list")     // no exception raised
> according to
>                                                 // current specification.
> primitiveValue.getValueType();          // now returns CSS_VALUE_LIST
> primitiveValue.getPrimitiveType() == ????.
> 
> ^^^Sorry added some information that I forgot about in my previous post.

This case appears on properties 'border-spacing', 'quotes',
'play-during', 'counter-increment', 'counter-reset', 'size', 
and 'text-shadow'.
It means that the implementation has to do a special handling for theses
cases. In your case, it would mean that getPrimitiveType() has an undefined
result since the value is no longer a primitive value.

Philippe

Received on Monday, 26 June 2000 11:24:56 UTC