Re: "non-zero top border" in 8.3.1

On Monday 2007-08-27 20:16 -0700, Alex Mogilevsky wrote:
> Second rule in 6th bullet of 8.3.1 (defining position of an empty block which is not collapsing its margins with its parent's top margin) says
> "The position of the element's top border edge is the same as it would have been if the element had a non-zero top border."
> 
> However adding a non-zero top border changes behavior if the element collapses its top margin with its children.
> 
> The same statement would become correct if "top" changed to "bottom":
> "The position of the element's top border edge is the same as it would have been if the element had a non-zero BOTTOM border."
> 
> Can we make this change?

I think this is a pretty significant change (although I'm never
entirely sure when dealing with this part of the spec).  It affects
the position of floats (and absolutely positioned elements with
top:auto) in empty blocks.  Do you have testcases to show how
existing implementations behave?

I think the statement was intended to say what it now says, since it
was an attempt to define the position of boxes that have margins
collapse through them, since their position is otherwise undefined.

For the cases where this change matters (floats and abs pos with
top:auto), I also tend to think the existing spec makes more sense.
Given HTML like:

 text above
 <div>
   <img align="left">
   <p></p>
 <div>
 text below

I would expect the top of the image to be aligned with the bottom of
the text above, not the top of the text below.

That said, I posted the above snippet at
http://lists.w3.org/Archives/Public/www-archive/2007Aug/att-0066/empty-block-position.html
and IE and Opera do what the spec now says, while Mozilla and
Konqueror do what you propose.

But that's just one testcase of several that should be written...

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Tuesday, 28 August 2007 06:31:55 UTC