Bug 1704127 - Rename FirePopupShowingEvent to BeginShowingPopup. r=tnikkel

Depends on D111499

Differential Revision: https://phabricator.services.mozilla.com/D111500
This commit is contained in:
Markus Stange 2021-04-10 01:26:24 +00:00
parent c5ebc0cf2d
commit 43398e2c77
2 changed files with 19 additions and 19 deletions

View File

@ -700,17 +700,17 @@ void nsXULPopupManager::ShowMenu(nsIContent* aMenu, bool aSelectFirstItem,
nsCOMPtr<nsIContent> popupContent = popupFrame->GetContent(); nsCOMPtr<nsIContent> popupContent = popupFrame->GetContent();
if (aAsynchronous) { if (aAsynchronous) {
nsCOMPtr<nsIRunnable> event = nsCOMPtr<nsIRunnable> event =
NS_NewRunnableFunction("FirePopupShowingEvent", [=]() { NS_NewRunnableFunction("BeginShowingPopup", [=]() {
nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
if (pm) { if (pm) {
pm->FirePopupShowingEvent(popupContent, parentIsContextMenu, pm->BeginShowingPopup(popupContent, parentIsContextMenu,
aSelectFirstItem, nullptr); aSelectFirstItem, nullptr);
} }
}); });
aMenu->OwnerDoc()->Dispatch(TaskCategory::Other, event.forget()); aMenu->OwnerDoc()->Dispatch(TaskCategory::Other, event.forget());
} else { } else {
FirePopupShowingEvent(popupContent, parentIsContextMenu, aSelectFirstItem, BeginShowingPopup(popupContent, parentIsContextMenu, aSelectFirstItem,
nullptr); nullptr);
} }
} }
@ -730,8 +730,7 @@ void nsXULPopupManager::ShowPopup(nsIContent* aPopup,
aYPos, MenuPopupAnchorType_Node, aYPos, MenuPopupAnchorType_Node,
aAttributesOverride); aAttributesOverride);
FirePopupShowingEvent(aPopup, aIsContextMenu, aSelectFirstItem, BeginShowingPopup(aPopup, aIsContextMenu, aSelectFirstItem, aTriggerEvent);
aTriggerEvent);
} }
static bool ShouldUseNativeContextMenus() { static bool ShouldUseNativeContextMenus() {
@ -760,7 +759,7 @@ void nsXULPopupManager::ShowPopupAtScreen(nsIContent* aPopup, int32_t aXPos,
popupFrame->InitializePopupAtScreen(triggerContent, aXPos, aYPos, popupFrame->InitializePopupAtScreen(triggerContent, aXPos, aYPos,
aIsContextMenu); aIsContextMenu);
FirePopupShowingEvent(aPopup, aIsContextMenu, false, aTriggerEvent); BeginShowingPopup(aPopup, aIsContextMenu, false, aTriggerEvent);
} }
bool nsXULPopupManager::ShowPopupAsNativeMenu(nsIContent* aPopup, int32_t aXPos, bool nsXULPopupManager::ShowPopupAsNativeMenu(nsIContent* aPopup, int32_t aXPos,
@ -869,7 +868,7 @@ void nsXULPopupManager::ShowPopupAtScreenRect(
popupFrame->InitializePopupAtRect(triggerContent, aPosition, aRect, popupFrame->InitializePopupAtRect(triggerContent, aPosition, aRect,
aAttributesOverride); aAttributesOverride);
FirePopupShowingEvent(aPopup, aIsContextMenu, false, aTriggerEvent); BeginShowingPopup(aPopup, aIsContextMenu, false, aTriggerEvent);
} }
void nsXULPopupManager::ShowTooltipAtPosition(nsIContent* aPopup, void nsXULPopupManager::ShowTooltipAtPosition(nsIContent* aPopup,
@ -885,7 +884,7 @@ void nsXULPopupManager::ShowTooltipAtPosition(nsIContent* aPopup,
popupFrame->InitializePopup(aTriggerContent, aTriggerContent, aPosition, 0, 0, popupFrame->InitializePopup(aTriggerContent, aTriggerContent, aPosition, 0, 0,
MenuPopupAnchorType_Node, false); MenuPopupAnchorType_Node, false);
FirePopupShowingEvent(aPopup, false, false, nullptr); BeginShowingPopup(aPopup, false, false, nullptr);
} }
void nsXULPopupManager::ShowTooltipAtScreen(nsIContent* aPopup, void nsXULPopupManager::ShowTooltipAtScreen(nsIContent* aPopup,
@ -911,7 +910,7 @@ void nsXULPopupManager::ShowTooltipAtScreen(nsIContent* aPopup,
popupFrame->InitializePopupAtScreen(aTriggerContent, aXPos, aYPos, false); popupFrame->InitializePopupAtScreen(aTriggerContent, aXPos, aYPos, false);
FirePopupShowingEvent(aPopup, false, false, nullptr); BeginShowingPopup(aPopup, false, false, nullptr);
} }
static void CheckCaretDrawingState() { static void CheckCaretDrawingState() {
@ -1424,10 +1423,10 @@ void nsXULPopupManager::ExecuteMenu(nsIContent* aMenu,
aMenu->OwnerDoc()->Dispatch(TaskCategory::Other, event.forget()); aMenu->OwnerDoc()->Dispatch(TaskCategory::Other, event.forget());
} }
void nsXULPopupManager::FirePopupShowingEvent(nsIContent* aPopup, void nsXULPopupManager::BeginShowingPopup(nsIContent* aPopup,
bool aIsContextMenu, bool aIsContextMenu,
bool aSelectFirstItem, bool aSelectFirstItem,
Event* aTriggerEvent) { Event* aTriggerEvent) {
nsCOMPtr<nsIContent> popup = aPopup; // keep a strong reference to the popup nsCOMPtr<nsIContent> popup = aPopup; // keep a strong reference to the popup
nsMenuPopupFrame* popupFrame = do_QueryFrame(aPopup->GetPrimaryFrame()); nsMenuPopupFrame* popupFrame = do_QueryFrame(aPopup->GetPrimaryFrame());

View File

@ -696,7 +696,8 @@ class nsXULPopupManager final : public nsIDOMEventListener,
nsPopupType aPopupType, bool aDeselectMenu); nsPopupType aPopupType, bool aDeselectMenu);
/** /**
* Fire a popupshowing event on the popup and then open the popup. * Trigger frame construction and reflow in the popup, fire a popupshowing
* event on the popup and then open the popup.
* *
* aPopup - the popup to open * aPopup - the popup to open
* aIsContextMenu - true for context menus * aIsContextMenu - true for context menus
@ -705,9 +706,9 @@ class nsXULPopupManager final : public nsIDOMEventListener,
* This is currently used to propagate the * This is currently used to propagate the
* inputSource attribute. May be null. * inputSource attribute. May be null.
*/ */
void FirePopupShowingEvent(nsIContent* aPopup, bool aIsContextMenu, void BeginShowingPopup(nsIContent* aPopup, bool aIsContextMenu,
bool aSelectFirstItem, bool aSelectFirstItem,
mozilla::dom::Event* aTriggerEvent); mozilla::dom::Event* aTriggerEvent);
/** /**
* Fire a popuphiding event and then hide the popup. This will be called * Fire a popuphiding event and then hide the popup. This will be called