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

Unified Diff: Source/WebCore/editing/TextIterator.cpp

Issue 9568027: Merge 108417 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 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 | « LayoutTests/editing/text-iterator/rtl-first-letter-text-iterator-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/editing/TextIterator.cpp
===================================================================
--- Source/WebCore/editing/TextIterator.cpp (revision 109383)
+++ Source/WebCore/editing/TextIterator.cpp (working copy)
@@ -487,25 +487,20 @@
return true;
}
- if (!renderer->firstTextBox() && str.length() > 0) {
- if (!m_handledFirstLetter && renderer->isTextFragment()) {
- handleTextNodeFirstLetter(static_cast<RenderTextFragment*>(renderer));
- if (m_firstLetterText) {
- handleTextBox();
- return false;
- }
- }
+ if (renderer->firstTextBox())
+ m_textBox = renderer->firstTextBox();
+
+ bool shouldHandleFirstLetter = !m_handledFirstLetter && renderer->isTextFragment() && !m_offset;
+ if (shouldHandleFirstLetter)
+ handleTextNodeFirstLetter(static_cast<RenderTextFragment*>(renderer));
+
+ if (!renderer->firstTextBox() && str.length() > 0 && !shouldHandleFirstLetter) {
if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
return false;
m_lastTextNodeEndedWithCollapsedSpace = true; // entire block is collapsed space
return true;
}
-
- m_textBox = renderer->firstTextBox();
- if (!m_handledFirstLetter && renderer->isTextFragment() && !m_offset)
- handleTextNodeFirstLetter(static_cast<RenderTextFragment*>(renderer));
-
if (m_firstLetterText)
renderer = m_firstLetterText;
@@ -562,6 +557,7 @@
nextTextBox = m_sortedTextBoxes[m_sortedTextBoxesPosition + 1];
} else
nextTextBox = m_textBox->nextTextBox();
+ ASSERT(!nextTextBox || nextTextBox->renderer() == renderer);
if (runStart < runEnd) {
// Handle either a single newline character (which becomes a space),
@@ -630,6 +626,7 @@
m_handledFirstLetter = true;
m_remainingTextBox = m_textBox;
m_textBox = firstLetter->firstTextBox();
+ m_sortedTextBoxes.clear();
m_firstLetterText = firstLetter;
}
}
« no previous file with comments | « LayoutTests/editing/text-iterator/rtl-first-letter-text-iterator-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698