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

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

Issue 135443003: Remove MarkupAccumulator::appendNodeValue() method (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@using_namespace_header
Patch Set: Created 6 years, 11 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/MarkupAccumulator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/core/editing/MarkupAccumulator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698