| Index: third_party/WebKit/Source/core/editing/Editor.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
|
| index efec60f7e562efad5a4a867a8d861886caebbfe1..ec51fd0f695fce5ba5b3a1162622410673fb84ff 100644
|
| --- a/third_party/WebKit/Source/core/editing/Editor.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/Editor.cpp
|
| @@ -1191,8 +1191,19 @@ static PassRefPtrWillBeRawPtr<Range> findStringBetweenPositions(const String& ta
|
|
|
| while (true) {
|
| EphemeralRangeTemplate<Strategy> resultRange = findPlainText(searchRange, target, options);
|
| - if (resultRange.isCollapsed())
|
| + if (resultRange.isCollapsed()) {
|
| + if (resultRange.endPosition() != searchRange.endPosition()) {
|
| + // Possibly whitespace spans over multiple TreeScopes.
|
| + // We skip this match and seek for the next occurance.
|
| + if (forward) {
|
| + searchRange = EphemeralRangeTemplate<Strategy>(nextPositionOf(resultRange.startPosition(), PositionMoveType::CodePoint), searchRange.endPosition());
|
| + } else {
|
| + searchRange = EphemeralRangeTemplate<Strategy>(searchRange.startPosition(), previousPositionOf(resultRange.endPosition(), PositionMoveType::CodePoint));
|
| + }
|
| + continue;
|
| + }
|
| return nullptr;
|
| + }
|
|
|
| RefPtrWillBeRawPtr<Range> rangeObject = Range::create(resultRange.document(), toPositionInDOMTree(resultRange.startPosition()), toPositionInDOMTree(resultRange.endPosition()));
|
| if (!rangeObject->collapsed())
|
|
|