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

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

Issue 509373002: This is code readability patch, No Layout Test case needed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing order Created 6 years, 4 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 | « no previous file | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/TextIterator.cpp
diff --git a/Source/core/editing/TextIterator.cpp b/Source/core/editing/TextIterator.cpp
index 385b6d4b6bd181870c61a812f3c143d580cfdb80..2fad13588cfa45747555c261c1aacff8826cf7e9 100644
--- a/Source/core/editing/TextIterator.cpp
+++ b/Source/core/editing/TextIterator.cpp
@@ -615,7 +615,7 @@ bool TextIterator::handleTextNode()
if (!renderer->style()->collapseWhiteSpace()) {
int runStart = m_offset;
if (m_lastTextNodeEndedWithCollapsedSpace && hasVisibleTextNode(renderer)) {
- emitCharacter(' ', textNode, 0, runStart, runStart);
+ emitCharacter(space, textNode, 0, runStart, runStart);
return false;
}
if (!m_handledFirstLetter && renderer->isTextFragment() && !m_offset) {
@@ -698,7 +698,7 @@ void TextIterator::handleTextBox()
--spaceRunStart;
emitText(m_node, renderer, spaceRunStart, spaceRunStart + 1);
} else {
- emitCharacter(' ', m_node, 0, runStart, runStart);
+ emitCharacter(space, m_node, 0, runStart, runStart);
}
return;
}
@@ -720,7 +720,7 @@ void TextIterator::handleTextBox()
// or a run of characters that does not include a newline.
// This effectively translates newlines to spaces without copying the text.
if (str[runStart] == '\n') {
- emitCharacter(' ', m_node, 0, runStart, runStart + 1);
+ emitCharacter(space, m_node, 0, runStart, runStart + 1);
m_offset = runStart + 1;
} else {
size_t subrunEnd = str.find('\n', runStart);
@@ -804,7 +804,7 @@ bool TextIterator::handleReplacedElement()
}
if (m_lastTextNodeEndedWithCollapsedSpace) {
- emitCharacter(' ', m_lastTextNode->parentNode(), m_lastTextNode, 1, 1);
+ emitCharacter(space, m_lastTextNode->parentNode(), m_lastTextNode, 1, 1);
return false;
}
@@ -1080,7 +1080,7 @@ void TextIterator::representNodeOffsetZero()
emitCharacter('\n', m_node->parentNode(), m_node, 0, 0);
} else if (shouldEmitSpaceBeforeAndAfterNode(m_node)) {
if (shouldRepresentNodeOffsetZero())
- emitCharacter(' ', m_node->parentNode(), m_node, 0, 0);
+ emitCharacter(space, m_node->parentNode(), m_node, 0, 0);
}
}
@@ -1089,7 +1089,7 @@ bool TextIterator::handleNonTextNode()
if (shouldEmitNewlineForNode(m_node, m_emitsOriginalText))
emitCharacter('\n', m_node->parentNode(), m_node, 0, 1);
else if (m_emitsCharactersBetweenAllVisiblePositions && m_node->renderer() && m_node->renderer()->isHR())
- emitCharacter(' ', m_node->parentNode(), m_node, 0, 1);
+ emitCharacter(space, m_node->parentNode(), m_node, 0, 1);
else
representNodeOffsetZero();
@@ -1133,7 +1133,7 @@ void TextIterator::exitNode()
// If nothing was emitted, see if we need to emit a space.
if (!m_positionNode && shouldEmitSpaceBeforeAndAfterNode(m_node))
- emitCharacter(' ', baseNode->parentNode(), baseNode, 1, 1);
+ emitCharacter(space, baseNode->parentNode(), baseNode, 1, 1);
}
void TextIterator::emitCharacter(UChar c, Node* textNode, Node* offsetBaseNode, int textStartOffset, int textEndOffset)
« no previous file with comments | « no previous file | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698