Bug 1701085 - Return the native menu's trigger node from nsXULPopupManager::GetLastTriggerNode while the native menu is open. r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D110304
This commit is contained in:
Markus Stange 2021-03-31 17:41:56 +00:00
Родитель c4d150d967
Коммит 8880f6598d
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1678,6 +1678,12 @@ already_AddRefed<nsINode> nsXULPopupManager::GetLastTriggerNode(
nsCOMPtr<nsIContent> openingPopup = mOpeningPopup;
node = nsMenuPopupFrame::GetTriggerContent(
GetPopupFrameForContent(openingPopup, false));
} else if (mNativeMenu && !aIsTooltip) {
RefPtr<dom::Element> popup = mNativeMenu->Element();
if (popup->GetUncomposedDoc() == aDocument) {
nsMenuPopupFrame* popupFrame = GetPopupFrameForContent(popup, false);
node = nsMenuPopupFrame::GetTriggerContent(popupFrame);
}
} else {
nsMenuChainItem* item = mPopups;
while (item) {