Re: DOM-2 CSSValue.CSS_INHERIT

Glenn Adams wrote:
> 
> In Document Object Model (DOM) Level 2 Specification, Version 1.0, W3C
> Candidate Recommendation 07 March, 2000, under Section 5.2 CSS Fundamental
> Interfaces, under Interface CSSValue, regarding CSS_INHERIT:
> 
> It seems to me that the valueType CSS_INHERIT is orthogonal to the other
> three specified values of valueType (CSS_PRIMITIVE_TYPE, CSS_VALUE_LIST,
> CSS_CUSTOM). The latter three express important sub-type information, yet
> CSS_INHERIT expresses how the value came to be.
> 
> If one were to specify CSS_INHERIT, then sub-type information will be lost;
> if one were to specify sub-type information, then information about
> inheritence would be lost.

CSS_INHERIT is a special value which requires special handling in the CSS
engine. The 'inherit' value should be supported by all CSS properties. So,
according to this conclusion, we put the 'inherit' support on the CSSValue
interface. If you explicit set a property to 'inherit' in your style sheet,
you'll get CSS_INHERIT in your CSSValue with no sub-type information. You'll
get the computed value from the computed style. It's a fact that setting a
property from 'inherit' to something else (like 12em for example) introduces
some constraints on the underlying implementation. It also means that you
have to use the cssText property to do that or to use the setProperty method
on the CSSStyleDeclaration interface. We don't consider this contraint as an
issue since this is not a real common use.

> I'd suggest adding an additional boolean attribute to indicate inheritence
> rather than misusing the valueType attribute.

It could be a possibility except that I don't see what primitiveType should
return if the value is 'inherit' and the underlying type is CSS_PRIMITIVE_VALUE.
And this will be the same for CSS_VALUE_LIST (length == 0?) and all custom
values in the CSS2 extension. When a value is CSS_INHERIT, you're not allowed
to access the sub attributes or sub functions.

Does it clarify your intend ?

Philippe.

Received on Thursday, 30 March 2000 12:05:25 UTC