Bug 599053 - Check for focus in chrome before forwarding IME events; r=smaug a=blocking-fennec GECKO20b7pre_20100929_RELBRANCH
authorJim Chen <jimnchen@gmail.com>
Mon, 27 Sep 2010 17:46:51 -0400
branchGECKO20b7pre_20100929_RELBRANCH
changeset 54775 d7f2e1898c4f676e7347ae3acffbdfa2d1aab581
parent 54773 793167afe8b48ca926a1038e7f3dceacaa505e4a
child 54874 e82996480172cb3b7d4adf373a7743518823b4b9
push idunknown
push userunknown
push dateunknown
reviewerssmaug, blocking-fennec
bugs599053
milestone2.0b7pre
Bug 599053 - Check for focus in chrome before forwarding IME events; r=smaug a=blocking-fennec
content/events/src/nsEventStateManager.cpp
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -3296,16 +3296,21 @@ TabParent*
 nsEventStateManager::GetCrossProcessTarget()
 {
   return TabParent::GetIMETabParent();
 }
 
 PRBool
 nsEventStateManager::IsTargetCrossProcess(nsGUIEvent *aEvent)
 {
+  // Check to see if there is a focused, editable content in chrome,
+  // in that case, do not forward IME events to content
+  nsIContent *focusedContent = GetFocusedContent();
+  if (focusedContent && focusedContent->IsEditable())
+    return PR_FALSE;
   return TabParent::GetIMETabParent() != nsnull;
 }
 #endif
 
 NS_IMETHODIMP
 nsEventStateManager::NotifyDestroyPresContext(nsPresContext* aPresContext)
 {
   nsIMEStateManager::OnDestroyPresContext(aPresContext);