Index: Source/core/editing/MarkupAccumulator.cpp |
diff --git a/Source/core/editing/MarkupAccumulator.cpp b/Source/core/editing/MarkupAccumulator.cpp |
index 0f40c8e3a977a9056d1d12ea60a701b4cb46c85a..f043f0aa36b7509033fc739b72d8aaa82578dbe6 100644 |
--- a/Source/core/editing/MarkupAccumulator.cpp |
+++ b/Source/core/editing/MarkupAccumulator.cpp |
@@ -222,24 +222,6 @@ void MarkupAccumulator::appendQuotedURLAttributeValue(StringBuilder& result, con |
result.append(quoteChar); |
} |
-void MarkupAccumulator::appendNodeValue(StringBuilder& result, const Node* node, const Range* range, EntityMask entityMask) |
-{ |
- const String str = node->nodeValue(); |
- unsigned length = str.length(); |
- unsigned start = 0; |
- |
- if (range) { |
- if (node == range->endContainer()) |
- length = range->endOffset(); |
- if (node == range->startContainer()) { |
- start = range->startOffset(); |
- length -= start; |
- } |
- } |
- |
- appendCharactersReplacingEntities(result, str, start, length, entityMask); |
-} |
- |
bool MarkupAccumulator::shouldAddNamespaceElement(const Element* element) |
{ |
// Don't add namespace attribute if it is already defined for this elem. |
@@ -307,7 +289,19 @@ EntityMask MarkupAccumulator::entityMaskForText(Text* text) const |
void MarkupAccumulator::appendText(StringBuilder& result, Text* text) |
{ |
- appendNodeValue(result, text, m_range, entityMaskForText(text)); |
+ const String& str = text->data(); |
+ unsigned length = str.length(); |
+ unsigned start = 0; |
+ |
+ if (m_range) { |
+ if (text == m_range->endContainer()) |
+ length = m_range->endOffset(); |
+ if (text == m_range->startContainer()) { |
+ start = m_range->startOffset(); |
+ length -= start; |
+ } |
+ } |
+ appendCharactersReplacingEntities(result, str, start, length, entityMaskForText(text)); |
} |
void MarkupAccumulator::appendComment(StringBuilder& result, const String& comment) |