[css-grid] 'grid-gap: calc(0px + 10%)' is resolved as 0px with a definite width/height |
||||||
Issue descriptionChrome 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.
,
Mar 14 2018
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.
,
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
,
Mar 14 2018
,
Mar 15 2018
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?
,
Mar 15 2018
Please add affected OSes
,
Mar 15 2018
Warnings: Merge requests should specify the affected OS(es) so that requests are routed appropriately
,
Mar 15 2018
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
,
Mar 15 2018
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.
,
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 |
||||||
Comment 1 by r...@igalia.com
, Feb 26 2018Status: Available (was: Untriaged)