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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1437813002: Set selection to INPUT/TEXTAREA before dispatching 'focus' event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve selection-functions.html Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index c544728907199ece1367b6ba13a3ea1f8dc966eb..3024deae3e7d05234c48edaf8afe5137d1d98878 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -3538,6 +3538,8 @@ bool Document::setFocusedElement(PassRefPtrWillBeRawPtr<Element> prpNewFocusedEl
m_focusedElement = newFocusedElement;
m_focusedElement->setFocus(true);
+ cancelFocusAppearanceUpdate();
+ m_focusedElement->updateFocusAppearance(params.selectionBehavior);
// Dispatch the focus event and let the node do any other focus related activities (important for text fields)
// If page lost focus, event will be dispatched on page focus, don't duplicate

Powered by Google App Engine
This is Rietveld 408576698