Index: Source/WebCore/rendering/RenderTextFragment.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderTextFragment.cpp (revision 110461) |
+++ Source/WebCore/rendering/RenderTextFragment.cpp (working copy) |
@@ -33,6 +33,7 @@ |
, m_start(startOffset) |
, m_end(length) |
, m_firstLetter(0) |
+ , m_allowFragmentReset(true) |
{ |
} |
@@ -42,6 +43,7 @@ |
, m_end(str ? str->length() : 0) |
, m_contentString(str) |
, m_firstLetter(0) |
+ , m_allowFragmentReset(true) |
{ |
} |
@@ -60,7 +62,9 @@ |
void RenderTextFragment::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) |
{ |
+ m_allowFragmentReset = false; |
RenderText::styleDidChange(diff, oldStyle); |
+ m_allowFragmentReset = true; |
if (RenderBlock* block = blockForAccompanyingFirstLetter()) { |
block->style()->removeCachedPseudoStyle(FIRST_LETTER); |
@@ -78,15 +82,18 @@ |
void RenderTextFragment::setTextInternal(PassRefPtr<StringImpl> text) |
{ |
RenderText::setTextInternal(text); |
- if (m_firstLetter) { |
- ASSERT(!m_contentString); |
- m_firstLetter->destroy(); |
- m_firstLetter = 0; |
+ |
+ if (m_allowFragmentReset) { |
m_start = 0; |
m_end = textLength(); |
- if (Node* t = node()) { |
- ASSERT(!t->renderer()); |
- t->setRenderer(this); |
+ if (m_firstLetter) { |
+ ASSERT(!m_contentString); |
+ m_firstLetter->destroy(); |
+ m_firstLetter = 0; |
+ if (Node* t = node()) { |
+ ASSERT(!t->renderer()); |
+ t->setRenderer(this); |
+ } |
} |
} |
} |