[css-grid][css-align] Intrinsic size of replaced elements, and no shrink-to-fit algorithm

Hi,

 

I received an interesting bug report [1] about the “stretch” behavior of
<video> elements in my css-grid polyfill. The bug reports states it doesn’t
work the same way in all browsers, which I would argue is a browser bug and
not a bug of my polyfill. The cross-browser issue is that the <video>
elements is sized % the video content in Firefox, where it is using the
default replaced element size in the other browsers I tested in. Both seem
reasonable, but images work like <video> does in Firefox.

 

The issue, though, is relevant to the working group because I’m not sure
whether or not I should be “fixing” the bug by forcing one behavior or
another. The problem is that the <img> or <video> element with “auto-height
auto-width” have a default size. If that size is bigger than the size of the
cell, the CSS Alignment specs tells us not to shrink-to-fit, resulting in
overflow. However, if I enforced a size on the element, its content would
properly auto-fit inside its new size, even if it’s smaller than what it
prefers to be sized.

 

So, my question is: should I do like if those replaced elements “which can
shrink-to-fit” didn’t have any intrinsic size at all when doing my layout
pass? If yes (or no), should I accept to shrink-to-fit them if it turns out
the cell they’re in is too small for them? I’m not sure where to look at for
this kind of three-or-more-specs-involved behaviors.

 

Thank you already for your research on the matter,

François

 

[1] https://github.com/FremyCompany/css-grid-polyfill/issues/22

Received on Tuesday, 12 May 2015 16:18:48 UTC