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

Unified Diff: content/renderer/render_view_impl.cc

Issue 33323003: Fix the order of the event dispatch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test case. Created 7 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 022fcf3ea16073dd71bd0f1240da1e0ef11d7d54..79ec6fc215141288776b48abf860e5ffab4a3ea0 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -2584,8 +2584,13 @@ void RenderViewImpl::didChangeSelection(bool is_empty_selection) {
if (is_empty_selection)
selection_text_.clear();
- SyncSelectionIfRequired();
+ // UpdateTextInputType should be called before SyncSelectionIfRequired.
+ // UpdateTextInputType may send TextInputTypeChanged to notify the focus
+ // was changed, and SyncSelectionIfRequired may send SelectionChanged
+ // to notify the selection was changed. Focus change should be notified
+ // before selection change.
UpdateTextInputType();
+ SyncSelectionIfRequired();
#if defined(OS_ANDROID)
UpdateTextInputState(false, true);
#endif
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698