New issue
Advanced search Search tips

Issue 816300 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , iOS , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug



Sign in to add a comment

[css-grid] 'grid-gap: calc(0px + 10%)' is resolved as 0px with a definite width/height

Project Member Reported by mpalmg...@mozilla.com, Feb 25 2018

Issue description

Chrome Version: 65.0.3311.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?
The first grid should have the same gap between the items as the 2nd/3rd examples.

What happens instead?
The first grid appears to have zero grid gaps.
 
percent-grid-gap-001.html
984 bytes View Download

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

Cc: svil...@igalia.com jfernan...@igalia.com
Status: Available (was: Untriaged)
Thanks for the bug report.

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

Owner: r...@igalia.com
Status: Started (was: Available)
There was actually a crash on debug due to the following assert
https://chromium.googlesource.com/chromium/src/+/f8781418ce126ab08de6a82eef749d4c3bef5080/third_party/WebKit/Source/core/style/GapLength.h#19
as it doesn't consider "calc()" there.
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 14 2018

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

commit 35d044cf27bde7781ab720f20803e35c07ee833d
Author: Manuel Rego Casasnovas <rego@igalia.com>
Date: Wed Mar 14 14:32:33 2018

[css-grid] Add support for calc() in gutter properties

There was a crash in debug if you use calc()
mixing fixed and percentage values due to the wrong DCHECK
in GapLength constructor. The patch fixes this assert.

In addition LayoutGrid::GridGap() was also wrong and didn't consider
calc() either. The fix is again easy just using the proper check.

Regarding testing, the parsing tests have been updated to include
this combination of fixed and percentage values in calc().
At the same time, the patch actually uses "grid-" prefixed properties
in the tests that were supposed to test those.
Last, two new tests are added to verify the proper behavior of calc()
with mixed values on a grid layout container.

BUG= 816300 
TEST=external/wpt/css/css-align/gaps/column-gap-parsing-001.html
TEST=external/wpt/css/css-align/gaps/gap-parsing-001.html
TEST=external/wpt/css/css-align/gaps/grid-column-gap-parsing-001.html
TEST=external/wpt/css/css-align/gaps/grid-gap-parsing-001.html
TEST=external/wpt/css/css-align/gaps/grid-row-gap-parsing-001.html
TEST=external/wpt/css/css-align/gaps/row-gap-parsing-001.html
TEST=external/wpt/css/css-grid/alignment/grid-gutters-011.html
TEST=external/wpt/css/css-grid/alignment/grid-gutters-012.html

