| Index: Source/core/editing/PlainTextRange.cpp
|
| diff --git a/Source/core/editing/PlainTextRange.cpp b/Source/core/editing/PlainTextRange.cpp
|
| index e67ddd7d6a842c9e8b6d7e7e3f046f1e6adcb9b4..9ad1bb3d78076fb6b23f7076e6f22269f0442085 100644
|
| --- a/Source/core/editing/PlainTextRange.cpp
|
| +++ b/Source/core/editing/PlainTextRange.cpp
|
| @@ -67,6 +67,11 @@ PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeForSelection(const Cont
|
| return createRangeFor(scope, ForSelection);
|
| }
|
|
|
| +PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeForInput(const ContainerNode& scope) const
|
| +{
|
| + return createRangeFor(scope, ForInput);
|
| +}
|
| +
|
| PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeFor(const ContainerNode& scope, GetRangeFor getRangeFor) const
|
| {
|
| ASSERT(isNotNull());
|
| @@ -78,7 +83,12 @@ PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeFor(const ContainerNode
|
|
|
| RefPtrWillBeRawPtr<Range> textRunRange = nullptr;
|
|
|
| - TextIterator it(rangeOfContents(const_cast<ContainerNode*>(&scope)).get(), getRangeFor == ForSelection ? TextIteratorEmitsCharactersBetweenAllVisiblePositions : TextIteratorDefaultBehavior);
|
| + TextIteratorBehavior behaviorFlags = TextIteratorDefaultBehavior;
|
| + if (getRangeFor == ForSelection)
|
| + behaviorFlags = TextIteratorEmitsCharactersBetweenAllVisiblePositions;
|
| + else if (getRangeFor == ForInput)
|
| + behaviorFlags = TextIteratorEmitsReplacementChar;
|
| + TextIterator it(rangeOfContents(const_cast<ContainerNode*>(&scope)).get(), behaviorFlags);
|
|
|
| // FIXME: the atEnd() check shouldn't be necessary, workaround for <http://bugs.webkit.org/show_bug.cgi?id=6289>.
|
| if (!start() && !length() && it.atEnd()) {
|
|
|