Re: [css21] computed value of top/bottom for relative positioning

On Thu, 12 Feb 2009 22:06:46 +0100, L. David Baron <dbaron@dbaron.org>  
wrote:
> On Thursday 2009-02-12 19:51 +0100, Anne van Kesteren wrote:
>> http://www.w3.org/TR/CSS21/visuren.html#position-props states that for a
>> relative positionined element the computed value of 'bottom' (which is
>> also the inherited value) is defined in
>
> I think we probably want the "Otherwise:" text  from the computed
> value line to apply to the non-auto relative positioning case.

Yes.


> However, I wonder if all of these adjustments (except for what's in
> the "Otherwise:" text) should be adjustments to the used value
> rather than the computed value, so that they don't affect
> inheritance.  I'm willing to guess that might be more consistent
> with implementations.  (Do you have testcases?)

E.g.

<!doctype html>
<style>
  div { border-top:1px solid }
  #a { margin-top:30px; height:100px }
  #b { position:relative; bottom:10%; height:100px }
  #c { position:relative; top:inherit }
</style>
<p>Should there be three thin lines below or one thick and one thin?</p>
<div id=a><div id=b><div id=c></div></div></div>

... does seem to confirm that.

If you change top to bottom you do get three lines. If you give top the  
supposed computed value of top on #b (-10%) you also get three lines. If  
you remove height on #b and change top to bottom you get a different  
result in Opera and Firefox because Opera resolves percentages to lengths.

Hope that helps.


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Received on Thursday, 12 February 2009 22:49:40 UTC