From 8f72e70a9fd78eec56623b3a62e68f16b7b27e28 Mon Sep 17 00:00:00 2001 From: Feng Qian <> Date: Fri, 10 Apr 2009 18:11:29 -0700 Subject: AI 145796: Land the WebKit merge @r42026. Automated import of CL 145796 --- WebCore/rendering/RenderText.h | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'WebCore/rendering/RenderText.h') diff --git a/WebCore/rendering/RenderText.h b/WebCore/rendering/RenderText.h index 6a09605..649f155 100644 --- a/WebCore/rendering/RenderText.h +++ b/WebCore/rendering/RenderText.h @@ -52,21 +52,20 @@ public: StringImpl* text() const { return m_text.get(); } - virtual InlineBox* createInlineBox(bool makePlaceHolderBox, bool isRootLineBox, bool isOnlyRun = false); - virtual InlineTextBox* createInlineTextBox(); - virtual void dirtyLineBoxes(bool fullLayout, bool isRootInlineBox = false); + InlineTextBox* createInlineTextBox(); + void dirtyLineBoxes(bool fullLayout); virtual void absoluteRects(Vector&, int tx, int ty, bool topLevel = true); - virtual void addLineBoxRects(Vector&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false); + virtual void absoluteRectsForRange(Vector&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false); virtual void absoluteQuads(Vector&, bool topLevel = true); - virtual void collectAbsoluteLineBoxQuads(Vector&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false); + virtual void absoluteQuadsForRange(Vector&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false); - virtual VisiblePosition positionForCoordinates(int x, int y); + virtual VisiblePosition positionForPoint(const IntPoint&); const UChar* characters() const { return m_text->characters(); } unsigned textLength() const { return m_text->length(); } // non virtual implementation of length() - virtual void position(InlineBox*); + void positionLineBox(InlineBox*); virtual unsigned width(unsigned from, unsigned len, const Font&, int xPos) const; virtual unsigned width(unsigned from, unsigned len, int xPos, bool firstLine = false) const; @@ -88,21 +87,18 @@ public: int firstRunX() const; int firstRunY() const; - virtual int verticalPositionHint(bool firstLine) const; - void setText(PassRefPtr, bool force = false); void setTextWithOffset(PassRefPtr, unsigned offset, unsigned len, bool force = false); virtual bool canBeSelectionLeaf() const { return true; } - virtual SelectionState selectionState() const { return static_cast(m_selectionState); } virtual void setSelectionState(SelectionState s); - virtual IntRect selectionRect(bool clipToVisibleContent = true); + virtual IntRect selectionRectForRepaint(RenderBoxModelObject* repaintContainer, bool clipToVisibleContent = true); virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0); virtual int marginLeft() const { return style()->marginLeft().calcMinValue(0); } virtual int marginRight() const { return style()->marginRight().calcMinValue(0); } - virtual IntRect clippedOverflowRectForRepaint(RenderBox* repaintContainer); + virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer); InlineTextBox* firstTextBox() const { return m_firstTextBox; } InlineTextBox* lastTextBox() const { return m_lastTextBox; } @@ -112,6 +108,7 @@ public: virtual unsigned caretMaxRenderedOffset() const; virtual int previousOffset(int current) const; + virtual int previousOffsetForBackwardDeletion(int current) const; virtual int nextOffset(int current) const; bool containsReversedText() const { return m_containsReversedText; } @@ -122,13 +119,16 @@ public: void checkConsistency() const; + virtual void calcPrefWidths(int leadWidth); + protected: - virtual void styleWillChange(RenderStyle::Diff, const RenderStyle*) { } - virtual void styleDidChange(RenderStyle::Diff, const RenderStyle* oldStyle); + virtual void styleWillChange(StyleDifference, const RenderStyle*) { } + virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); virtual void setTextInternal(PassRefPtr); - virtual void calcPrefWidths(int leadWidth); virtual UChar previousCharacter(); + + virtual InlineTextBox* createTextBox(); // Subclassed by SVG. private: // Make length() private so that callers that have a RenderText* @@ -155,7 +155,6 @@ private: int m_beginMinWidth; int m_endMinWidth; - unsigned m_selectionState : 3; // enums on Windows are signed, so this needs to be unsigned to prevent it turning negative. bool m_hasBreakableChar : 1; // Whether or not we can be broken into multiple lines. bool m_hasBreak : 1; // Whether or not we have a hard break (e.g.,
 with '\n').
     bool m_hasTab : 1; // Whether or not we have a variable width tab character (e.g., 
 with '\t').
@@ -181,6 +180,9 @@ inline const RenderText* toRenderText(const RenderObject* o)
     return static_cast(o);
 }
 
+// This will catch anyone doing an unnecessary cast.
+void toRenderText(const RenderText*);
+
 #ifdef NDEBUG
 inline void RenderText::checkConsistency() const
 {
-- 
cgit v1.1