New issue
Advanced search Search tips

Issue 592975 link

Starred by 1 user

Issue metadata

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

Blocking:
issue 79180



Sign in to add a comment

[css-grid] Incorrect height when item has intrinsic aspect ratio and a definite width

Project Member Reported by svil...@igalia.com, Mar 8 2016

Issue description

Implied Minimum Size section in the specs (https://drafts.csswg.org/css-grid/#min-size-auto) specifies how to compute the value of min-width|height: auto for items with intrinsic aspect ratios.

We're doing it correctly if the height of the item is specified (the width is automatically computed using the intrinsic aspect ratio). The problem, as seen in the attached file, is that we don't do that for heights when the width is specified.
 
sample.html
598 bytes View Download

Comment 1 by svil...@igalia.com, Mar 9 2016

Summary: [css-grid] Incorrect height when item has intrinsic aspect ratio and a definite width (was: [css-grid] Transferred size is not used for heights)

Comment 2 by r...@igalia.com, Mar 14 2016

Cc: jfernan...@igalia.com r...@igalia.com
Status: Assigned (was: Untriaged)

Comment 3 by r...@igalia.com, Mar 18 2016

Attaching the same use case, but using fixed sized tracks.

Defining a small cell 20x10, the last image is 50px height when it should be 25px height.

Note that if you use "justify|align-items: start;" in this example, the issue is not happening anymore.
sample-fixed.html
699 bytes View Download
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 21 2016

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

commit f76b5035ab7d677198849bff6cd5c3aa17d78468
Author: svillar <svillar@igalia.com>
Date: Mon Mar 21 14:53:09 2016

[css-grid] Fix height computation for items with intrinsic aspect ratios

We were not computing the height properly for items spanning content
or flexible sized tracks having intrinsic aspect ratios because we were
returning always the "natural" size, meaning that on an image of 100x50
we're always returning 50, even if the image had a specified width.

This change allowed us also to remove a bunch of code imported from flexbox
renderer which is actually not really needed in grid.

BUG= 592975 

Review URL: https://codereview.chromium.org/1778853002

Cr-Commit-Position: refs/heads/master@{#382287}

[add] https://crrev.com/f76b5035ab7d677198849bff6cd5c3aa17d78468/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-automatic-minimum-intrinsic-aspect-ratio.html
[add] https://crrev.com/f76b5035ab7d677198849bff6cd5c3aa17d78468/third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/blue-100x50.png
[modify] https://crrev.com/f76b5035ab7d677198849bff6cd5c3aa17d78468/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
[modify] https://crrev.com/f76b5035ab7d677198849bff6cd5c3aa17d78468/third_party/WebKit/Source/core/layout/LayoutGrid.h

Comment 5 by r...@igalia.com, Oct 6 2016

Components: Blink>Layout>Grid

Comment 6 by svil...@igalia.com, Oct 20 2016

Status: Fixed (was: Assigned)
Already fixed

Sign in to add a comment