| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
#ifndef RenderFlow_h |
|---|
| 24 |
#define RenderFlow_h |
|---|
| 25 |
|
|---|
| 26 |
#include "RenderContainer.h" |
|---|
| 27 |
|
|---|
| 28 |
namespace WebCore { |
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
class RenderFlow : public RenderContainer { |
|---|
| 40 |
public: |
|---|
| 41 |
RenderFlow(Node* node) |
|---|
| 42 |
: RenderContainer(node) |
|---|
| 43 |
, m_continuation(0) |
|---|
| 44 |
, m_firstLineBox(0) |
|---|
| 45 |
, m_lastLineBox(0) |
|---|
| 46 |
, m_lineHeight(-1) |
|---|
| 47 |
, m_childrenInline(true) |
|---|
| 48 |
, m_firstLine(false) |
|---|
| 49 |
, m_topMarginQuirk(false) |
|---|
| 50 |
, m_bottomMarginQuirk(false) |
|---|
| 51 |
, m_hasMarkupTruncation(false) |
|---|
| 52 |
, m_selectionState(SelectionNone) |
|---|
| 53 |
, m_hasColumns(false) |
|---|
| 54 |
, m_isContinuation(false) |
|---|
| 55 |
{ |
|---|
| 56 |
} |
|---|
| 57 |
#ifndef NDEBUG |
|---|
| 58 |
virtual ~RenderFlow(); |
|---|
| 59 |
#endif |
|---|
| 60 |
|
|---|
| 61 |
virtual RenderFlow* continuation() const { return m_continuation; } |
|---|
| 62 |
void setContinuation(RenderFlow* c) { m_continuation = c; } |
|---|
| 63 |
RenderFlow* continuationBefore(RenderObject* beforeChild); |
|---|
| 64 |
|
|---|
| 65 |
void addChildWithContinuation(RenderObject* newChild, RenderObject* beforeChild); |
|---|
| 66 |
virtual void addChildToFlow(RenderObject* newChild, RenderObject* beforeChild) = 0; |
|---|
| 67 |
virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0); |
|---|
| 68 |
|
|---|
| 69 |
static RenderFlow* createAnonymousFlow(Document*, RenderStyle*); |
|---|
| 70 |
|
|---|
| 71 |
void extractLineBox(InlineFlowBox*); |
|---|
| 72 |
void attachLineBox(InlineFlowBox*); |
|---|
| 73 |
void removeLineBox(InlineFlowBox*); |
|---|
| 74 |
void deleteLineBoxes(); |
|---|
| 75 |
virtual void destroy(); |
|---|
| 76 |
|
|---|
| 77 |
virtual void dirtyLinesFromChangedChild(RenderObject* child); |
|---|
| 78 |
|
|---|
| 79 |
virtual int lineHeight(bool firstLine, bool isRootLineBox = false) const; |
|---|
| 80 |
|
|---|
| 81 |
InlineFlowBox* firstLineBox() const { return m_firstLineBox; } |
|---|
| 82 |
InlineFlowBox* lastLineBox() const { return m_lastLineBox; } |
|---|
| 83 |
|
|---|
| 84 |
virtual InlineBox* createInlineBox(bool makePlaceHolderBox, bool isRootLineBox, bool isOnlyRun=false); |
|---|
| 85 |
virtual void dirtyLineBoxes(bool fullLayout, bool isRootLineBox = false); |
|---|
| 86 |
|
|---|
| 87 |
void paintLines(PaintInfo&, int tx, int ty); |
|---|
| 88 |
bool hitTestLines(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction); |
|---|
| 89 |
|
|---|
| 90 |
virtual IntRect absoluteClippedOverflowRect(); |
|---|
| 91 |
|
|---|
| 92 |
virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const; |
|---|
| 93 |
virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const; |
|---|
| 94 |
virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const; |
|---|
| 95 |
|
|---|
| 96 |
virtual IntRect caretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0); |
|---|
| 97 |
|
|---|
| 98 |
virtual void addFocusRingRects(GraphicsContext*, int tx, int ty); |
|---|
| 99 |
void paintOutlineForLine(GraphicsContext*, int tx, int ty, const IntRect& prevLine, const IntRect& thisLine, const IntRect& nextLine); |
|---|
| 100 |
void paintOutline(GraphicsContext*, int tx, int ty); |
|---|
| 101 |
|
|---|
| 102 |
virtual bool hasColumns() const { return m_hasColumns; } |
|---|
| 103 |
|
|---|
| 104 |
void calcMargins(int containerWidth); |
|---|
| 105 |
|
|---|
| 106 |
void checkConsistency() const; |
|---|
| 107 |
|
|---|
| 108 |
private: |
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 |
RenderFlow* m_continuation; |
|---|
| 114 |
|
|---|
| 115 |
protected: |
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 |
InlineFlowBox* m_firstLineBox; |
|---|
| 120 |
InlineFlowBox* m_lastLineBox; |
|---|
| 121 |
|
|---|
| 122 |
mutable int m_lineHeight; |
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
bool m_childrenInline : 1; |
|---|
| 127 |
bool m_firstLine : 1; |
|---|
| 128 |
bool m_topMarginQuirk : 1; |
|---|
| 129 |
bool m_bottomMarginQuirk : 1; |
|---|
| 130 |
bool m_hasMarkupTruncation : 1; |
|---|
| 131 |
unsigned m_selectionState : 3; |
|---|
| 132 |
bool m_hasColumns : 1; |
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
bool m_isContinuation : 1; |
|---|
| 136 |
}; |
|---|
| 137 |
|
|---|
| 138 |
#ifdef NDEBUG |
|---|
| 139 |
inline void RenderFlow::checkConsistency() const |
|---|
| 140 |
{ |
|---|
| 141 |
} |
|---|
| 142 |
#endif |
|---|
| 143 |
|
|---|
| 144 |
} |
|---|
| 145 |
|
|---|
| 146 |
#endif |
|---|
| 147 |
|
|---|