New issue
Advanced search Search tips

Issue 902863 link

Starred by 4 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 918766



Sign in to add a comment

min-content, max-content and fit-content should behave as initial value in block axis

Project Member Reported by dholb...@gmail.com, Nov 7

Issue description

Chrome Version: 72.0.3595.2 (Official Build) dev (64-bit)
OS: Ubuntu 18.10

What steps will reproduce the problem?
(1) Load attached testcase, or visit https://jsfiddle.net/s9bw6j4c/

What is the expected result?
 No red should be visible. (i.e. the black-bordered areas should all be 0-height)

What happens instead?
In the first two chunks, there is a large rectangle visible (i.e. the black bordered area expands *beyond* its specified "height:0px" to encompass its child's height)


Chrome is improperly honoring "min-height: min-content"/"max-content" here -- if you remove that line, the rendering switches to the correct rendering, as shown in the third chunk of this testcase.

The css-sizing-3 spec says that min-content and max-content only resolve to the content size in the inline axis, and "otherwise behaves as the property’s initial value".  So in this case, it should behave as if it weren't specified, but that's not what happens in Chrome.

Spec link:
https://drafts.csswg.org/css-sizing-3/#valdef-width-min-content

Firefox 64 beta & 65 Nightly (which support these prefixed keywords in the block dimension) gives the expected behavior.

(Edge and earlier Firefox versions give the expected behavior, too, but only because they don't support these keywords -- not in the block dimension at least, for older Firefox versions.)

Note: I ran into a version of this causing a compatibility issue on Facebook.com -- see https://github.com/webcompat/web-bugs/issues/21006 for details. (That case has to do with the "min-height:auto" special case on flex items with overflow:hidden, where it resolves to 0.   Facebook is naiively trying to opt out of that special case by specifying "min-height:max-content", but per spec, that should behave like the initial value and so should still resolve to 0. But it doesn't in Chrome.)
 
test-keywords.html
591 bytes View Download
Safari/WebKit has the same bug - I filed https://bugs.webkit.org/show_bug.cgi?id=191390 over there.
Cc: emilio@chromium.org
Cc: cbiesin...@chromium.org mstensho@chromium.org
Status: Available (was: Untriaged)
Failing in LayoutNG, too.
Cc: r...@chromium.org jfernan...@igalia.com
Issue 906530 has been merged into this issue.
Labels: -Pri-3 Pri-2
Cc: -r...@chromium.org r...@igalia.com
Issue #906530 was not about min-height, but it happens with height too, and only happens with scrollbars.
BTW the example in issue #906530 works fine in WebKit.
So I'm not sure if it's actually a duplicate.
Summary: min-content, max-content and fit-content should behave as initial value in block axis (was: "min-content" & "max-content" keywords should behave as initial value in block axis (but Chrome improperly treats them as the content-size))
It's all about falling back to the initial value for min-content and max-content in the block direction, as far as I can tell?

Should include fit-content too, though. Updated summary.

-webkit-fill-available is non-standard, so whatever we do is right, I suppose. :)
It can be related but the example from dholbert doesn't have scrollbars, and in my example they're quite important.

Regarding -webkit-fill-available, I'm not sure if the attached image (from my example) is right, despite not being a standard.
Screenshot from 2018-11-20 13-24-23.png
1.1 KB View Download
I agree with Rego that, at best, this bug is a subset of the other one; will reopen his bug.
Blocking: 918766

Sign in to add a comment