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

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

Issue 1841323003: [css-grid] Fix positioned items with grid gaps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-positioned-rtl-after-refactoring
Patch Set: Patch for landing Created 4 years, 9 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 | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-gaps-rtl.html ('k') | 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 ac6717df3c10aaeaf3018ac450a0efde495a3224..b80d0bfdbf7531ec067a96b3fe6444b87d93ec30 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -1537,6 +1537,10 @@ void LayoutGrid::offsetAndBreadthForPositionedChild(const LayoutBox& child, Grid
end = m_columnPositions[endLine] - m_columnPositions[0] + paddingStart();
else
end = m_rowPositions[endLine] - m_rowPositions[0] + paddingBefore();
+
+ // These vectors store line positions including gaps, but we shouldn't consider them for the edges of the grid.
+ if (endLine > firstExplicitLine && endLine < lastExplicitLine)
+ end -= guttersSize(direction, 2);
}
breadth = end - start;
@@ -1551,6 +1555,9 @@ void LayoutGrid::offsetAndBreadthForPositionedChild(const LayoutBox& child, Grid
LayoutUnit alignmentOffset = m_columnPositions[0] - borderAndPaddingStart();
LayoutUnit offsetFromLastLine = m_columnPositions[m_columnPositions.size() - 1] - m_columnPositions[endLine];
offset = paddingLeft() + alignmentOffset + offsetFromLastLine;
+
+ if (endLine > firstExplicitLine && endLine < lastExplicitLine)
+ offset += guttersSize(direction, 2);
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-items-gaps-rtl.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698