Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/line/InlineBox.h |
| diff --git a/third_party/WebKit/Source/core/layout/line/InlineBox.h b/third_party/WebKit/Source/core/layout/line/InlineBox.h |
| index 5d9c61c8b38afe9cd0b57a326d33b487077b3c26..f4ce75ef8105dfbfa6c0dfd3966dacc47857640e 100644 |
| --- a/third_party/WebKit/Source/core/layout/line/InlineBox.h |
| +++ b/third_party/WebKit/Source/core/layout/line/InlineBox.h |
| @@ -73,7 +73,7 @@ class CORE_EXPORT InlineBox : public DisplayItemClient { |
| m_prev(prev), |
| m_parent(parent), |
| m_lineLayoutItem(item), |
| - m_topLeft(topLeft), |
| + m_location(topLeft), |
| m_logicalWidth(logicalWidth) |
| #if ENABLE(ASSERT) |
| , |
| @@ -223,18 +223,18 @@ class CORE_EXPORT InlineBox : public DisplayItemClient { |
| const RootInlineBox& root() const; |
| RootInlineBox& root(); |
| - // x() is the left side of the box in the containing block's coordinate |
| - // system. |
| - void setX(LayoutUnit x) { m_topLeft.setX(x); } |
| - LayoutUnit x() const { return m_topLeft.x(); } |
| - LayoutUnit left() const { return m_topLeft.x(); } |
| + // x() is the left side of the box in the containing block's "physical |
| + // coordinates with flipped blocks direction". |
|
szager1
2016/11/28 23:03:09
This needs a more detailed explanation.
wkorman
2016/11/29 00:02:13
Agree, we can add a brief description here and cou
Xianzhu
2016/11/29 01:44:17
Done.
|
| + void setX(LayoutUnit x) { m_location.setX(x); } |
| + LayoutUnit x() const { return m_location.x(); } |
| - // y() is the top side of the box in the containing block's coordinate system. |
| - void setY(LayoutUnit y) { m_topLeft.setY(y); } |
| - LayoutUnit y() const { return m_topLeft.y(); } |
| - LayoutUnit top() const { return m_topLeft.y(); } |
| + // y() is the top side of the box in the containing block's physical |
| + // coordinates. |
|
wkorman
2016/11/29 00:02:13
Comment should fit with the one for x() above, is
Xianzhu
2016/11/29 01:44:17
Added:
It's actually in the same coordinate space
|
| + void setY(LayoutUnit y) { m_location.setY(y); } |
| + LayoutUnit y() const { return m_location.y(); } |
| + LayoutUnit top() const { return m_location.y(); } |
|
wkorman
2016/11/29 00:17:00
Do we still need this? Why do we need this but not
Xianzhu
2016/11/29 01:44:17
Removed.
|
| - const LayoutPoint& topLeft() const { return m_topLeft; } |
| + const LayoutPoint& location() const { return m_location; } |
|
wkorman
2016/11/29 00:02:13
And we should comment this similarly.
Xianzhu
2016/11/29 01:44:17
Done.
|
| LayoutUnit width() const { |
| return isHorizontal() ? logicalWidth() : logicalHeight(); |
| @@ -243,13 +243,11 @@ class CORE_EXPORT InlineBox : public DisplayItemClient { |
| return isHorizontal() ? logicalHeight() : logicalWidth(); |
| } |
| LayoutSize size() const { return LayoutSize(width(), height()); } |
| - LayoutUnit right() const { return left() + width(); } |
| - LayoutUnit bottom() const { return top() + height(); } |
| // The logicalLeft position is the left edge of the line box in a horizontal |
| // line and the top edge in a vertical line. |
| LayoutUnit logicalLeft() const { |
| - return isHorizontal() ? m_topLeft.x() : m_topLeft.y(); |
| + return isHorizontal() ? m_location.x() : m_location.y(); |
| } |
| LayoutUnit logicalRight() const { return logicalLeft() + logicalWidth(); } |
| void setLogicalLeft(LayoutUnit left) { |
| @@ -266,7 +264,7 @@ class CORE_EXPORT InlineBox : public DisplayItemClient { |
| // The logicalTop[ position is the top edge of the line box in a horizontal |
| // line and the left edge in a vertical line. |
| LayoutUnit logicalTop() const { |
| - return isHorizontal() ? m_topLeft.y() : m_topLeft.x(); |
| + return isHorizontal() ? m_location.y() : m_location.x(); |
| } |
| LayoutUnit logicalBottom() const { return logicalTop() + logicalHeight(); } |
| void setLogicalTop(LayoutUnit top) { |
| @@ -286,9 +284,9 @@ class CORE_EXPORT InlineBox : public DisplayItemClient { |
| LayoutUnit logicalHeight() const; |
| LayoutRect logicalFrameRect() const { |
| - return isHorizontal() ? LayoutRect(m_topLeft.x(), m_topLeft.y(), |
| + return isHorizontal() ? LayoutRect(m_location.x(), m_location.y(), |
| m_logicalWidth, logicalHeight()) |
| - : LayoutRect(m_topLeft.y(), m_topLeft.x(), |
| + : LayoutRect(m_location.y(), m_location.x(), |
| m_logicalWidth, logicalHeight()); |
| } |
| @@ -360,7 +358,7 @@ class CORE_EXPORT InlineBox : public DisplayItemClient { |
| return LineLayoutBoxModel(nullptr); |
| } |
| - LayoutPoint locationIncludingFlipping() const; |
| + LayoutPoint physicalLocation() const; |
|
wkorman
2016/11/29 00:02:13
And comment this.
Xianzhu
2016/11/29 01:44:17
Done.
|
| // Converts from a rect in the logical space of the InlineBox to one in the |
| // physical space of the containing block. The logical space of an InlineBox |
| @@ -495,12 +493,6 @@ class CORE_EXPORT InlineBox : public DisplayItemClient { |
| #undef ADD_BOOLEAN_BITFIELD |
| private: |
| - // Converts the given (top-left) position from the logical space of the |
| - // InlineBox to the physical space of the containing block. The size indicates |
| - // the size of the box whose point is being flipped. |
| - LayoutPoint logicalPositionToPhysicalPoint(const LayoutPoint&, |
| - const LayoutSize&) const; |
| - |
| void setLineLayoutItemShouldDoFullPaintInvalidationIfNeeded(); |
| InlineBoxBitfields m_bitfields; |
| @@ -547,7 +539,7 @@ class CORE_EXPORT InlineBox : public DisplayItemClient { |
| // For InlineFlowBox and InlineTextBox |
| bool extracted() const { return m_bitfields.extracted(); } |
| - LayoutPoint m_topLeft; |
| + LayoutPoint m_location; |
| LayoutUnit m_logicalWidth; |
| private: |