Re: [CSS Intrinsic & Extrinsic Sizing] sizing of absolutely positioned elements

On Thu, Oct 11, 2012 at 2:31 PM, fantasai <fantasai.lists@inkedblade.net>wrote:

> On 10/09/2012 03:05 PM, Boris Zbarsky wrote:
>
>> On 10/9/12 5:39 PM, Ojan Vafai wrote:
>>
>>> I guess I still find the CSS2.1 language confusing: "the containing
>>> block is formed by the padding edge of the ancestor." That makes it
>>> sound like the containing block *is* the imaginary block formed by the
>>> padding edge of the ancestor.
>>>
>>
>> Indeed.
>>
>> There's an unfortunate tendency to use the term "containing block" to
>> refer interchangeably to "the rectangle defined as the
>> containing block" (which is not itself a block in any way; it's just a
>> rectangle) and "the element which was used when
>> defining the containing block" (assuming there was one at all; see
>> initial containing block) and maybe a few other things.
>>
>> As defined, right now, the containing block is a rectangle.  The other
>> uses are just confused, to a greater or lesser extent.
>>
>> http://dev.w3.org/csswg/css3-**sizing/#extrinsic-sizing<http://dev.w3.org/csswg/css3-sizing/#extrinsic-sizing>is a great example of this tendency.  I can't make heads or tails of
>> what it's saying. Especially for cases in which the containing block is
>> the ICB.
>>
>
> Proposed replacement:
>   | The inner fill-available measure of a box is…
>   |  * If the box is the root or is absolutely-positioned,
>   |    the used measure of its containing block, else
>   |  * max(min-measure|0, min(max-measure|infinity,
> measure|fill-available))
>   |    where the sizes are inner measures of the element establishing the
>   |    box's containing block, and where the first value is used if it is
>   |    definite and the second value otherwise.
>   | …less the box's inline-axis margins (after margin collapsing), borders,
>   | and padding.
>
> How's that?


Just to make sure I understand this, what happens in the following case:

<div style="position: relative; padding: 100px">
    <div style="position:absolute; height: fill-available"></div>
</div>

The way I read the spec, the absolutely positioned div should be 200px
tall, yes?

Received on Friday, 19 October 2012 20:07:49 UTC