Re: [css-containment] "contain:layout" mixed with "display:inline" and block-in-inline

I'm also curious about the same scenario with "contain:paint", BTW.
Should each of the <span>'s boxes here (but not the <div>) have paint
containment applied to its content area?

~Daniel


On 06/09/2015 01:34 PM, Daniel Holbert wrote:
> What's supposed to happen if I have content like:
> 
>   <span style="display:inline;contain: layout">
>     aaa
>     <div style="display:block">bbb</div>
>     ccc
>   </span>
> 
> 
> In particular: should there be a block-in-inline split, to pull the
> <div>'s box out of its inline-level parent element?
> 
> (and if not: does that mean we end up with a block whose actual box-tree
> parent is "display:inline"?  Wouldn't that break CSS's assumptions about
> block-level boxes having block-level parents?)
> 
> The spec text about layout containment is:
> http://dev.w3.org/csswg/css-containment/#layout-containment
> 
> Quoting:
>   # 1. When laying out the containing element,
>   # it must be treated as having no contents.
> 
> (This sounds like no split should happen, because we ignore the div when
> layout out the span.)
> 
> ...and:
>  # 2. The element must be a formatting context.
> 
> I don't know what this actually is trying to say. At first I thought it
> might mean the "display:inline" would end up being block-inside or
> something, but then I rediscovered that there is such a thing as an
> "inline formatting context". So I don't think (2) really does anything
> special for this case.
> 
> Perhaps we need "contain" to blockify the display value? (similar to
> floats, abspos stuff, and flex/grid-item)
> 
> Thanks,
> ~Daniel
> 

Received on Tuesday, 9 June 2015 21:42:53 UTC