| Index: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
|
| index 0bd2c59c69a47d009ac9805730df94b9cc459c25..38481de5481ccac1eddc67332c9dacc7b5af21eb 100644
|
| --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
|
| @@ -1112,6 +1112,26 @@ bool TextIteratorAlgorithm<Strategy>::isBetweenSurrogatePair(int position) const
|
| return position > 0 && position < length() && U16_IS_LEAD(characterAt(position - 1)) && U16_IS_TRAIL(characterAt(position));
|
| }
|
|
|
| +template <typename Strategy>
|
| +int TextIteratorAlgorithm<Strategy>::copyTextTo(ForwardsTextBuffer* output, int position, int minLength) const
|
| +{
|
| + int copiedLength = isBetweenSurrogatePair(position + minLength) ? minLength + 1 : minLength;
|
| + copyCodeUnitsTo(output, position, copiedLength);
|
| + return copiedLength;
|
| +}
|
| +
|
| +template <typename Strategy>
|
| +int TextIteratorAlgorithm<Strategy>::copyTextTo(ForwardsTextBuffer* output, int position) const
|
| +{
|
| + return copyTextTo(output, position, length() - position);
|
| +}
|
| +
|
| +template <typename Strategy>
|
| +void TextIteratorAlgorithm<Strategy>::copyCodeUnitsTo(ForwardsTextBuffer* output, int position, int copyLength) const
|
| +{
|
| + m_textState.appendTextTo(output, position, copyLength);
|
| +}
|
| +
|
| // --------
|
|
|
| template <typename Strategy>
|
|
|