New issue
Advanced search Search tips

Issue 814991 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

fit-content / max-content do not size content appropriately

Reported by matthewd...@gmail.com, Feb 23 2018

Issue description

UserAgent: 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
 
test.html
532 bytes View Download
Chrome.png
9.8 KB View Download
Firefox.png
8.4 KB View Download
Labels: Needs-Triage-M64
Labels: Triaged-ET M-66 FoundIn-66 Target-66 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
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!

Comment 3 by e...@chromium.org, Feb 26 2018

Components: -Blink>CSS Blink>Layout
Owner: kojii@chromium.org
Status: Assigned (was: Untriaged)
Broken both in legacy layout and LayoutNG.

Comment 4 Deleted

Comment 5 by e...@chromium.org, Feb 26 2018

Status: Available (was: Assigned)

Sign in to add a comment