Re: [CSS21] 9.2 Anonymous boxes

On 17/03/2011 13:50, Alan Gresley wrote:
> On 4/08/2010 4:05 AM, Anton Prowse wrote:
>> fantasai wrote:
>>> On 08/01/2010 02:45 PM, Anton Prowse wrote:
> [snip]
>>>> Issue 3:
>>>>
>>>> What /does/ happen when an inline box contains a float? Does the run of
>>>> inlines+floats in which it sits get wrapped in an anonymous block box
>>>> which becomes the sibling of the floats? If so, this needs stating.
>>>
>>> I don't understand. What case exactly are you talking about?
>>
>> <div>start <span style="float:left">middle</span> end</div>
>>
>> The float is taken out of the flow, but the div is a block box and can
>> only contain all inline-level or all block-level content. Under the
>> assumption that the div _contains_ the block box of the float, then we
>> either need to ensure that the div's inline content is wrapped in an
>> anonymous block-level box, or that the float is ignored for the purposes
>> of enforcing block container box behaviour on the div.
>>
>> Thinking on this further, however, I think that "out of flow" probably
>> means that the float box isn't "contained" by the div box, in which case
>> things already hold together correctly. This might be worth clarifying
>> in the spec, though.
>
> Anton, I think you missing the concept that since a floated element is
> taken out of the flow, the block-level box does not cause the inline
> boxes to be split. There are no anonymous blocks in the below example,
>
> <div>start <span style="float:left">middle</span> end</div>
>
> since what we have is inline boxes in normal flow. Like below.
>
> <div>start end</div>

No, you misunderstand the discussion.  The issue I'm raising concerns 
the box tree and the nature of block container boxes.  It's not related 
to the part of the spec about inlines being split by blocks.

The div is a block container box, and the float is a block-level box in 
CSS21 (although I question that wisdom).  A block container box can only 
contain either all inline-level content or all block-level content.  If 
the div is said to contain the float, then since it contains a 
block-level box it must contain _only_ block-level boxes and so an 
anonymous block must be generated around the loose text.  If the div is 
/not/ said to contain the float, then where does the float live in the 
box tree?  If it lives inside the div then the definition of "contains" 
needs clarifying.

Cheers,
Anton Prowse
http://dev.moonhenge.net

Received on Thursday, 17 March 2011 17:11:21 UTC