зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1700706 - Clear active and capturing content before opening native menus. r=tnikkel
This is copied from the nsMenuPopupFrame::ShowPopup just a few lines below. The native menu consumes mouseup events so we need to clear :active and capturing content just before opening the menu. Differential Revision: https://phabricator.services.mozilla.com/D109672
This commit is contained in:
Родитель
502d8c18c3
Коммит
b7f729bf73
|
@ -958,6 +958,17 @@ void nsMenuPopupFrame::InitializePopupAtRect(nsIContent* aTriggerContent,
|
|||
|
||||
void nsMenuPopupFrame::ShowNativeMenu() {
|
||||
MOZ_RELEASE_ASSERT(mNativeMenu);
|
||||
|
||||
// While the native menu is open, it consumes mouseup events.
|
||||
// Clear any :active state and mouse capture now so that we don't get stuck in
|
||||
// that state.
|
||||
EventStateManager* activeESM = static_cast<EventStateManager*>(
|
||||
EventStateManager::GetActiveEventStateManager());
|
||||
if (activeESM) {
|
||||
EventStateManager::ClearGlobalActiveContent(activeESM);
|
||||
}
|
||||
PresShell::ReleaseCapturingContent();
|
||||
|
||||
bool succeeded = mNativeMenu->ShowAsContextMenu(
|
||||
DesktopPoint::FromUnknownPoint(mScreenRect.TopLeft()));
|
||||
if (!succeeded) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче