Re: [CSS21] Another ambiguity in the definition of "containing block"

Boris Zbarsky wrote:
> On 9/27/09 5:14 PM, Boris Zbarsky wrote:
>>> Well, replacing "ancestor" with "ancestor's" may solve it, I think.
>>
>> Not really, no.
> 
> And just to make that clear, what should be the width of the green box 
> in the following testcase?
> 
> <!DOCTYPE html>
> <div style="display: table; width: 300px">
>   <div style="display: table-row;">
>     <div style="display: table-cell; width: 100px">x</div>
>     <div style="width: 50%; height: 100px; background: green">y</div>
>   </div>
> </div>
> 
> It's 100px wide in Gecko, Webkit, Opera 10, and IE8 (though removing the 
> 'x' and 'y' changes the rendering in Opera for reasons that I can't 
> fathom).  So the anonymous table cell is clearly being the containing 
> block in this case.  Why is the anonymous thing the containing block 
> here, but not in the anonymous block case?

I think it's because in the anonymous block case, the anonymous block
is supposed to be effectively invisible, just a concept, like line boxes,
that organizes the layout; but in the case of anonymous table boxes,
we're creating missing boxes that have special behavior; they're not
"transparent" the way anonymous blocks are supposed to be.

Maybe that doesn't make any sense, but I tried. :)

~fantasai

Received on Wednesday, 30 September 2009 01:55:21 UTC