Chromium Code Reviews| Index: Source/core/editing/FrameSelection.cpp |
| diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp |
| index f569c89dd61fed3d4ebcf390d5bd4fdd114e5b25..90daa7055a48de099b99e7f013f86576798031a2 100644 |
| --- a/Source/core/editing/FrameSelection.cpp |
| +++ b/Source/core/editing/FrameSelection.cpp |
| @@ -557,13 +557,14 @@ VisiblePosition FrameSelection::nextWordPositionForPlatform(const VisiblePositio |
| return positionAfterCurrentWord; |
| } |
| -#if ENABLE(USERSELECT_ALL) |
| static void adjustPositionForUserSelectAll(VisiblePosition& pos, bool isForward) |
| { |
| + if (!RuntimeEnabledFeatures::userSelectAllEnabled()) |
| + return; |
| + |
| if (Node* rootUserSelectAll = Position::rootUserSelectAllForNode(pos.deepEquivalent().anchorNode())) |
| pos = isForward ? positionAfterNode(rootUserSelectAll).downstream(CanCrossEditingBoundary) : positionBeforeNode(rootUserSelectAll).upstream(CanCrossEditingBoundary); |
| } |
| -#endif |
| VisiblePosition FrameSelection::modifyExtendingRight(TextGranularity granularity) |
| { |
| @@ -603,9 +604,7 @@ VisiblePosition FrameSelection::modifyExtendingRight(TextGranularity granularity |
| pos = modifyExtendingForward(granularity); |
| break; |
| } |
| -#if ENABLE(USERSELECT_ALL) |
| adjustPositionForUserSelectAll(pos, directionOfEnclosingBlock() == LTR); |
| -#endif |
| return pos; |
| } |
| @@ -645,9 +644,7 @@ VisiblePosition FrameSelection::modifyExtendingForward(TextGranularity granulari |
| pos = endOfDocument(pos); |
| break; |
| } |
| -#if ENABLE(USERSELECT_ALL) |
| adjustPositionForUserSelectAll(pos, directionOfEnclosingBlock() == LTR); |
|
adamk
2013/08/09 21:42:32
Indentation is off-by-one here.
|
| -#endif |
| return pos; |
| } |
| @@ -770,9 +767,7 @@ VisiblePosition FrameSelection::modifyExtendingLeft(TextGranularity granularity) |
| pos = modifyExtendingBackward(granularity); |
| break; |
| } |
| -#if ENABLE(USERSELECT_ALL) |
| adjustPositionForUserSelectAll(pos, !(directionOfEnclosingBlock() == LTR)); |
| -#endif |
| return pos; |
| } |
| @@ -817,9 +812,7 @@ VisiblePosition FrameSelection::modifyExtendingBackward(TextGranularity granular |
| pos = startOfDocument(pos); |
| break; |
| } |
| -#if ENABLE(USERSELECT_ALL) |
| adjustPositionForUserSelectAll(pos, !(directionOfEnclosingBlock() == LTR)); |
| -#endif |
| return pos; |
| } |