| Index: third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h
|
| diff --git a/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h b/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h
|
| index fa96a52f9c13386cb66fcb39b074b66bb84df7c4..4ebe432717e4c9975e22f9e1e053799b4eeec924 100644
|
| --- a/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h
|
| +++ b/third_party/WebKit/Source/core/editing/iterators/SimplifiedBackwardsTextIterator.h
|
| @@ -28,6 +28,7 @@
|
|
|
| #include "core/editing/Position.h"
|
| #include "core/editing/iterators/FullyClippedStateStack.h"
|
| +#include "core/editing/iterators/TextBuffer.h"
|
| #include "core/editing/iterators/TextIteratorFlags.h"
|
| #include "platform/heap/Heap.h"
|
|
|
| @@ -60,16 +61,9 @@ public:
|
| // Calculate the minimum |actualLength >= minLength| such that code units
|
| // with offset range [position, position + actualLength) are whole code
|
| // points. Prepend these code points to |output| and return |actualLength|.
|
| - template<typename BufferType>
|
| - int copyTextTo(BufferType& output, int position, int minLength) const
|
| - {
|
| - int copiedLength = isBetweenSurrogatePair(position + minLength) ? minLength + 1 : minLength;
|
| - copyCodeUnitsTo(output, position, copiedLength);
|
| - return copiedLength;
|
| - }
|
| -
|
| - template<typename BufferType>
|
| - int copyTextTo(BufferType& output, int position = 0) const { return copyTextTo(output, position, m_textLength - position); }
|
| + int copyTextTo(BackwardsTextBuffer& output, int position, int minLength) const;
|
| + // TODO(xiaochengh): Avoid default parameters.
|
| + int copyTextTo(BackwardsTextBuffer& output, int position = 0) const;
|
|
|
| Node* startContainer() const;
|
| int endOffset() const;
|
| @@ -92,21 +86,7 @@ private:
|
|
|
| // Prepend code units with offset range [position, position + copyLength)
|
| // to the output buffer.
|
| - template<typename BufferType>
|
| - void copyCodeUnitsTo(BufferType& output, int position, int copyLength) const
|
| - {
|
| - ASSERT(position >= 0);
|
| - ASSERT(copyLength >= 0);
|
| - ASSERT(position + copyLength <= m_textLength);
|
| - // Make sure there's no integer overflow.
|
| - ASSERT(position + copyLength >= position);
|
| - if (m_textLength == 0 || copyLength == 0)
|
| - return;
|
| - if (m_singleCharacterBuffer)
|
| - output.prepend(&m_singleCharacterBuffer, 1);
|
| - else
|
| - m_textContainer.prependTo(output, m_textOffset + m_textLength - position - copyLength, copyLength);
|
| - }
|
| + void copyCodeUnitsTo(BackwardsTextBuffer& output, int position, int copyLength) const;
|
|
|
| // Current position, not necessarily of the text being returned, but position
|
| // as we walk through the DOM tree.
|
|
|