Bug 1156964, consume tab key also in e10s, r=felipe
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Thu, 07 May 2015 17:20:18 +0300
changeset 274180 6e730c0cfe2ded5786c710b01aa542318b082b35
parent 274179 2eece81b2e248c0c7c05836f98fe4fb05e8dc23f
child 274181 ed0e1346dc358b8f1c743c7992cb88618ed337e3
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1156964
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1156964, consume tab key also in e10s, r=felipe
dom/events/EventStateManager.cpp
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2740,16 +2740,18 @@ EventStateManager::PostHandleKeyboardEve
 
   // XXX Currently, our automated tests don't support mKeyNameIndex.
   //     Therefore, we still need to handle this with keyCode.
   switch(aKeyboardEvent->keyCode) {
     case NS_VK_TAB:
     case NS_VK_F6:
       // This is to prevent keyboard scrolling while alt modifier in use.
       if (!aKeyboardEvent->IsAlt()) {
+        aStatus = nsEventStatus_eConsumeNoDefault;
+
         // 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);
@@ -2763,17 +2765,16 @@ EventStateManager::PostHandleKeyboardEve
                          static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_BACKWARD)) :
             (isDocMove ? static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_FORWARDDOC) :
                          static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_FORWARD));
           nsCOMPtr<nsIDOMElement> result;
           fm->MoveFocus(mDocument->GetWindow(), nullptr, dir,
                         nsIFocusManager::FLAG_BYKEY,
                         getter_AddRefs(result));
         }
-        aStatus = nsEventStatus_eConsumeNoDefault;
       }
       return;
     case 0:
       // We handle keys with no specific keycode value below.
       break;
     default:
       return;
   }