Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Unified Diff: Source/core/dom/Element.cpp

Issue 284823005: Calling focus() on an iframe should not trigger a 'focusout' event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/frames/frame-focus-no-focusout-event.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « LayoutTests/fast/frames/frame-focus-no-focusout-event.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698