W3C home > Mailing lists > Public > www-style@w3.org > August 2007

Re: "non-zero top border" in 8.3.1

From: L. David Baron <dbaron@dbaron.org>
Date: Mon, 27 Aug 2007 23:31:46 -0700
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <20070828063146.GA14633@ridley.dbaron.org>
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
   <img align="left">
 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
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...


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

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:30 UTC