| Index: Source/core/editing/SelectionController.cpp
|
| diff --git a/Source/core/editing/SelectionController.cpp b/Source/core/editing/SelectionController.cpp
|
| index 47c1c02bb5cf89ff4f6a032272c056b3d64063cb..2c31da36b6a9d78cd7c935ac67269609d39bb44a 100644
|
| --- a/Source/core/editing/SelectionController.cpp
|
| +++ b/Source/core/editing/SelectionController.cpp
|
| @@ -78,19 +78,27 @@ static inline bool dispatchSelectStart(Node* node)
|
| return node->dispatchEvent(Event::createCancelableBubble(EventTypeNames::selectstart));
|
| }
|
|
|
| -static VisibleSelection expandSelectionToRespectUserSelectAll(Node* targetNode, const VisibleSelection& selection)
|
| +template <typename Strategy>
|
| +VisibleSelection expandSelectionToRespectUserSelectAllAlgorithm(Node* targetNode, const VisibleSelection& selection)
|
| {
|
| - Node* rootUserSelectAll = Position::rootUserSelectAllForNode(targetNode);
|
| + using PositionType = typename Strategy::PositionType;
|
| +
|
| + Node* rootUserSelectAll = PositionType::rootUserSelectAllForNode(targetNode);
|
| if (!rootUserSelectAll)
|
| return selection;
|
|
|
| VisibleSelection newSelection(selection);
|
| - newSelection.setBase(positionBeforeNode(rootUserSelectAll).upstream(CanCrossEditingBoundary));
|
| - newSelection.setExtent(positionAfterNode(rootUserSelectAll).downstream(CanCrossEditingBoundary));
|
| + newSelection.setBase(PositionType::beforeNode(rootUserSelectAll).upstream(CanCrossEditingBoundary));
|
| + newSelection.setExtent(PositionType::afterNode(rootUserSelectAll).downstream(CanCrossEditingBoundary));
|
|
|
| return newSelection;
|
| }
|
|
|
| +static VisibleSelection expandSelectionToRespectUserSelectAll(Node* targetNode, const VisibleSelection& selection)
|
| +{
|
| + return expandSelectionToRespectUserSelectAllAlgorithm<VisibleSelection::InDOMTree>(targetNode, selection);
|
| +}
|
| +
|
| bool SelectionController::updateSelectionForMouseDownDispatchingSelectStart(Node* targetNode, const VisibleSelection& selection, TextGranularity granularity)
|
| {
|
| if (Position::nodeIsUserSelectNone(targetNode))
|
|
|