W3C home > Mailing lists > Public > www-style@w3.org > January 2008

[CSS2.1-9.5] [CSS2.1-9.4.1] Block formatting context and Floats

From: Alan Gresley <alan1@azzurum.com>
Date: Mon, 14 Jan 2008 19:51:59 -0700
To: www-style@w3.org
Message-ID: <20080114195159.34b83c2f3c9bef00757a2c62c0fb7450.1709f38fc9.wbe@email.secureserver.net>

I would please like clarification on the specs for "9 Visual formatting model."

http://www.w3.org/TR/2006/WD-CSS21-20061106/visuren.html

Which relates to the following markup.

<div style="float: left; width: 250px">
  <div style="float: left; height: 100px; width: 100px">
     Float
  </div>
  <div style="overflow:auto; height: 100px; width: 100px; margin-left: 150px">
    overflow box enough text to scroll
  </div>
</div>

I see this spec.

9.5 Floats (5th paragraph):

#The margin box of a table, a block-level replaced element, or 
#an element in the normal flow that establishes a new block 
#formatting context must not overlap any floats in the same 
#block formatting context as the element itself.

This has been changed to - 
http://www.w3.org/TR/CSS21/changes.html#q57
C.2.50 Section 9.5 Floats:

|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 must not overlap any floats in the same 
|block formatting context as the element itself. 

This now leaves the question, what happens to the margin box (left margin edge) of an overflow element sitting to the right of a float? I believe this could be resolved now from this part of the spec on block formatting contexts.

9.4.1 Block formatting contexts (part of 3rd paragraph):

#In a block formatting context, each box's left outer edge 
#touches the left edge of the containing block. This is true 
#even in the presence of floats, unless the box establishes a 
#new block formatting context.

This has been changed to - 
http://www.w3.org/TR/CSS21/changes.html#q54
C.2.47 Section 9.4.1 Block formatting contexts

|In a block formatting context, each box's left outer edge 
|touches the left edge of the containing block. This is true 
|even in the presence of floats, except boxes that establishes 
|a new block formatting context.

A few questions:

1. Is the "box's left outer edge" the same as the boxes left margin edge if one is present?

2. What is the difference between "unless the box establishes a new block formatting context" and "except boxes that establishes a new block formatting context?"

3. Doesn't this reflect the old spec for "9.5 Floats" mentioning a margin box instead now the border box?

This seems to contradict part the reason of the change in the spec, though I'm not aware what the original Gecko bug was.
http://lists.w3.org/Archives/Public/www-style/2007Apr/0040.html

Could 9.5 Floats (5th paragraph) be re-worded:

|In a block formatting context, each box's left outer edge 
|touches the left edge of the containing block. This is true 
|even in the presence of floats. In the case of a box that 
|establishes a new block formatting context, the box itself may 
|become narrower due to the floats.

and tying in with the last part of "9.4.1 Block formatting contexts"

|If necessary, implementations should clear the said element 
|by placing it below any preceding floats, but may place it 
|adjacent to such floats if there is sufficient space.

 
Alan

http://css-class.com/
Received on Tuesday, 15 January 2008 02:52:11 GMT

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