Re: [CSS21] 10.1 Containing block for absolute elements with inline-level nearest positioned ancestor

On Wed, Mar 17, 2010 at 6:25 PM, Alan Gresley <alan@css-class.com> wrote:
> Bruno Fassino wrote:
>>
>> According to
>>  http://www.w3.org/TR/CSS21/visudet.html#containing-block-details
>> item 4 subitem 1,
>> absolutely positioned elements whose nearest positioned ancestor is
>> inline-level  have a containing block defined using the first and the
>> last box of the ancestor.
>> Considering just the ltr case, the first box of the ancestor defines
>> the top and the left sides of the C.B., the last box defines the
>> bottom and the right sides.
>>
>> An inline level element may extend on more lines, so the above implies
>> that in some cases the _right side_ of the C.B. is 'more' at the left
>> of the _left side_ of the C.B.. For example here, if 'RR RR' is a
>> relative positioned inline:
>>
>> ............................RR
>> RR
>>
>> the established C.B. has its right side just at the end of the last R
>> on the second line, and its left side at the beginning of the first R
>> on the first line.
>> I believe this situation is the one described in the spec with:
>>  "This may cause the containing block's width to be negative"
>
>
> This I think is referring to when there is a reversal of the direction. The
> above spec is a note to this line.
>
>
> # In the case that the ancestor is inline-level, the containing
> # block depends on the 'direction' property of the ancestor.
>
>
> # If the 'direction' is 'ltr', the top and left of the containing
> # block are the top and left padding edges of the first box
> # generated by the ancestor, and the bottom and right are
> # the bottom and right padding edges of the last box of the
> # ancestor.
>
>
> In your test case, the ancestor has the same direction and since the
> relative positioned element is inline [1], then it can not have any width at
> all.
>
>
> # The 'width' property does not apply.


The nearest positioned ancestor and the containing block are two
distinct things, especially when the nearest positioned ancestor is
inline-level.
Width do not apply to inline elements, but the C.B. is always a
rectangle, so it makes sense to talk about its width.



> What should happen to an element with position relative when there is a line
> break?
>
> <http://www.w3.org/TR/CSS21/visuren.html#line-box>
>
> # A relatively positioned box keeps its normal flow size,
> # including line breaks and the space originally reserved
> # for it. The section on containing blocks explains when
> # a relatively positioned box establishes a new containing
> # block.
>
>
> Firstly what does "a relatively positioned box keeps its normal flow size"
> mean?


I believe it means  it keeps the same size that it had if it were
'static'.  Relatively positioned boxes are rendered as they were
'static' and then if they have offsets, they are simply "translated"
from their static position.



-- 
Bruno Fassino http://www.brunildo.org/test

Received on Wednesday, 17 March 2010 18:14:36 UTC