Index: Source/core/dom/Element.cpp |
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
index d0ecdf815c4a6f5086d6ea5c7f8d38e187946b7a..d804c5bc0be2ad86891b0f5531081a52e6743304 100644 |
--- a/Source/core/dom/Element.cpp |
+++ b/Source/core/dom/Element.cpp |
@@ -2113,7 +2113,9 @@ void Element::updateFocusAppearance(bool /*restorePreviousSelection*/) |
// FIXME: We should restore the previous selection if there is one. |
VisibleSelection newSelection = VisibleSelection(firstPositionInOrBeforeNode(this), DOWNSTREAM); |
- frame->selection().setSelection(newSelection); |
+ // Passing DoNotSetFocus as this function is called after FocusController::setFocusedElement() |
+ // and we don't want to change the focus to a new Element. |
+ frame->selection().setSelection(newSelection, FrameSelection::DoNotSetFocus); |
frame->selection().revealSelection(); |
} else if (renderer() && !renderer()->isWidget()) |
renderer()->scrollRectToVisible(boundingBox()); |