Re: [CSS21] top margin edge - hence static position - is not well-defined

On 28/03/2011 4:39 AM, Anton Prowse wrote:
> On 27/03/2011 19:11, Alan Gresley wrote:
>> On 28/03/2011 2:45 AM, Anton Prowse wrote:
>>> On 27/03/2011 17:32, Alan Gresley wrote:
>>>> On 28/03/2011 12:31 AM, Anton Prowse wrote:
>>
>>>>> <div style="border-bottom:1px solid; margin-bottom:20px"></div>
>>>>> <div style="position:absolute; width:100px; height:100px; background:
>>>>> yellow; margin-top:10px"></div>
>>>>> <div style="border-top:1px solid; margin-top:20px"></div>
>>>>>
>>>>> There's no interop on this issue, but that's because Fx and IE don't
>>>>> perform tentative margin collapsing at all for abspos in order to
>>>>> determine their static position.
>>>>
>>>>
>>>> This is since the margins of elements with position absolute do not
>>>> collapse [1] 8.3.1.
>>>
>>> Alan, we're talking about the calculation of the _static position_ of
>>> absolutely positioned elements.
>>
>> I know, the static position is seen when it is static (in normal flow).
>> Remove position: absolute and you have it's static position. This is
>> what a browser has to work out. What it's position would be if it was
>> position: static.
>
> Yes, so the point is that there's no excuse for Fx and IE using the
> rules for margin-collapsing of abspos boxes when calculating the static
> position, since the boxes are not abspos when calculating their static
> position!


OK, good point. If those boxes are position: static, we would have 
normal margin collapse. 8.3.1 can only come into play when those boxes 
are position: absolute.


> Basically, these browsers are just being lazy.


I think this is harsh considering that CSS2.1 in 2008 did not make much 
sense unless you could develop a mental model. In the year 2011, the 
spec has undergone enormous change.


> There is
> interop for what the non-lazy browsers (Op and Sf) do though, and it's
> that behaviour that we should probably specify. We need to specify
> /something/...
>
> Cheers,
> Anton Prowse
> http://dev.moonhenge.net


Agree. I was seeing the static position much like the static position 
for left in this test case.

<http://css-class.com/test/bugs/ie/calculated-offset-bug2.htm>


In a sense, calculating a static position where collapsing margins can 
happen (vertical margins) may not be the right approach but at the same 
time, does changing behavior (either IE/Gecko or WebKit/Presto) cause 
more issues. Look at issue 203. Long history.




-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo

Received on Sunday, 27 March 2011 18:25:59 UTC