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

Re: [CSS21] Left float later in source does not clear right float due to nesting of containing block

From: Morten Stenshorne <mstensho@opera.com>
Date: Thu, 22 Aug 2013 21:58:20 +0200
To: Alan Gresley <alan@css-class.com>
Cc: CSS 3 W3C Group <www-style@w3.org>
Message-ID: <87vc2xh50j.fsf@aeneas.oslo.osa>
Alan Gresley <alan@css-class.com> writes:

> I have been reviewing some old offline bug folders and found an old
> test case.
>
> http://css-class.com/test/css/box/floats/containing-block2.htm
>
> All UAs tested (IE10, Opera 12.14, FF23 and Chrome 28) will show fine
> if the inner parent (see id=leftparent) in normal flow does not have a
> fixed width.

Or, more precisely, it shows fine if the left float's containing block
has a width that makes it intersect with the right float. As far as I
can tell.

> If the inner parent in normal flow does have a fixed width, I believe
> that only IE10 shows the test case correctly.

It sure looks like IE10 is the only one getting it right.

http://www.w3.org/TR/CSS21/visuren.html#float-rules

   Rule 3: The right outer edge of a left-floating box may not be to the
   right of the left outer edge of any right-floating box that is next to
   it. [...]

But really, while I think IE's rendering is the only one that makes
sense, how could three independent browser engines manage to come up
with the same bug? :) I'm amazed. Are we missing something?

> FF and Opera shows the same regardless of if the inner parent has a
> width or auto width.

That's not what I observe. With auto width (or a width larger than
200px), the left float is put below the right float, like in IE.

> Chrome does not like the test case so it paints the right float above
> the text that is contained within the next float in the source.

Could be some optimization that messes up painting order, maybe.

> Are my conclusions correct? Does IE10 do right in respects to the spec?

Common sense + what I could find in the spec right now seems to suggest
that only IE gets this right. But I still find it strange that the three
others are bug-compatible.

-- 
---- Morten Stenshorne, developer, Opera Software ASA ----
------------------ http://www.opera.com/ -----------------
Received on Thursday, 22 August 2013 19:58:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:33 UTC