fit-content / max-content do not size content appropriately
Reported by
matthewd...@gmail.com,
Feb 23 2018
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36 Steps to reproduce the problem: 1. Set a container to "width: fit-content" or "width: max-content" 2. Don't set an explicit width on block child content 3. Observe that the element doesn't fill the space. What is the expected behavior? The spec says that fit-content should use the max-content block size up to the finite available space. The max-content block size algorithm (which is also rendering incorrectly in Chrome) should be "The box’s “ideal” size in the block axis. Usually the block size of the content after layout." - https://www.w3.org/TR/css-sizing-3/#max-content-block-size What went wrong? Observe that Firefox calculates fit-content and max-content correctly, by granting block content available space. Currently, Chrome will artificially "shrink" block-level content when the block is in a container with "fit-content" or "max-content". So, a "display: grid" within fit-content will use, say, half of the available viewport width. Note that the algorithm is also incorrect for the CSS grid fit-content() CSS function for grid-column-width, which appears to use the same calculation. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 64.0.3282.167 Channel: stable OS Version: OS X 10.12.6 Flash Version: Shockwave Flash 28.0 r0
,
Feb 23 2018
Able to reproduce the issue on reported chrome version 64.0.3282.167 and on the latest chrome version 66.0.3350.0 using Windows-10, Mac 10.12.6 and Ubuntu 14.04. As the issue is seen from M60(60.0.3072.0) considering it as non-regression and marking it as Untriaged. Thanks!
,
Feb 26 2018
Broken both in legacy layout and LayoutNG.
,
Feb 26 2018
|
||||
►
Sign in to add a comment |
||||
Comment 1 by manoranj...@chromium.org
, Feb 23 2018