Re: [CSS21] Floats, overflow: hidden, BFCs and margins

Le Lun 20 février 2012 6:24, Anton Prowse a écrit :
> On 20/02/2012 01:14, "Gérard Talbot" wrote:
>
>> Margins and block formating contexts
>> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/marges-contexte-formatage.html
>>
>> Are the 6 tests in that page correct? The question is important as there
>> are diverging implementations. If they are not, please quote the
>> relevant
>> excerpts of the spec.
>
> Note that it's not clear what you're testing, specifically, but I'm
> assuming that it's the general issue of BFC margins next to floats.  I
> did some analysis a couple of years back on this; you might want to read
> [1] and its follow-ups.  Bert Bos's intention, as stated in that thread,
> was that this behaviour would be defined more precisely in CSS3.
>
>
> I see nothing controversial about Tests 3 and 6.  Something based on
> those should form part of the test suite.
>
>
> The behaviour of Tests 1 and 2 as regards the left margin of the
> non-floated BFC, and Tests 4 and 5 as regards the right margin of the
> non-floated BFC, is undefined in CSS21:
>
>    # The border box of a table, a block-level replaced element, or an
>    # element in the normal flow that establishes a new block formatting
>    # context (such as an element with 'overflow' other than 'visible')
>    # must not overlap the margin box of any floats in the same block
>    # formatting context as the element itself.
>
> Note how the spec says nothing about how to handle the float-facing
> margin of the non-floated BFC.

Then, according to you, the resulting layout of some of those tests are
undefined in CSS 2.1.

E.g. in test 1: maybe there should be a gap of 100px between the right
edge of yellow square (with green border) and left edge of orange
rectangle.



> Your conclusion that some browsers are incorrect as regards the *right*
> margin in Tests 1, 2 and 4 looks good to me; there are clearly some
> browser bugs here.  (In Test 5 I believe the "incorrect" behaviour is
> permitted by the spec, but given that the behaviour is not symmetrical
> wrt Test 2 it's probably just coincidence.)


Then I can not submit those tests as the rendering of such margin is not
clearly defined in the spec.


>
> [1] http://lists.w3.org/Archives/Public/www-style/2009Jan/0275.html (the
> thread is disjointed in the archive, so it's best to do an Advanced
> Search for the subject line instead).

I will try.

Thanks Anton, I appreciate your feedback :)

Gérard
-- 
CSS 2.1 Test suite RC6, March 23rd 2011
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html

Received on Monday, 20 February 2012 20:18:56 UTC