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

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

Issue 9968048: Merge 112200 (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 112901)
+++ Source/WebCore/rendering/RenderTextFragment.cpp (working copy)
@@ -33,7 +33,6 @@
, m_start(startOffset)
, m_end(length)
, m_firstLetter(0)
- , m_allowFragmentReset(true)
{
}
@@ -43,7 +42,6 @@
, m_end(str ? str->length() : 0)
, m_contentString(str)
, m_firstLetter(0)
- , m_allowFragmentReset(true)
{
}
@@ -62,9 +60,7 @@
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);
@@ -79,25 +75,30 @@
RenderText::willBeDestroyed();
}
-void RenderTextFragment::setTextInternal(PassRefPtr<StringImpl> text)
+void RenderTextFragment::setText(PassRefPtr<StringImpl> text, bool force)
{
- RenderText::setTextInternal(text);
+ RenderText::setText(text, force);
- if (m_allowFragmentReset) {
- m_start = 0;
- m_end = textLength();
- if (m_firstLetter) {
- ASSERT(!m_contentString);
- m_firstLetter->destroy();
- m_firstLetter = 0;
- if (Node* t = node()) {
- ASSERT(!t->renderer());
- t->setRenderer(this);
- }
+ m_start = 0;
+ m_end = textLength();
+ if (m_firstLetter) {
+ ASSERT(!m_contentString);
+ m_firstLetter->destroy();
+ m_firstLetter = 0;
+ if (Node* t = node()) {
+ ASSERT(!t->renderer());
+ t->setRenderer(this);
}
}
}
+void RenderTextFragment::transformText()
+{
+ // Don't reset first-letter here because we are only transforming the truncated fragment.
+ if (RefPtr<StringImpl> textToTransform = originalText())
+ RenderText::setText(textToTransform.release(), true);
+}
+
UChar RenderTextFragment::previousCharacter() const
{
if (start()) {
« 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