W3C home > Mailing lists > Public > www-style@w3.org > May 2012

Re: [CSS21] Nested floats and zero-height margin box

From: Øyvind Stenhaug <oyvinds@opera.com>
Date: Mon, 21 May 2012 16:09:32 +0200
To: "W3C www-style mailing list" <www-style@w3.org>
Message-ID: <op.wenv9612bunlto@oyvinds-desktop>
On Mon, 21 May 2012 12:33:54 +0200, Anton Prowse <prowse@moonhenge.net>  
wrote:

> On 25/02/2012 21:45, "Gérard Talbot" wrote:

>> Bug 16119: [9.5.1 Floats] How nested floats with one zero-height
>> margin box should be rendered
>> https://www.w3.org/Bugs/Public/show_bug.cgi?id=16119

> If we don't like the fact that the rendering is left undefined for these  
> test cases, then I think that should be fixed in CSS3 by defining the  
> shrink-to-fit algorithm for floats.  As I say, defining "next to" won't  
> suddenly make these tests unambiguous.

True.

> Perhaps there exist test cases which more clearly demonstrate a problem  
> with the lack of explicit definition of "next to".  I can't immediately  
> think of any, though, and until some arise I propose closing this bug as  
> wontfix.

<!DOCTYPE html>
<style>
     body > div {
         width: 150px;
     }
     div > div {
         width: 100px;
         height: 100px;
     }
     .left {
         background: blue;
         float: left;
     }
     .right {
         background: teal;
         float: right;
         margin-bottom: -150px;
     }
</style>
<div>
     <div class="left"></div>
     <div class="right"></div>
</div>

These squares don't overlap (in Gecko/Presto/Webkit, at least, didn't try  
IE). That doesn't seem very obvious, since it seems to suggest different  
"next to"-conditions than the ones used for line boxes. Of course, it  
would be a bit weird for them to overlap since it would almost be like  
placing the later element's box "above" the earlier. (But not really - the  
vertical position would be equal, not above.)

-- 
Øyvind Stenhaug
Core Norway, Opera Software ASA
Received on Monday, 21 May 2012 14:10:32 GMT

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