Bug 893201 - Spot fix cross chrome/content focus handling. r=felipe

This commit is contained in:
Tom Schuster 2013-07-29 11:03:41 -04:00
parent 5ac5ecb22d
commit f880e0e412

View File

@ -3072,7 +3072,9 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
NS_ENSURE_ARG(aPresContext);
NS_ENSURE_ARG_POINTER(aStatus);
HandleCrossProcessEvent(aEvent, aTargetFrame, aStatus);
bool dispatchedToContentProcess = HandleCrossProcessEvent(aEvent,
aTargetFrame,
aStatus);
mCurrentTarget = aTargetFrame;
mCurrentTargetContent = nullptr;
@ -3519,6 +3521,13 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
switch(keyEvent->keyCode) {
case NS_VK_TAB:
case NS_VK_F6:
// Handling the tab event after it was sent to content is bad,
// because to the FocusManager the remote-browser looks like one
// element, so we would just move the focus to the next element
// in chrome, instead of handling it in content.
if (dispatchedToContentProcess)
break;
EnsureDocument(mPresContext);
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm && mDocument) {