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); |
} |
} |