New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 809005 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[css-grid] Apply clamping of Automatic Minimum Size to spanning grid items too

Project Member Reported by r...@igalia.com, Feb 5 2018

Issue description

We're not applying the clamping from Automatic Minimum Size [1]
when the item spans several tracks. Like in this example:
  <div style="display: inline-grid; grid-template-columns: minmax(auto, 0px) minmax(auto, 0px); border: solid thick;">
    <div style="background: lime; grid-column: span 2">foobar</div>
  </div>

Where the tracks should be 0px each.

In both Firefox and Edge the tracks are 0px each.
The size of the grid container varies between both browsers,
but that's a different topic.

[1] https://drafts.csswg.org/css-grid/#min-size-auto
 

Comment 1 by r...@igalia.com, Feb 8 2018

Status: Started (was: Available)
Project Member

Comment 2 by bugdroid1@chromium.org, Feb 9 2018

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

commit bf68c01e132f774ee8da264d0d74909ae5c6652d
Author: Manuel Rego Casasnovas <rego@igalia.com>
Date: Fri Feb 09 11:01:06 2018

[css-grid] Apply automatic minimum size clamping to spanning items too

In r783213 we added the conditions from the spec to apply
the automatic minimum size clamping when required
but only to non-spanning items.
See: https://drafts.csswg.org/css-grid/#min-size-auto

This patch moves the code from GridTrackSizingAlgorithm::SizeTrackToFitNonSpanningItem()
to GridTrackSizingAlgorithmStrategy::MinSizeForChild()
that way the clamping is applied for both spanning and non-spanning items.

This somehow reverts r783213, as it was adding some duplicated code.
All the checks to know if we should use that part of the spec
were already present in GridTrackSizingAlgorithmStrategy::MinSizeForChild().

Apart from using the previous code, there's a new loop to verify
that the max track sizing function is fixed for all the tracks of the item.

BUG= 809005 
TEST=external/wpt/css/css-grid/grid-items/grid-minimum-size-grid-items-024.html
TEST=external/wpt/css/css-grid/grid-items/grid-minimum-size-grid-items-025.html

Change-Id: I919a83d152d8263251d3211dd5ebf175f7cf9717
Reviewed-on: https://chromium-review.googlesource.com/910049
Commit-Queue: Manuel Rego Casasnovas <rego@igalia.com>
Reviewed-by: Javier Fernandez <jfernandez@igalia.com>
Cr-Commit-Position: refs/heads/master@{#535683}
[modify] https://crrev.com/bf68c01e132f774ee8da264d0d74909ae5c6652d/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/grid-items/grid-minimum-size-grid-items-022.html
[modify] https://crrev.com/bf68c01e132f774ee8da264d0d74909ae5c6652d/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/grid-items/grid-minimum-size-grid-items-023.html
[add] https://crrev.com/bf68c01e132f774ee8da264d0d74909ae5c6652d/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/grid-items/grid-minimum-size-grid-items-024.html
[add] https://crrev.com/bf68c01e132f774ee8da264d0d74909ae5c6652d/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/grid-items/grid-minimum-size-grid-items-025.html
[modify] https://crrev.com/bf68c01e132f774ee8da264d0d74909ae5c6652d/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp

Comment 3 by r...@igalia.com, Feb 9 2018

Status: Fixed (was: Started)

Sign in to add a comment