| Index: third_party/WebKit/Source/core/page/FocusController.cpp
|
| diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp
|
| index c75f524ac1ac4de629c2045c739a8667a6e8457c..e14308a0db90ac9217534bd245f67627adac5951 100644
|
| --- a/third_party/WebKit/Source/core/page/FocusController.cpp
|
| +++ b/third_party/WebKit/Source/core/page/FocusController.cpp
|
| @@ -1066,34 +1066,6 @@ static bool relinquishesEditingFocus(const Element& element) {
|
| return element.document().frame() && rootEditableElement(element);
|
| }
|
|
|
| -static void clearSelectionIfNeeded(LocalFrame* oldFocusedFrame,
|
| - LocalFrame* newFocusedFrame,
|
| - Element* newFocusedElement) {
|
| - if (!oldFocusedFrame || !newFocusedFrame)
|
| - return;
|
| -
|
| - if (oldFocusedFrame->document() != newFocusedFrame->document())
|
| - return;
|
| -
|
| - FrameSelection& selection = oldFocusedFrame->selection();
|
| - if (selection.isNone())
|
| - return;
|
| -
|
| - Node* selectionStartNode = selection.selection().start().anchorNode();
|
| - if (selectionStartNode == newFocusedElement ||
|
| - selectionStartNode->isDescendantOf(newFocusedElement))
|
| - return;
|
| -
|
| - if (!enclosingTextControl(selectionStartNode))
|
| - return;
|
| -
|
| - if (selectionStartNode->isInShadowTree() &&
|
| - selectionStartNode->ownerShadowHost() == newFocusedElement)
|
| - return;
|
| -
|
| - selection.clear();
|
| -}
|
| -
|
| bool FocusController::setFocusedElement(Element* element,
|
| Frame* newFocusedFrame) {
|
| return setFocusedElement(
|
| @@ -1130,10 +1102,6 @@ bool FocusController::setFocusedElement(Element* element,
|
| newDocument->focusedElement() == element)
|
| return true;
|
|
|
| - if (newFocusedFrame && newFocusedFrame->isLocalFrame())
|
| - clearSelectionIfNeeded(oldFocusedFrame, toLocalFrame(newFocusedFrame),
|
| - element);
|
| -
|
| if (oldDocument && oldDocument != newDocument)
|
| oldDocument->clearFocusedElement();
|
|
|
|
|