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

Re: [CSS 2.1] [section 9.5 Floats] Empty floated element with a set width but height:0

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sat, 7 Aug 2010 16:35:43 -0700
Message-ID: <AANLkTimkV-uy=73SgmSfJaGoT=8OXt-BuCRQvq3j8Hc_@mail.gmail.com>
To: Anton Prowse <prowse@moonhenge.net>
Cc: www-style@w3.org
On Sat, Aug 7, 2010 at 3:21 AM, Anton Prowse <prowse@moonhenge.net> wrote:
> Tab Atkins Jr. wrote:
>>
>> Some further information:
>>
>> We agree that a zero-height float (or a float whos bottom edge is
>> incident with the top edge of a line box) doesn't force the line box
>> out of the way in any browser.
>>
>> A further question concerns zero-height floats which appear in the
>> middle of a line.  For example:
>>
>> <!DOCTYPE html>
>> <div style="float:left; width:50px; height:5px; background:blue;"></div>
>> <div style="float:left; clear:left; width:100px; height:0px;"></div>
>> <span>foo</span>
>>
>> The first float definitely shoves the text over by 50px.  The question
>> is whether the 0-height float should further push it or not.
>>
>> Chrome doesn't push it, but that's part of a general bug where Webkit
>> doesn't take into account floats that don't intersect the top of the
>> line box.  (Make the second float 5px hight and give it a background
>> to see what I mean.)  So it's a wash, and tells us nothing.
>>
>> Firefox doesn't push the text.
>>
>> IE and Opera push the text.
>>
>> If I'm recalling correctly (doesn't look like the comment made it into
>> the minutes today), Dbaron said he'd be willing to change the Firefox
>> behavior here (but it may make his current implementation strategy
>> slightly more difficult).
>
> Again, this is about continuities.  What if the second float's margin
> area height were negative?  I'd expect (insist, actually) that it be
> ignored for the purposes of line box shortening.  Should it stop being
> ignored at zero height, or at positive height?  Positive height seems
> the more sensible to me.

Are you talking about the case where the float is at the top of the
line box, or in the middle?

In the "top of line box" situation, it should be treated identically
to any other positive-height float that happens to have a bottom
margin edge incident with the top edge of the line box.

In the "middle of line box" situation, several behaviors seem sensible
to me.  We can make it not count when it's zero-height, not count when
it's negative height, or just count all the time.

~TJ
Received on Saturday, 7 August 2010 23:36:47 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:30 GMT