| Index: third_party/WebKit/Source/core/editing/DOMSelection.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
|
| index f14363f72d40bd6c089440af596e4a44d02fcece..a1abcd196b9f0c79a394804ef596e40a4255b0e1 100644
|
| --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
|
| @@ -428,11 +428,15 @@ void DOMSelection::modify(const String& alterString,
|
| frame()->selection().modify(alter, direction, granularity);
|
| }
|
|
|
| +// https://www.w3.org/TR/selection-api/#dom-selection-extend
|
| void DOMSelection::extend(Node* node,
|
| int offset,
|
| ExceptionState& exceptionState) {
|
| DCHECK(node);
|
| - // https://www.w3.org/TR/selection-api/#dom-selection-extend
|
| + // 1. If node's root is not the document associated with the context object,
|
| + // abort these steps.
|
| + if (!isValidForPosition(node))
|
| + return;
|
|
|
| // 2. If the context object is empty, throw an InvalidStateError exception and
|
| // abort these steps.
|
| @@ -451,11 +455,6 @@ void DOMSelection::extend(Node* node,
|
| if (exceptionState.hadException())
|
| return;
|
|
|
| - // 1. If node's root is not the document associated with the context object,
|
| - // abort these steps.
|
| - if (!isValidForPosition(node))
|
| - return;
|
| -
|
| // 3. Let oldAnchor and oldFocus be the context object's anchor and focus, and
|
| // let newFocus be the boundary point (node, offset).
|
| const Position& oldAnchor = anchorPosition();
|
|
|