| Index: Source/core/page/FocusController.cpp
|
| diff --git a/Source/core/page/FocusController.cpp b/Source/core/page/FocusController.cpp
|
| index 3629d5ef3a7601f61ba064e4713743a39faccfe6..149ff8a87bca01cdc267d43e738c6569f5615562 100644
|
| --- a/Source/core/page/FocusController.cpp
|
| +++ b/Source/core/page/FocusController.cpp
|
| @@ -665,17 +665,11 @@ static void clearSelectionIfNeeded(LocalFrame* oldFocusedFrame, LocalFrame* newF
|
| if (selectionStartNode == newFocusedNode || selectionStartNode->isDescendantOf(newFocusedNode))
|
| return;
|
|
|
| - if (selectionStartNode->isInShadowTree() && selectionStartNode->shadowHost() == newFocusedNode)
|
| + if (!enclosingTextFormControl(selectionStartNode))
|
| return;
|
|
|
| - if (Node* mousePressNode = newFocusedFrame->eventHandler().mousePressNode()) {
|
| - if (mousePressNode->renderer() && !mousePressNode->canStartSelection()) {
|
| - // Don't clear the selection for contentEditable elements, but do
|
| - // clear it for input and textarea. See bug 38696.
|
| - if (!enclosingTextFormControl(selection.start()))
|
| - return;
|
| - }
|
| - }
|
| + if (selectionStartNode->isInShadowTree() && selectionStartNode->shadowHost() == newFocusedNode)
|
| + return;
|
|
|
| selection.clear();
|
| }
|
|
|