summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/InlineFlowBox.h
diff options
context:
space:
mode:
authorFeng Qian <>2009-04-10 18:11:29 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-10 18:11:29 -0700
commit8f72e70a9fd78eec56623b3a62e68f16b7b27e28 (patch)
tree181bf9a400c30a1bf34ea6d72560e8d00111d549 /WebCore/rendering/InlineFlowBox.h
parent7ed56f225e0ade046e1c2178977f72b2d896f196 (diff)
downloadexternal_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.zip
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.gz
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.bz2
AI 145796: Land the WebKit merge @r42026.
Automated import of CL 145796
Diffstat (limited to 'WebCore/rendering/InlineFlowBox.h')
-rw-r--r--WebCore/rendering/InlineFlowBox.h56
1 files changed, 37 insertions, 19 deletions
diff --git a/WebCore/rendering/InlineFlowBox.h b/WebCore/rendering/InlineFlowBox.h
index 62f8f69..df75d06 100644
--- a/WebCore/rendering/InlineFlowBox.h
+++ b/WebCore/rendering/InlineFlowBox.h
@@ -25,9 +25,9 @@
namespace WebCore {
+class HitTestRequest;
class HitTestResult;
-
-struct HitTestRequest;
+class RenderLineBoxList;
class InlineFlowBox : public InlineRunBox {
public:
@@ -36,6 +36,9 @@ public:
, m_firstChild(0)
, m_lastChild(0)
, m_maxHorizontalVisualOverflow(0)
+ , m_includeLeftEdge(false)
+ , m_includeRightEdge(false)
+ , m_hasTextChildren(true)
#ifndef NDEBUG
, m_hasBadChildList(false)
#endif
@@ -52,9 +55,7 @@ public:
virtual ~InlineFlowBox();
#endif
- RenderFlow* flowObject();
-
- virtual bool isInlineFlowBox() { return true; }
+ virtual int height() const;
InlineFlowBox* prevFlowBox() const { return static_cast<InlineFlowBox*>(m_prevLine); }
InlineFlowBox* nextFlowBox() const { return static_cast<InlineFlowBox*>(m_nextLine); }
@@ -80,6 +81,10 @@ public:
virtual void attachLine();
virtual void adjustPosition(int dx, int dy);
+ virtual void extractLineBoxFromRenderObject();
+ virtual void attachLineBoxToRenderObject();
+ virtual void removeLineBoxFromRenderObject();
+
virtual void clearTruncation();
virtual void paintBoxDecorations(RenderObject::PaintInfo&, int tx, int ty);
@@ -93,17 +98,23 @@ public:
virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty);
- int marginBorderPaddingLeft();
- int marginBorderPaddingRight();
- int marginLeft();
- int marginRight();
- int borderLeft() { if (includeLeftEdge()) return renderBox()->borderLeft(); return 0; }
- int borderRight() { if (includeRightEdge()) return renderBox()->borderRight(); return 0; }
- int paddingLeft() { if (includeLeftEdge()) return renderBox()->paddingLeft(); return 0; }
- int paddingRight() { if (includeRightEdge()) return renderBox()->paddingRight(); return 0; }
-
- bool includeLeftEdge() { return m_includeLeftEdge; }
- bool includeRightEdge() { return m_includeRightEdge; }
+ virtual RenderLineBoxList* rendererLineBoxes() const;
+
+ int marginBorderPaddingLeft() const { return marginLeft() + borderLeft() + paddingLeft(); }
+ int marginBorderPaddingRight() const { return marginRight() + borderRight() + paddingRight(); }
+ int marginLeft() const { if (includeLeftEdge()) return boxModelObject()->marginLeft(); return 0; }
+ int marginRight() const { if (includeRightEdge()) return boxModelObject()->marginRight(); return 0; }
+ int borderLeft() const { if (includeLeftEdge()) return renderer()->style()->borderLeftWidth(); return 0; }
+ int borderRight() const { if (includeRightEdge()) return renderer()->style()->borderRightWidth(); return 0; }
+ int borderTop() const { return renderer()->style()->borderTopWidth(); }
+ int borderBottom() const { return renderer()->style()->borderBottomWidth(); }
+ int paddingLeft() const { if (includeLeftEdge()) return boxModelObject()->paddingLeft(); return 0; }
+ int paddingRight() const { if (includeRightEdge()) return boxModelObject()->paddingRight(); return 0; }
+ int paddingTop() const { return boxModelObject()->paddingTop(); }
+ int paddingBottom() const { return boxModelObject()->paddingBottom(); }
+
+ bool includeLeftEdge() const { return m_includeLeftEdge; }
+ bool includeRightEdge() const { return m_includeRightEdge; }
void setEdges(bool includeLeft, bool includeRight)
{
m_includeLeftEdge = includeLeft;
@@ -122,11 +133,10 @@ public:
int maxPositionTop, int maxPositionBottom);
void placeBoxesVertically(int y, int maxHeight, int maxAscent, bool strictMode,
int& topPosition, int& bottomPosition, int& selectionTop, int& selectionBottom);
- void shrinkBoxesWithNoTextChildren(int topPosition, int bottomPosition);
virtual void setVerticalOverflowPositions(int /*top*/, int /*bottom*/) { }
virtual void setVerticalSelectionPositions(int /*top*/, int /*bottom*/) { }
- int maxHorizontalVisualOverflow() const { return m_maxHorizontalVisualOverflow; }
+ short maxHorizontalVisualOverflow() const { return m_maxHorizontalVisualOverflow; }
void removeChild(InlineBox* child);
@@ -135,13 +145,21 @@ public:
virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidth);
virtual int placeEllipsisBox(bool ltr, int blockEdge, int ellipsisWidth, bool&);
+ bool hasTextChildren() const { return m_hasTextChildren; }
+
void checkConsistency() const;
void setHasBadChildList();
private:
+ virtual bool isInlineFlowBox() const { return true; }
+
InlineBox* m_firstChild;
InlineBox* m_lastChild;
- int m_maxHorizontalVisualOverflow;
+ short m_maxHorizontalVisualOverflow;
+
+ bool m_includeLeftEdge : 1;
+ bool m_includeRightEdge : 1;
+ bool m_hasTextChildren : 1;
#ifndef NDEBUG
bool m_hasBadChildList;