[css-position-3] Containing block formed by fragmented inlines · Issue #8284 · w3c/csswg-drafts (original) (raw)

CSS2.1 defines the containing block formed by an inline box like this:

In the case that the ancestor is an inline element, the containing block is the bounding box around the padding boxes of the first and the last inline boxes generated for that element.
In CSS 2.1, if the inline element is split across multiple lines, the containing block is undefined.

In CSS Positioning Level 3, we tried to generalize the definition in a way that would handle multiple lines:

If the ancestor is an inline box, the containing block is formed by the block-start and inline-start content edges of the first box fragment of the ancestor, and the block-end and inline-end content edges of the last box fragment of the ancestor.

This basically takes (for LTR text) the top/left edges of the first fragment and the bottom/right edges of the last fragment and makes a rectangle of them. The “left” box edge might end up as the “right” containing block edge, but in any case there's a rectangle.

What browsers actually do is demonstrated in this testcase:

The question here is, what actually is the most useful thing to do?