W3C home > Mailing lists > Public > www-style@w3.org > November 2006

[CSS21] Computing widths of block reflow context roots in the presence of floats

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Fri, 03 Nov 2006 09:31:43 -0600
Message-ID: <454B60DF.2050602@mit.edu>
To: www-style Mailing List <www-style@w3.org>

Consider the following testcase:

   <body style="width: 300px">
     <div style="float: left; height: 100px; width: 100px"/>
     <div style="overflow: hidden" id="test">
       Text
     </div>
   </body>

And assume all three elements generate block boxes and no other styles are 
applied.  What is the correct layout?  Per section 10.3.3, the computed width of 
the id="test" block is 300px, and since its margin box may not overlap the float 
I'd expect it to be cleared below the float.  But there's some sort of confusing 
wording in section 9.4.1 about "the box itself may become narrower due to the 
floats", and all current UAs make the id="test" block 200px wide and place it 
next to the float...

Is the idea that both layouts are "correct" per the spec or something?

-Boris

Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=359135
Received on Friday, 3 November 2006 15:31:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:47 GMT