Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/line/InlineBox.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/line/InlineBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineBox.cpp |
| index 9cf7c1914f003d745f6f3daee2ae093911a2cec3..ddbfb119d306d5ad41e48b59f84cbf8504409221 100644 |
| --- a/third_party/WebKit/Source/core/layout/line/InlineBox.cpp |
| +++ b/third_party/WebKit/Source/core/layout/line/InlineBox.cpp |
| @@ -213,7 +213,7 @@ void InlineBox::attachLine() { |
| } |
| void InlineBox::move(const LayoutSize& delta) { |
| - m_topLeft.move(delta); |
| + m_location.move(delta); |
| if (getLineLayoutItem().isAtomicInlineLevel()) |
| LineLayoutBox(getLineLayoutItem()).move(delta.width(), delta.height()); |
| @@ -313,7 +313,7 @@ bool InlineBox::canAccommodateEllipsis(bool ltr, |
| if (!getLineLayoutItem().isAtomicInlineLevel()) |
| return true; |
| - IntRect boxRect(left().toInt(), 0, m_logicalWidth.toInt(), 10); |
| + IntRect boxRect(x().toInt(), 0, m_logicalWidth.toInt(), 10); |
| IntRect ellipsisRect(ltr ? blockEdge - ellipsisWidth : blockEdge, 0, |
| ellipsisWidth, 10); |
| return !(boxRect.intersects(ellipsisRect)); |
| @@ -336,35 +336,16 @@ void InlineBox::clearKnownToHaveNoOverflow() { |
| parent()->clearKnownToHaveNoOverflow(); |
| } |
| -LayoutPoint InlineBox::locationIncludingFlipping() const { |
| - return logicalPositionToPhysicalPoint(m_topLeft, size()); |
| -} |
| - |
| -LayoutPoint InlineBox::logicalPositionToPhysicalPoint( |
| - const LayoutPoint& point, |
| - const LayoutSize& size) const { |
| - if (!UNLIKELY(getLineLayoutItem().hasFlippedBlocksWritingMode())) |
| - return LayoutPoint(point.x(), point.y()); |
| - |
| - LineLayoutBlockFlow block = root().block(); |
| - if (block.style()->isHorizontalWritingMode()) |
| - return LayoutPoint(point.x(), |
|
chrishtr
2016/11/28 15:13:29
This old code looks backward to me now...why is it
Xianzhu
2016/11/28 18:42:36
This seems for horizontal-bt which is not supporte
|
| - block.size().height() - size.height() - point.y()); |
| - |
| - return LayoutPoint(block.size().width() - size.width() - point.x(), |
| - point.y()); |
| +LayoutPoint InlineBox::physicalLocation() const { |
| + LayoutRect rect(location(), size()); |
| + flipForWritingMode(rect); |
| + return rect.location(); |
| } |
| void InlineBox::logicalRectToPhysicalRect(LayoutRect& current) const { |
|
chrishtr
2016/11/28 15:13:29
Please unittest this.
Xianzhu
2016/11/28 18:42:36
Done.
|
| - if (isHorizontal() && !getLineLayoutItem().hasFlippedBlocksWritingMode()) |
| - return; |
| - |
| - if (!isHorizontal()) { |
| + if (!isHorizontal()) |
| current = current.transposedRect(); |
| - } |
| - current.setLocation( |
| - logicalPositionToPhysicalPoint(current.location(), current.size())); |
| - return; |
| + flipForWritingMode(current); |
| } |
| void InlineBox::flipForWritingMode(FloatRect& rect) const { |