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

On 10/07/2012 16:57, "Gérard Talbot" wrote:
> Le Mar 10 juillet 2012 3:33, Anton Prowse a écrit :
>> On 09/07/2012 21:20, "Gérard Talbot" wrote:
>>> I'm struggling a bit with the understanding of following test:
>>> 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.
> Here's what I did. I set div.control's background color to orange (instead
> of red) and then set div.inner's top to -50%. I see red (from div.outer);
> I do not see orange (which would be from div.control).

Hmm, yes, the control div seems unnecessary.  One of those instances 
where the test author decided to test something else at the same time as 
the primary test?

>> 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.
> It's not purely aesthetic. [...] you want to create [...] a layout which can easily reuse
> the same reftest.

OK, mostly aesthetic ;-).  But I take your point about reusing the same 
reftest across multiple tests.

Anton Prowse

Received on Tuesday, 10 July 2012 21:03:06 UTC