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

Issue 666940 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 79180



Sign in to add a comment

[css-grid] Clamping grid item Automatic Minimum Size isn't working

Project Member Reported by mpalmg...@mozilla.com, Nov 18 2016

Issue description

Version: 56.0.2914.3 (Official Build) dev (64-bit)
OS: Linux

What steps will reproduce the problem?
(1) load the attached testcase
(2)
(3)

What is the expected result?
See attached screenshot (from Nightly https://nightly.mozilla.org/)

Here's the relevant CSS Grid spec text:
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)."

 
grid-item-auto-min-size-clamp-001.html
4.0 KB View Download
grid-item-auto-min-size-clamp-001.png
30.4 KB View Download
FYI, this also affects many other types of grid items, not just blocks.
Here's an <iframe> example.
grid-item-iframe.html
503 bytes View Download
I would appreciate it if you fix this before enabling Grid by default,
because otherwise I suspect it will cause web-compat issues.  Thanks.
Affects image grid items as well.

Comment 5 by r...@igalia.com, Nov 21 2016

Blocking: 79180
Cc: svil...@igalia.com jfernan...@igalia.com tabatkins@chromium.org
Owner: r...@igalia.com
Status: Available (was: Untriaged)
I'm sorry but I'm not sure that's the expected behavior.
I've been discussing this with fantasai on GitHub:
https://github.com/w3c/csswg-drafts/issues/283#issuecomment-247545477

She says that "stretch" and "start" cases should be different.
I'm attaching a simple example where it's clear the difference between
Chromium and Firefox.

Adding Tab on CC if he wants to clarify the topic.

minimum-size.html
981 bytes View Download
minimum-size-chromium.png
29.1 KB View Download
minimum-size-firefox.png
45.3 KB View Download

Comment 6 by e...@chromium.org, Jan 26 2017

Labels: -Pri-1 Pri-2
Any update on this?
The CSSWG resolution is that, for replaced elements, "nor4mal" equals "start" - that is, no stretching takes places.

This is because, for replaced elements, you really want to pay attention to the intrinsic aspect ratio.  You don't want to fully stretch, as normal elements do, to the dimensions of the grid area, because it distorts the element.

Instead, per WG resolution, we're going to introduce the "contain" keyword to 'width' and 'height', which fills the area while respecting the aspect ratio.  But absent that, replaced elements just default to being start/start aligned.

Comment 8 by r...@igalia.com, Jan 27 2017

This bug is not about replaced elements, that one is  bug #666961 .
And yeah we need to review and update our implementation there.
We didn't do anything regarding "normal" and replaced elements yet.
We were waiting for the CSS WG resolution which seems now clear in:
https://github.com/w3c/csswg-drafts/issues/523

This bug is about regular elements and implied minimum size.
I believe current Chromium behavior is correct
given the last comment by fantasai at:
https://github.com/w3c/csswg-drafts/issues/283#issuecomment-268125974

Project Member

Comment 9 by bugdroid1@chromium.org, Feb 25 2017

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

commit 71efe49d24b1154125e1f07e772151794a156265
Author: rego <rego@igalia.com>
Date: Sat Feb 25 15:18:05 2017

[css-grid] Unskip Automatic Implied Minimum Size tests

The tests have been updated upstream on csswg-test repository,
so we don't need to skip them anymore.

There are 2 tests failing out of 18 checking this feature:
* 007 & 009: These are related to transferred size of
  replaced grid items ( crbug.com/555027 ).

BUG= 666940 

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

[modify] https://crrev.com/71efe49d24b1154125e1f07e772151794a156265/third_party/WebKit/LayoutTests/TestExpectations

Comment 10 by r...@igalia.com, Mar 2 2017

Status: Fixed (was: Available)
I've updated the test suite and we're now passing it on Chromium:
https://github.com/w3c/csswg-drafts/issues/283#issuecomment-279987986

I believe this is the right behavior, but I might be missing something.
Please reopen this if needed.

Sign in to add a comment