New issue
Advanced search Search tips

Issue 906039 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[css-grid] Grid container sizing with min-content height is wrong

Project Member Reported by r...@igalia.com, Nov 16

Issue description


Open the attached example, it's a grid container with "height: min-content" and "grid-template-rows: minmax(50px, 100px)".
The output should be a 100x100 green square, but it's a 100x50 rectangle.
BTW, this works fine in Firefox (we need to use -moz-min-content there).

We're behaving the same for "height: min-content" than for "width: min-content", but that's wrong per spec (https://drafts.csswg.org/css-sizing/#valdef-width-min-content):
  "min-content
    If specified for the inline axis, use the min-content inline size; otherwise behaves as the property’s initial value."

In the block axis "height: min-content" should behave like "height: auto".
 
bug-min-content-height.html
257 bytes View Download
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9bb0b2a46b18f3222dcd0daadcd8eccb834682da

commit 9bb0b2a46b18f3222dcd0daadcd8eccb834682da
Author: Manuel Rego Casasnovas <rego@igalia.com>
Date: Wed Nov 21 15:12:50 2018

[css-grid] Fix grid container sizing under min-content height

The spec is quite clear
(https://drafts.csswg.org/css-sizing/#valdef-width-min-content):
  "min-content
     If specified for the inline axis, use the min-content inline size;
     otherwise behaves as the property’s initial value."

So if a grid container has "height: min-content" it should behave
the same than with "height: auto".

The patch removes ComputeIntrinsicLogicalContentHeightUsing() in
LayoutGrid as we don't need a custom one anymore.
We can also get rid of min_content_height_ and max_content_height_
attributes that were only used for this logic.

BUG= 906039 
TEST=fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
TEST=fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html

Change-Id: Ia67d1dac16fbb04e3225115c3f34c67975dc6f94
Reviewed-on: https://chromium-review.googlesource.com/c/1340311
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Manuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#610059}
[add] https://crrev.com/9bb0b2a46b18f3222dcd0daadcd8eccb834682da/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/grid-model/grid-container-sizing-constraints-001.html
[modify] https://crrev.com/9bb0b2a46b18f3222dcd0daadcd8eccb834682da/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
[modify] https://crrev.com/9bb0b2a46b18f3222dcd0daadcd8eccb834682da/third_party/WebKit/LayoutTests/fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html
[modify] https://crrev.com/9bb0b2a46b18f3222dcd0daadcd8eccb834682da/third_party/blink/renderer/core/layout/layout_grid.cc
[modify] https://crrev.com/9bb0b2a46b18f3222dcd0daadcd8eccb834682da/third_party/blink/renderer/core/layout/layout_grid.h

Status: Fixed (was: Started)

Sign in to add a comment