W3C home > Mailing lists > Public > public-css-testsuite@w3.org > October 2013

Re: Issue with margin-collapse-clear-012.htm and margin-collapse-clear-013.htm

From: Gérard Talbot <css21testsuite@gtalbot.org>
Date: Wed, 23 Oct 2013 21:11:01 -0400
To: Robert Hogan <robhogan@gmail.com>
Cc: Public CSS test suite mailing list <public-css-testsuite@w3.org>, Bruno Fassino <fassino@gmail.com>
Message-ID: <d2e6c92e75c2d6d7fe4c31e2edd90541@gtalbot.org>
Le 2013-10-23 14:18, Robert Hogan a écrit :
> Hi Gérard,

Hello Robert,

> These two tests

These 2 tests:



> are based on the example given in the CSS 2.1 spec at
> http://www.w3.org/TR/CSS2/visuren.html#clearance.

Hm... no, not really. The margin-collapse-clear-012.htm and 
margin-collapse-clear-013.htm use an empty box whose vertical margins 
collapse through. While the examples in section 9.5.2 use a non-empty 
clearing box. That is one main (and major) difference and we also have a 
following sibling after the clearing box.

> However the example there

, there are 2 examples: which one?

> is a bit limited in that the elements in
> question only have a margin-top.

The 2 examples (Example 1, Example 2) at
both show a float in-between 2 blocks with only the bottommost (second) 
block having a margin-top, with only the clearing box having a 
margin-top. It's the most simple and reduced tests.

> I believe that if they had a
> margin-bottom that both margin-top and margin-bottom would collapse
> and it would be that collapsed value that would be used to calculate
> the clearance. There's nothing in the description of collapsing
> margins (http://www.w3.org/TR/CSS2/box.html#collapsing-margins) to
> suggest that margin-top should be considered in its uncollapsed state
> in this context.

Robert, please provide a full example along with <!-- comments --> in 
the code so that I could understand you. You are potentially talking or 
comparing 4 tests. And try to replace "they", "there", etc.. with more 
univocal terms.

> The two tests in the title have margin-top and margin-bottom

I do not follow you: what do you mean with "The two tests in the title 
have margin-top and margin-bottom".

> but only
> margin-top is considered when computing the clearance - I believe this
> is mistaken and that the tests are invalid.

You think



are invalid..

Two margins are adjoining if and only if:
(...) no clearance (...) separate them

The bottom margin of an in-flow block box (...) collapses with its last 
in-flow block-level child's bottom margin if (...) the child's bottom 
margin does not collapse with a top margin that has clearance.

This is the case for margin-collapse-clear-013.htm:

div#clear-left's bottom margin does not collapse with its parent top 

> Can anyone comment? Have I got the wrong end of the stick?
> Thanks,
> Robert

I can see 1 comment (lines 96 to 98) in margin-collapse-clear-013.htm 
which is not right though.

(140px - 40px) : part of #sole-following-sibling's margin-bottom
                "exceeding" the amount collapsed with
                 #clear-left's margin-top (140px - 40px)

It should be instead

(140px - 40px) : #clear-left's margin-bottom (140px - 40px)

I'll need to check again with Bruno Fassino on this.

+CC: Bruno Fassino

Web authors' contributions to CSS 2.1 test suite
CSS 2.1 Test suite RC6, March 23rd 2011
Received on Thursday, 24 October 2013 01:11:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 20 January 2023 19:58:19 UTC