W3C home > Mailing lists > Public > www-style@w3.org > November 2008

RE: [CSS2.1] table container behavior (captions, floats and margin collapsing)

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Tue, 25 Nov 2008 17:12:37 -0800
To: "robert@ocallahan.org" <robert@ocallahan.org>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <7C2F64B551D8664AAD94A28DAC37D0206B502236D4@NA-EXMSG-C103.redmond.corp.microsoft.com>
Good, it seems we are in agreement at least with floats.

Thanks for reminding of the multicol margin collapsing – it is in fact a block formatting context that is transparent for margin collapsing. CSS3 still needs to define exact behavior for such blocks:

·         What happens if ‘clear’ is set on child elements which margins collapse with multicol element (FF and Safari currently ignore the ‘clear’)

·         What happens when mutlicol element only contains empty blocks?

I am not sure though it is worth the effort to introduce this CSS3 block behavior back into CSS2.1.

CSS2.1 tables currently don’t formally define details of how margin collapsing works with the table container. It is only shown in the example diagram that top margin of caption collapses with top margin of the container, but it is not clear if all of margin collapsing rules from 8.3.1 are to apply.

In the interest of actually finishing CSS2.1 I would prefer simply declaring the table container a block formatting context (CSS2.1 style, no margin collapsing). Considering that there are no implementations of current caption spec, there is not a lot of value in this special type of collapsing (and there it differs from multi-columns where margin collapsing seems quite important).

From: rocallahan@gmail.com [mailto:rocallahan@gmail.com] On Behalf Of Robert O'Callahan
Sent: Sunday, November 23, 2008 11:56 PM
To: Alex Mogilevsky
Cc: www-style@w3.org
Subject: Re: [CSS2.1] table container behavior (captions, floats and margin collapsing)

On Mon, Nov 24, 2008 at 8:13 PM, Alex Mogilevsky <alexmog@microsoft.com<mailto:alexmog@microsoft.com>> wrote:

We realize that making the box a block formatting context changes both the float behavior and caption margin collapsing. The latter makes some sense (and it is probably OK to keep it), but it also creates a special kind of block which is nearly identical to blocks defined elsewhere with one subtle difference. We are not against keeping the caption margin collapsing but we don't feel it is worth the additional complexity of creating another special case for margin collapsing.
Table margin collapsing is broken in Gecko. That's something we should just fix.

I don't think we should allow floats to intrude on caption layout. I think it's OK to allow table and caption margins to be propagated out of the table block formatting context. For CSS3 columns, we want the top and bottom margins of the content in the column set to collapse with margins outside the column set, while not allowing floats to disturb the layout of the column set; it's the only way to get reasonable behaviour for content like <p style="column-width:15em;"> (especially when you want it to fall back correctly for legacy browsers). So this idea of "block formatting context that margins can collapse through" already exists.

Rob
--
"He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]
Received on Wednesday, 26 November 2008 01:13:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:17 GMT