Bug 1313195 - Clear active EventStateManager if a XUL popup is opened. r=enndeakin+6102
authorMike Conley <mconley@mozilla.com>
Wed, 26 Oct 2016 16:51:30 -0400
changeset 319782 2d2a075ce1cd22f35f93534c80a09ef96f1149f7
parent 319757 1ba788373d460f774c9cd1653510dc1765df58cc
child 319783 64f564d7ea4300e9e6492fac5f1aab1c496bd658
push id20748
push userphilringnalda@gmail.com
push dateFri, 28 Oct 2016 03:39:55 +0000
treeherderfx-team@715360440695 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs1313195
milestone52.0a1
Bug 1313195 - Clear active EventStateManager if a XUL popup is opened. r=enndeakin+6102 MozReview-Commit-ID: 2f6ui1X6cxj
layout/xul/nsMenuPopupFrame.cpp
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -875,16 +875,23 @@ nsMenuPopupFrame::ShowPopup(bool aIsCont
   InvalidateFrameSubtree();
 
   if (mPopupState == ePopupShowing || mPopupState == ePopupPositioning) {
     mPopupState = ePopupOpening;
     mIsOpenChanged = true;
 
     // Clear mouse capture when a popup is opened.
     if (mPopupType == ePopupTypeMenu) {
+      EventStateManager* activeESM =
+        static_cast<EventStateManager*>(
+          EventStateManager::GetActiveEventStateManager());
+      if (activeESM) {
+        EventStateManager::ClearGlobalActiveContent(activeESM);
+      }
+
       nsIPresShell::SetCapturingContent(nullptr, 0);
     }
 
     nsMenuFrame* menuFrame = do_QueryFrame(GetParent());
     if (menuFrame) {
       nsWeakFrame weakFrame(this);
       menuFrame->PopupOpened();
       if (!weakFrame.IsAlive())