W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2000

RE: DOM-2 CSSValue.CSS_INHERIT

From: Glenn Adams <gadams@vgi.com>
Date: Thu, 30 Mar 2000 12:29:47 -0500
To: "'Philippe Le Hegaret'" <plh@w3.org>
Cc: <www-dom@w3.org>
Message-ID: <000e01bf9a6d$8c607e30$2d020001@neo.vgi.com>

I believe I understand now: if valueType is CSS_INHERIT then no other information is available from that CSSValue instance (although, what would cssText be in this case? "inherit"?); in this case, one must use ViewCSS.getComputedStyle(...).getPropertyCSSValue(...) to obtain the actual (computed) value.

If this is correct, then some additional clarifying language would suffice.

Regards,
Glenn

-----Original Message-----
From: www-dom-request@w3.org [mailto:www-dom-request@w3.org]On Behalf Of
Philippe Le Hegaret
Sent: Thursday, March 30, 2000 12:05 PM
To: Glenn Adams
Cc: www-dom@w3.org
Subject: 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:29:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:47 GMT