W3C home > Mailing lists > Public > public-css-testsuite@w3.org > August 2008

Re: Convention for tests proving initial values?

From: fantasai <fantasai.lists@inkedblade.net>
Date: Thu, 14 Aug 2008 20:09:00 +0100
Message-ID: <48A482CC.2020101@inkedblade.net>
To: "Grant, Melinda" <melinda.grant@hp.com>, "public-css-testsuite@w3.org" <public-css-testsuite@w3.org>

Grant, Melinda wrote:
>> For inheritable properties you may need to set
>>    html, body, div {
>>      foo: inherit;
>>    }
>> to test the initial value.
> 
> OK, you lost me here.  What do you mean by inheritable?  Elements for which
> 'Inherited' is 'no'?

Elements for which 'Inherited' is 'yes'.

> (If 'Inherited' is 'yes', I shouldn't need to specify 'inherit'...)
>
> But if you mean elements that don't inherit, and I'm trying to prove the
> initial value of foo on 'div', why would I want it to inherit from html?

The problem is, what if the UA stylesheet does something like

   body { text-indent: 0; }

and you want to test the initial value of 'text-indent'? You could check 
that a <div> is not indented, but you're not checking the initial value 
then, you're checking the UA's value on body (since text-indent 
inherits). By setting everything from the root element down to the div 
as 'inherit', then you are grabbing the value from above the root 
element, and since there's nothing there that forces the UA to look up 
the property's initial value.

The reason you don't need to do this for non-inherited properties is 
that we explicitly assume that the only declaration applied to <div> by 
the UA is 'display: block;'.
   http://www.w3.org/Style/CSS/Test/CSS2.1/current/
(So for testing the initial value of display, you'd actually need to use 
the 'inherit' trick even though it's a non-inherited property.)

~fantasai
Received on Thursday, 14 August 2008 19:09:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 20 September 2010 17:51:56 GMT