| Index: third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp
|
| index 4e0da7b8bca4b8bed3208ebaf42b26e0d28fe8f0..c84b7cfd8657b7154b42f8c459475d3125a6a772 100644
|
| --- a/third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp
|
| @@ -231,21 +231,18 @@ Position PreviousRootInlineBoxCandidatePosition(
|
| PreviousLeafWithSameEditability(previous_node, editable_type);
|
| }
|
|
|
| - while (previous_node && !previous_node->IsShadowRoot()) {
|
| - if (HighestEditableRoot(FirstPositionInOrBeforeNode(previous_node),
|
| + for (Node* runner = previous_node; runner && !runner->IsShadowRoot();
|
| + runner = PreviousLeafWithSameEditability(runner, editable_type)) {
|
| + if (HighestEditableRoot(FirstPositionInOrBeforeNode(runner),
|
| editable_type) != highest_root)
|
| break;
|
|
|
| - Position pos = isHTMLBRElement(*previous_node)
|
| - ? Position::BeforeNode(previous_node)
|
| - : Position::EditingPositionOf(
|
| - previous_node, CaretMaxOffset(previous_node));
|
| -
|
| - if (IsVisuallyEquivalentCandidate(pos))
|
| - return pos;
|
| -
|
| - previous_node =
|
| - PreviousLeafWithSameEditability(previous_node, editable_type);
|
| + const Position& candidate =
|
| + isHTMLBRElement(*runner)
|
| + ? Position::BeforeNode(runner)
|
| + : Position::EditingPositionOf(runner, CaretMaxOffset(runner));
|
| + if (IsVisuallyEquivalentCandidate(candidate))
|
| + return candidate;
|
| }
|
| return Position();
|
| }
|
|
|