Re: [CSS21] Used value versus specified and computed value (position relative)

On 09/07/2012 21:20, "Gérard Talbot" wrote:
> Hello,
>
> I'm struggling a bit with the understanding of following test:
>
> http://test.csswg.org/suites/css2.1/20110323/html4/relpos-calcs-001.htm
>
> What is inherited is the computed value, not the used value.
>
> So,
>
> line 25  top: inherit; /* using inheritance to test computed vs. used */
>
> top is 'auto'; top is not 50% and it is not 60px.
>
> So,
>
> 1- I do not see the purpose of the div.control in that test
>
> 2- div.inner's top property value inherited value is 'auto' which is
> resolved as 0; it is not 50%. div.inner's top property used value is 0,
> not 60px.

If a UA incorrectly computed 'top' on div.inner to -50% (the used value 
of that property on the parent) instead of 'auto' (the computed value of 
that property on the parent) then that div would be positioned higher up 
the canvas and the red background of div.control would show.

A small nit about this test: div.container has been given a 'margin-top' 
of '-60px', which is done purely for the aesthetic purpose of having the 
square appear directly under the paragraph without a gap, but this 
introduces the cognitive overhead of having to figure out whether or not 
it's purely aesthetic in the first place.

Cheers,
Anton Prowse
http://dev.moonhenge.net

Received on Tuesday, 10 July 2012 07:34:26 UTC