Re: [css3-flexbox] We need a BFC for "intended-to-be-replaced" flex items like <object>, <img>

On 05/21/2012 02:48 PM, Daniel Holbert wrote:
> Hi www-style,
>
> I believe the new "elements that want to be replaced will form flex
> items" magic is still unclear on (at least) one thing.
>
> ( ED spec reference: http://dev.w3.org/csswg/css3-flexbox/#flex-items )
>
> Consider this content, where the<object>  doesn't load anything, which
> makes it render its contents (naked text in this case):
>
>    <div style="display: flex>
>     <object>
>       This is a paragraph of text.
>       [...]
>       Here ends the paragraph of text.
>     </object>
>    </div>
>
> Presumably we'd expect these characteristics:
>   (1) If we add style="width: 100px" on the<object>, it should honor
> that width, just as any other flexbox item would.
>   (2) If we add style="height: 100px" on the<object>, it should honor
> that height, just as any other flexbox item would.
>   (3) The<object>'s box should line-wrap its contents (in this case, a
> paragraph of text), as if it were a block.
>
> However -- since the<object>  is display:inline (by default), it will
> actually generate an inline-level box, which won't have any of the above
> characteristics.  That's bad.

The intention is that all elements that are designated as "flex items" are
actually 'display-outside: flex-item'; those with a 'display-inside' of
'block' or 'inline' would compute to 'display: flex-item'.

Since we don't have a 'display: flex-item' value, for now the computation
follows the block-level-conversion table in CSS2.1:
   http://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo

This means that 'display: block', 'display: inline-block', and HTML replaced
elements with 'display: inline' all behave exactly the same way, and will have
a computed 'display' of 'block' in the present and a computed 'display' of
'flex-item' in the future.

~fantasai

Received on Tuesday, 22 May 2012 00:40:28 UTC