diff options
Diffstat (limited to 'Source/WebCore/rendering/RenderText.h')
| -rw-r--r-- | Source/WebCore/rendering/RenderText.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/WebCore/rendering/RenderText.h b/Source/WebCore/rendering/RenderText.h index 6fc4c67a7..67bf2381b 100644 --- a/Source/WebCore/rendering/RenderText.h +++ b/Source/WebCore/rendering/RenderText.h @@ -72,7 +72,12 @@ public: virtual VisiblePosition positionForPoint(const LayoutPoint&); + bool is8Bit() const { return m_is8Bit; } + const LChar* characters8() const { ASSERT(m_is8Bit); return m_data.characters8; } + const UChar* characters16() const { ASSERT(!m_is8Bit); return m_data.characters16; } const UChar* characters() const { return m_text.characters(); } + UChar characterAt(unsigned i) const { return m_is8Bit ? characters8()[i] : characters16()[i]; } + UChar operator[](unsigned i) const { return characterAt(i); } unsigned textLength() const { return m_text.length(); } // non virtual implementation of length() void positionLineBox(InlineBox*); @@ -103,13 +108,13 @@ public: virtual bool canBeSelectionLeaf() const { return true; } virtual void setSelectionState(SelectionState s); - virtual LayoutRect selectionRectForRepaint(RenderBoxModelObject* repaintContainer, bool clipToVisibleContent = true); + virtual LayoutRect selectionRectForRepaint(RenderLayerModelObject* repaintContainer, bool clipToVisibleContent = true) OVERRIDE; virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0); virtual LayoutUnit marginLeft() const { return minimumValueForLength(style()->marginLeft(), 0, view()); } virtual LayoutUnit marginRight() const { return minimumValueForLength(style()->marginRight(), 0, view()); } - virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const; + virtual LayoutRect clippedOverflowRectForRepaint(RenderLayerModelObject* repaintContainer) const OVERRIDE; InlineTextBox* firstTextBox() const { return m_firstTextBox; } InlineTextBox* lastTextBox() const { return m_lastTextBox; } @@ -184,6 +189,7 @@ private: // just dirtying everything when character data is modified (e.g., appended/inserted // or removed). bool m_containsReversedText : 1; + bool m_is8Bit : 1; bool m_isAllASCII : 1; bool m_canUseSimpleFontCodePath : 1; mutable bool m_knownToHaveNoOverflowAndNoFallbackFonts : 1; @@ -195,6 +201,10 @@ private: float m_endMinWidth; String m_text; + union { + const LChar* characters8; + const UChar* characters16; + } m_data; InlineTextBox* m_firstTextBox; InlineTextBox* m_lastTextBox; |
