diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2010-11-10 15:31:59 -0800 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2010-11-17 13:35:59 -0800 |
commit | 28040489d744e0c5d475a88663056c9040ed5320 (patch) | |
tree | c463676791e4a63e452a95f0a12b2a8519730693 /WebCore/rendering/InlineBox.h | |
parent | eff9be92c41913c92fb1d3b7983c071f3e718678 (diff) | |
download | external_webkit-28040489d744e0c5d475a88663056c9040ed5320.zip external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.gz external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.bz2 |
Merge WebKit at r71558: Initial merge by git.
Change-Id: Ib345578fa29df7e4bc72b4f00e4a6fddcb754c4c
Diffstat (limited to 'WebCore/rendering/InlineBox.h')
-rw-r--r-- | WebCore/rendering/InlineBox.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/WebCore/rendering/InlineBox.h b/WebCore/rendering/InlineBox.h index 1e4b8bf..72e5534 100644 --- a/WebCore/rendering/InlineBox.h +++ b/WebCore/rendering/InlineBox.h @@ -51,7 +51,7 @@ public: #if ENABLE(SVG) , m_hasVirtualLogicalHeight(false) #endif - , m_isVertical(false) + , m_isHorizontal(true) , m_endsWithBreak(false) , m_hasSelectedChildren(false) , m_hasEllipsisBoxOrHyphen(false) @@ -69,7 +69,7 @@ public: } InlineBox(RenderObject* obj, int x, int y, int logicalWidth, bool firstLine, bool constructed, - bool dirty, bool extracted, bool isVertical, InlineBox* next, InlineBox* prev, InlineFlowBox* parent) + bool dirty, bool extracted, bool isHorizontal, InlineBox* next, InlineBox* prev, InlineFlowBox* parent) : m_next(next) , m_prev(prev) , m_parent(parent) @@ -85,7 +85,7 @@ public: #if ENABLE(SVG) , m_hasVirtualLogicalHeight(false) #endif - , m_isVertical(isVertical) + , m_isHorizontal(isHorizontal) , m_endsWithBreak(false) , m_hasSelectedChildren(false) , m_hasEllipsisBoxOrHyphen(false) @@ -152,8 +152,8 @@ public: return 0; } - bool isVertical() const { return m_isVertical; } - void setIsVertical(bool v) { m_isVertical = v; } + bool isHorizontal() const { return m_isHorizontal; } + void setIsHorizontal(bool horizontal) { m_isHorizontal = horizontal; } virtual IntRect calculateBoundaries() const { @@ -216,26 +216,26 @@ public: void setY(int y) { m_y = y; } int y() const { return m_y; } - int width() const { return m_isVertical ? logicalHeight() : logicalWidth(); } - int height() const { return m_isVertical ? logicalWidth() : logicalHeight(); } + int width() const { return isHorizontal() ? logicalWidth() : logicalHeight(); } + int height() const { return isHorizontal() ? logicalHeight() : logicalWidth(); } // The logicalLeft position is the left edge of the line box in a horizontal line and the top edge in a vertical line. - int logicalLeft() const { return !m_isVertical ? m_x : m_y; } + int logicalLeft() const { return isHorizontal() ? m_x : m_y; } int logicalRight() const { return logicalLeft() + logicalWidth(); } void setLogicalLeft(int left) { - if (!m_isVertical) + if (isHorizontal()) m_x = left; else m_y = left; } // The logicalTop[ position is the top edge of the line box in a horizontal line and the left edge in a vertical line. - int logicalTop() const { return !m_isVertical ? m_y : m_x; } + int logicalTop() const { return isHorizontal() ? m_y : m_x; } int logicalBottom() const { return logicalTop() + logicalHeight(); } void setLogicalTop(int top) { - if (!m_isVertical) + if (isHorizontal()) m_y = top; else m_x = top; @@ -248,8 +248,8 @@ public: // The logical height is our extent in the block flow direction, i.e., height for horizontal text and width for vertical text. int logicalHeight() const; - virtual int baselinePosition() const { return boxModelObject()->baselinePosition(m_firstLine, m_isVertical ? VerticalLine : HorizontalLine, PositionOnContainingLine); } - virtual int lineHeight() const { return boxModelObject()->lineHeight(m_firstLine, m_isVertical ? VerticalLine : HorizontalLine, PositionOnContainingLine); } + virtual int baselinePosition() const { return boxModelObject()->baselinePosition(m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); } + virtual int lineHeight() const { return boxModelObject()->lineHeight(m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); } virtual int caretMinOffset() const; @@ -290,8 +290,9 @@ public: return 0; } - void adjustForFlippedBlocksWritingMode(IntPoint&); - void adjustForFlippedBlocksWritingMode(IntRect&); + IntPoint locationIncludingFlipping(); + void flipForWritingMode(IntRect&); + IntPoint flipForWritingMode(const IntPoint&); private: InlineBox* m_next; // The next element on the same line as us. @@ -319,7 +320,7 @@ protected: bool m_extracted : 1; bool m_hasVirtualLogicalHeight : 1; - bool m_isVertical : 1; + bool m_isHorizontal : 1; // for RootInlineBox bool m_endsWithBreak : 1; // Whether the line ends with a <br>. |