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

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

Issue 27030014: Remove Backslash-as-JPY hack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TextCodec/Encoding added Created 7 years, 2 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/core/editing/TextIterator.h ('k') | Source/core/frame/Frame.h » ('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 436d2042663c2a9d2a8afa8d31c30bdcbeeb7d56..138e8feaa52012f317cafa8f1363471a8eaa5592 100644
--- a/Source/core/editing/TextIterator.cpp
+++ b/Source/core/editing/TextIterator.cpp
@@ -241,7 +241,6 @@ TextIterator::TextIterator(const Range* r, TextIteratorBehavior behavior)
, m_sortedTextBoxesPosition(0)
, m_emitsCharactersBetweenAllVisiblePositions(behavior & TextIteratorEmitsCharactersBetweenAllVisiblePositions)
, m_entersTextControls(behavior & TextIteratorEntersTextControls)
- , m_emitsTextWithoutTranscoding(behavior & TextIteratorEmitsTextsWithoutTranscoding)
, m_emitsOriginalText(behavior & TextIteratorEmitsOriginalText)
, m_handledFirstLetter(false)
, m_ignoresStyleVisibility(behavior & TextIteratorIgnoresStyleVisibility)
@@ -1017,7 +1016,7 @@ void TextIterator::emitCharacter(UChar c, Node* textNode, Node* offsetBaseNode,
void TextIterator::emitText(Node* textNode, RenderObject* renderObject, int textStartOffset, int textEndOffset)
{
RenderText* renderer = toRenderText(renderObject);
- m_text = m_emitsOriginalText ? renderer->originalText() : (m_emitsTextWithoutTranscoding ? renderer->textWithoutTranscoding() : renderer->text());
+ m_text = m_emitsOriginalText ? renderer->originalText() : renderer->text();
ASSERT(!m_text.isEmpty());
ASSERT(0 <= textStartOffset && textStartOffset < static_cast<int>(m_text.length()));
ASSERT(0 <= textEndOffset && textEndOffset <= static_cast<int>(m_text.length()));
@@ -2349,7 +2348,7 @@ bool TextIterator::getLocationAndLengthFromRange(Node* scope, const Range* range
// --------
-String plainText(const Range* r, TextIteratorBehavior defaultBehavior, bool isDisplayString)
+String plainText(const Range* r, TextIteratorBehavior defaultBehavior)
{
// The initial buffer size can be critical for performance: https://bugs.webkit.org/show_bug.cgi?id=81192
static const unsigned initialCapacity = 1 << 15;
@@ -2357,11 +2356,8 @@ String plainText(const Range* r, TextIteratorBehavior defaultBehavior, bool isDi
unsigned bufferLength = 0;
StringBuilder builder;
builder.reserveCapacity(initialCapacity);
- TextIteratorBehavior behavior = defaultBehavior;
- if (!isDisplayString)
- behavior = static_cast<TextIteratorBehavior>(behavior | TextIteratorEmitsTextsWithoutTranscoding);
- for (TextIterator it(r, behavior); !it.atEnd(); it.advance()) {
+ for (TextIterator it(r, defaultBehavior); !it.atEnd(); it.advance()) {
it.appendTextToStringBuilder(builder);
bufferLength += it.length();
}
@@ -2369,12 +2365,7 @@ String plainText(const Range* r, TextIteratorBehavior defaultBehavior, bool isDi
if (!bufferLength)
return emptyString();
- String result = builder.toString();
-
- if (isDisplayString)
- r->ownerDocument().displayStringModifiedByEncoding(result);
-
- return result;
+ return builder.toString();
}
static PassRefPtr<Range> collapsedToBoundary(const Range* range, bool forward)
« no previous file with comments | « Source/core/editing/TextIterator.h ('k') | Source/core/frame/Frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698