- From: Garret Wilson <Garret@GlobalMentor.com>
- Date: Thu, 25 Nov 1999 17:57:09 -0600
- To: "Philippe Le Hegaret" <plh@w3.org>
- Cc: <www-dom@w3.org>
Philippe and others, ----- Original Message ----- From: Philippe Le Hegaret <plh@w3.org> To: Garret Wilson <Garret@GlobalMentor.com> Cc: <www-dom@w3.org> Sent: Thursday, November 25, 1999 10:05 AM Subject: Re: comments/questions/suggestions/bug reports for DOM Level 2 [cut] > > * CSSValue has a set of unit types, and CSSPrimitiveValue has another set of > > unit types. The former is referred to as "valueType" and the latter as > > "primitiveType". This is fine, except the "valueType" of CSS_INHERIT seems > > in later discussion to get mixed in as a valid value of "primitiveType." The > > true value of "primitiveType" when a value is inherited is uncertain, since > > CSS_INHERIT is not listed as one of the possibilities. Perhaps a separate > > CSS_INHERIT should be defined for "primitiveType," and it should be listed > > as an accepted value under CSSPrimitiveValue.primitiveType. Also, how can > > "valueType" ever return CSS_INHERIT from this interface, if this interface > > is only returned when "valueType" is set to CSS_PRIMITIVE_TYPE? (This is > > where I miss the type-safe enum in C++ that aren't in Java, BTW, but that's > > a different issue.) > > I'm not sure I understand your comment. CSSValue.CSS_INHERIT is not mixed with > primitiveType and you can't cast the CSSValue instance to CSSPrimitiveValue. Since my ramblings above aren't exactly straightforward, let me take it step-by-step. Please let me know where my assumptions go wrong: 1) Inheritance: The interface CSSPrimitiveValue descends from CSSValue. 1a) This means that every CSSPrimitiveValue has a "valueType" property which holds one of the constants of CSSValue. 1b) According to the spec, when CSSValue.valueType==CSS_PRIMITIVE_VALUE, "The value is a CSSPrimitiveValue." 1c) I take this to mean that whenever I have the CSSValue interface with its "valueType" set to CSS_PRIMITIVE_VALUE, the interface is also a CSSPrimitiveValue (meaning I can cast the CSSValue to a CSSPrimitiveValue). Or conversely, CSSPrimitiveValue.valuteType will always equal CSS_PRIMITIVEVALUE. 2) CSSPrimitiveValue defines a separate property, "primitiveType," which is distinct from CSSValue.valueType. 3) CSSPrimitiveValue.setStringValue() accepts a stringType parameter. 3a) According to the spec, stringType is "A string code as defined above. The string code can only be a string unit type (e.g. CSS_URI, CSS_IDENT, CSS_INHERIT and CSS_ATTR." 3b) Three of those codes (CSS_URI, CSS_IDENT, and CSS_ATTR) are defined under CSSPrimitiveValue as valid types for CSSPrimitiveType.primitiveType. The other code (CSS_INHERIT) is defined under CSSValue as a valid type for CSSValue.valueType. 3c) This seems to me to be mixing CSSValue.CSS_INHERIT with CSSPrimitiveType.primitiveType. Perhaps there's something I'm missing here... > > * CSSStyleDeclaration.cssText does not have a description of parameter > > cssText in the documentation. > > I checked the latest public version [1] and there is a description for the > parameter cssText. So there is. I don't have a clue to what I was referring to here... :) Cheers, Garret Wilson GlobalMentor, Inc. garret@globalmentor.com
Received on Thursday, 25 November 1999 18:57:14 UTC