[csswg-drafts] [css-grid][css-flexbox] Blockification section should use the computed value, not the box of the element (#4065)

emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-grid][css-flexbox] Blockification section should use the computed value, not the box of the element ==
Right now https://drafts.csswg.org/css-grid/#grid-item-display says:

> The display value of a grid item is blockified: if the specified display of an in-flow child of an element generating a grid container is an inline-level value, it computes to its block-level equivalent. (See CSS2.1§9.7 [CSS21] and CSS Display [CSS3-DISPLAY] for details on this type of display value conversion.)

Similarly https://drafts.csswg.org/css-flexbox/#flex-items says:

> The display value of a flex item is blockified: if the specified display of an in-flow child of an element generating a flex container is an inline-level value, it computes to its block-level equivalent. (See CSS2.1§9.7 [CSS21] and CSS Display [CSS3-DISPLAY] for details on this type of display value conversion.)

As @Loirooriol pointed out in https://bugzilla.mozilla.org/show_bug.cgi?id=1562039, this doesn't match browsers, and browsers use the computed display value of the closest non-`display: contents` ancestor, even if the element doesn't become a flex or grid container (due to it being replaced for example, or it being in a `display: none` subtree).

I think the spec in this case should match browsers in this case, in order to not make style of children depend on layout box construction. This also matches how the [CSS 2 fixups](https://drafts.csswg.org/css2/visuren.html#dis-pos-flo) work. The root element is blockified even if it's a replaced element or wouldn't generate an inline-level box otherwise.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4065 using your GitHub account

Received on Friday, 28 June 2019 09:06:26 UTC