diff options
| author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
| commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
| tree | e367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/rendering/RenderText.h | |
| parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
| download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz | |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/rendering/RenderText.h')
| -rw-r--r-- | Source/WebCore/rendering/RenderText.h | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/Source/WebCore/rendering/RenderText.h b/Source/WebCore/rendering/RenderText.h index 7b986917d..6e44e326e 100644 --- a/Source/WebCore/rendering/RenderText.h +++ b/Source/WebCore/rendering/RenderText.h @@ -45,12 +45,6 @@ public: virtual PassRefPtr<StringImpl> originalText() const; - void updateTextIfNeeded() - { - if (preferredLogicalWidthsDirty()) - updateText(); - } - void extractTextBox(InlineTextBox*); void attachTextBox(InlineTextBox*); void removeTextBox(InlineTextBox*); @@ -72,11 +66,11 @@ 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; } + bool is8Bit() const { return m_text.is8Bit(); } + const LChar* characters8() const { return m_text.impl()->characters8(); } + const UChar* characters16() const { return m_text.impl()->characters16(); } const UChar* characters() const { return m_text.characters(); } - UChar characterAt(unsigned i) const { return m_is8Bit ? characters8()[i] : characters16()[i]; } + UChar characterAt(unsigned i) const { return 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*); @@ -136,8 +130,7 @@ public: void checkConsistency() const; - virtual void computePreferredLogicalWidths(float leadWidth); - bool isAllCollapsibleWhitespace(); + bool isAllCollapsibleWhitespace() const; bool canUseSimpleFontCodePath() const { return m_canUseSimpleFontCodePath; } bool knownToHaveNoOverflowAndNoFallbackFonts() const { return m_knownToHaveNoOverflowAndNoFallbackFonts; } @@ -145,12 +138,12 @@ public: void removeAndDestroyTextBoxes(); protected: + virtual void computePreferredLogicalWidths(float leadWidth); virtual void willBeDestroyed(); virtual void styleWillChange(StyleDifference, const RenderStyle*) { } virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); - virtual void updateText() { } virtual void setTextInternal(PassRefPtr<StringImpl>); virtual UChar previousCharacter() const; @@ -189,7 +182,6 @@ 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; @@ -201,10 +193,6 @@ private: float m_endMinWidth; String m_text; - union { - const LChar* characters8; - const UChar* characters16; - } m_data; InlineTextBox* m_firstTextBox; InlineTextBox* m_lastTextBox; @@ -212,13 +200,13 @@ private: inline RenderText* toRenderText(RenderObject* object) { - ASSERT(!object || object->isText()); + ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isText()); return static_cast<RenderText*>(object); } inline const RenderText* toRenderText(const RenderObject* object) { - ASSERT(!object || object->isText()); + ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isText()); return static_cast<const RenderText*>(object); } |
