Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutGrid.cpp

Issue 2325573003: [css-grid] Avoid computing available space if gap is not a percentage (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutGrid.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
index ea4d9ff9a84367692c6ed0672561fcf4c7a4521a..c76dd7d4fd35df8cd800ba1964120a2db2a3be4e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -532,11 +532,12 @@ bool LayoutGrid::isEmptyAutoRepeatTrack(GridTrackSizingDirection direction, size
LayoutUnit LayoutGrid::gridGapForDirection(GridTrackSizingDirection direction, SizingOperation sizingOperation) const
{
LayoutUnit availableSize;
- if (sizingOperation == TrackSizing)
+ const Length& gap = direction == ForColumns ? styleRef().gridColumnGap() : styleRef().gridRowGap();
+ if (sizingOperation == TrackSizing && gap.isPercent())
availableSize = direction == ForColumns ? availableLogicalWidth() : availableLogicalHeightForPercentageComputation();
// TODO(rego): Maybe we could cache the computed percentage as a performance improvement.
- return valueForLength(direction == ForColumns ? styleRef().gridColumnGap() : styleRef().gridRowGap(), availableSize);
+ return valueForLength(gap, availableSize);
}
LayoutUnit LayoutGrid::guttersSize(GridTrackSizingDirection direction, size_t startLine, size_t span, SizingOperation sizingOperation) const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698