Chromium Code Reviews| 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 9f538821e67418d11cc5f8fc6fef418f1c31d3ea..cf284585ba917805f3d5a477636df36208b44243 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp |
| @@ -1522,21 +1522,24 @@ void LayoutGrid::offsetAndBreadthForPositionedChild(const LayoutBox& child, Grid |
| || (endLine < firstExplicitLine) |
| || (endLine > lastExplicitLine); |
| - LayoutUnit start = startIsAuto ? LayoutUnit() : isForColumns ? m_columnPositions[startLine] : m_rowPositions[startLine]; |
| - LayoutUnit end = endIsAuto ? isForColumns ? logicalWidth() : logicalHeight() : isForColumns ? m_columnPositions[endLine] : m_rowPositions[endLine]; |
| - |
| - breadth = end - start; |
| - |
| - if (startIsAuto) |
| - breadth -= isForColumns ? borderStart() : borderBefore(); |
| - else |
| - start -= isForColumns ? borderStart() : borderBefore(); |
| + // We're normalizing the positions to avoid issues with RTL (as they're stored in the same order than LTR but adding an offset). |
| + LayoutUnit start; |
| + if (!startIsAuto) { |
| + if (isForColumns) |
|
jfernandez
2016/03/29 12:24:35
I think we must use an isXXAxis terminologym, inst
|
| + start = m_columnPositions[startLine] - m_columnPositions[0] + paddingStart(); |
| + else |
| + start = m_rowPositions[startLine] - m_rowPositions[0] + paddingBefore(); |
| + } |
| - if (endIsAuto) { |
| - breadth -= isForColumns ? borderEnd() : borderAfter(); |
| - breadth -= scrollbarLogicalWidth(); |
| + LayoutUnit end = isForColumns ? clientLogicalWidth() : clientLogicalHeight(); |
| + if (!endIsAuto) { |
| + if (isForColumns) |
|
jfernandez
2016/03/29 12:24:35
Ditto
|
| + end = m_columnPositions[endLine] - m_columnPositions[0] + paddingStart(); |
| + else |
| + end = m_rowPositions[endLine] - m_rowPositions[0] + paddingBefore(); |
| } |
| + breadth = end - start; |
| offset = start; |
| if (child.parent() == this && !startIsAuto) { |