New issue
Advanced search Search tips

Issue 653433 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 79180



Sign in to add a comment

[css-grid] New expected behavior for stretch

Project Member Reported by r...@igalia.com, Oct 6 2016

Issue description


There were some discussion on GitHub about minimum size of grid items:
https://github.com/w3c/csswg-drafts/issues/283

The spec has been modified so it now includes the following sentence (https://drafts.csswg.org/css-grid/#min-size-auto):
"However, if the grid item spans only grid tracks that have a fixed max track sizing function, its automatic minimum size in that dimension is further clamped to less than or equal to the size necessary to fit its margin box within the resulting grid area (flooring at zero)."

This has changed quite a lot the default behavior, so if a grid cell is very small the item should be shrunk to fit into that cell.
 
issue-stretch.html
192 bytes View Download
issue-stretch-current.png
1.6 KB View Download
issue-stretch-expected.png
1.7 KB View Download
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 7 2016

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

commit da340247a837f07594b3fcfb59a4e4493dc0fd45
Author: rego <rego@igalia.com>
Date: Fri Oct 07 12:34:06 2016

[css-grid] Stretch should grow and shrink items to fit its grid area

After some discussions the CSS WG agreed that stretch should not only
grow items, but also stretch them to fit its grid area.
That way the "min-width|height: auto" is somehow ignored for grid items.
More info at: https://github.com/w3c/csswg-drafts/issues/283

The good part is that this allows us to remove some ugly code we've
in LayoutBox that was only used by Grid Layout.

The tests have been updated according to the new expected behavior.

For images, we'll be stretching on both axis right nos, so the aspect
ratio won't be preserved. The default behavior might change in those
cases, but that should be implemented in a different patch.

BUG= 653433 

Review-Url: https://codereview.chromium.org/2398043002
Cr-Commit-Position: refs/heads/master@{#423839}

[modify] https://crrev.com/da340247a837f07594b3fcfb59a4e4493dc0fd45/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-container-percentage-columns.html
[modify] https://crrev.com/da340247a837f07594b3fcfb59a4e4493dc0fd45/third_party/WebKit/LayoutTests/fast/css-grid-layout/min-width-height-auto-and-margins.html
[modify] https://crrev.com/da340247a837f07594b3fcfb59a4e4493dc0fd45/third_party/WebKit/LayoutTests/fast/css-grid-layout/min-width-height-auto.html
[modify] https://crrev.com/da340247a837f07594b3fcfb59a4e4493dc0fd45/third_party/WebKit/Source/core/layout/LayoutBox.cpp

Comment 2 by r...@igalia.com, Oct 7 2016

Status: Fixed (was: Started)

Sign in to add a comment