Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: Source/WebCore/rendering/RenderTextFragment.cpp

Issue 9689022: Merge 110332 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderTextFragment.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
}
}
}
« no previous file with comments | « Source/WebCore/rendering/RenderTextFragment.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698