Change-Id: I4c9fe6b2525a253c6bb00cbda727c2bf1ae6e90b
Reviewed-on: https://chromium-review.googlesource.com/962148
Commit-Queue: Manuel Rego Casasnovas <rego@igalia.com>
Reviewed-by: Sergio Villar <svillar@igalia.com>
Cr-Commit-Position: refs/heads/master@{#543079}
[modify] https://crrev.com/35d044cf27bde7781ab720f20803e35c07ee833d/third_party/WebKit/LayoutTests/external/wpt/css/css-align/gaps/column-gap-parsing-001.html
[modify] https://crrev.com/35d044cf27bde7781ab720f20803e35c07ee833d/third_party/WebKit/LayoutTests/external/wpt/css/css-align/gaps/gap-parsing-001.html
[modify] https://crrev.com/35d044cf27bde7781ab720f20803e35c07ee833d/third_party/WebKit/LayoutTests/external/wpt/css/css-align/gaps/grid-column-gap-parsing-001.html
[modify] https://crrev.com/35d044cf27bde7781ab720f20803e35c07ee833d/third_party/WebKit/LayoutTests/external/wpt/css/css-align/gaps/grid-gap-parsing-001.html
[modify] https://crrev.com/35d044cf27bde7781ab720f20803e35c07ee833d/third_party/WebKit/LayoutTests/external/wpt/css/css-align/gaps/grid-row-gap-parsing-001.html
[modify] https://crrev.com/35d044cf27bde7781ab720f20803e35c07ee833d/third_party/WebKit/LayoutTests/external/wpt/css/css-align/gaps/row-gap-parsing-001.html
[add] https://crrev.com/35d044cf27bde7781ab720f20803e35c07ee833d/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/alignment/grid-gutters-011.html
[add] https://crrev.com/35d044cf27bde7781ab720f20803e35c07ee833d/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/alignment/grid-gutters-012.html
[modify] https://crrev.com/35d044cf27bde7781ab720f20803e35c07ee833d/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
[modify] https://crrev.com/35d044cf27bde7781ab720f20803e35c07ee833d/third_party/WebKit/Source/core/style/GapLength.h

Comment 4 by r...@igalia.com, Mar 14 2018

Status: Fixed (was: Started)

Comment 5 by r...@igalia.com, Mar 15 2018

Cc: e...@chromium.org
Labels: Merge-Request-66
This issue was introduced by https://chromium.googlesource.com/chromium/src/+/406010c4b4e27073d52f2d7af881a302d1beae99

The bug was already present before, but the crash in debug
when you uses "grid-column-gap: calc(10px + 10%);"
is due to a DCHECK added on that commit.

The patch is fairly simple, basically changing the conditions in 2 lines,
maybe it's worth merge it in 66. If it's too late that should be fine too.
Asking just in case. WDYT?

Comment 6 by cmasso@google.com, Mar 15 2018

Please add affected OSes

Comment 7 by cmasso@google.com, Mar 15 2018

Warnings:
Merge requests should specify the affected OS(es) so that requests are routed appropriately
Project Member

Comment 8 by sheriffbot@chromium.org, Mar 15 2018

Labels: -Merge-Request-66 Merge-Reject-66 Hotlist-Merge-Reject
The bug is marked as P3 or Feature. It should not be merged as M66 is in beta. 
Please contact the approriate milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), josafat@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 9 by r...@igalia.com, Mar 15 2018

Labels: OS-Android OS-Chrome OS-Fuchsia OS-iOS OS-Linux OS-Mac OS-Windows
Ok, thanks for the feedback. BTW it affects all OSes, sorry for not marking it before.

I guess it's not very important as it's only a DCHECK on debug builds,
I was just checking what other things as the patch is very simple.
Project Member

Comment 10 by bugdroid1@chromium.org, Jun 22 2018

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

commit 87317b87f3194989be5e6c7eb67f11a099dbaaf5
Author: Manuel Rego Casasnovas <rego@igalia.com>
Date: Fri Jun 22 19:26:55 2018

[css-grid] Fix positioned items in a grid with calc() gutters

In r543079 we added support for calc() in grid gutters.
In that patch we modified LayoutGrid::GridGap() but we forgot
to do the same in LayoutGrid::AvailableSpaceForGutters().

This patch just changes the IsPercent() call by IsPercentOrCalc()
that way calc() gutters are considered too when looking
for the available space.

BUG= 816300 
TEST=external/wpt/css/css-grid/abspos/grid-positioned-items-gaps-002.html
TEST=external/wpt/css/css-grid/abspos/grid-positioned-items-gaps-002-rtl.html

Change-Id: I3237d5dc73f508cea6d904b9f1fd3822bb9efe55
Reviewed-on: https://chromium-review.googlesource.com/1112237
Reviewed-by: Sergio Villar <svillar@igalia.com>
Commit-Queue: Manuel Rego Casasnovas <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#569733}
[add] https://crrev.com/87317b87f3194989be5e6c7eb67f11a099dbaaf5/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/abspos/grid-positioned-items-gaps-002-rtl.html
[add] https://crrev.com/87317b87f3194989be5e6c7eb67f11a099dbaaf5/third_party/WebKit/LayoutTests/external/wpt/css/css-grid/abspos/grid-positioned-items-gaps-002.html
[modify] https://crrev.com/87317b87f3194989be5e6c7eb67f11a099dbaaf5/third_party/blink/renderer/core/layout/layout_grid.cc

Sign in to add a comment