mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1663513: Add a null check to an existing assertion to prevent possible crashes related to popups and mouse events on Windows. r=cmartin
Differential Revision: https://phabricator.services.mozilla.com/D163515
This commit is contained in:
parent
2cb65518c0
commit
7984049da0
@ -486,16 +486,18 @@ uint32_t nsXULPopupManager::GetSubmenuWidgetChain(
|
||||
if (!item->IsNoAutoHide()) {
|
||||
nsCOMPtr<nsIWidget> widget = item->Frame()->GetWidget();
|
||||
NS_ASSERTION(widget, "open popup has no widget");
|
||||
aWidgetChain->AppendElement(widget.get());
|
||||
// In the case when a menulist inside a panel is open, clicking in the
|
||||
// panel should still roll up the menu, so if a different type is found,
|
||||
// stop scanning.
|
||||
if (!sameTypeCount) {
|
||||
count++;
|
||||
if (!parent ||
|
||||
item->Frame()->PopupType() != parent->Frame()->PopupType() ||
|
||||
item->IsContextMenu() != parent->IsContextMenu()) {
|
||||
sameTypeCount = count;
|
||||
if (widget) {
|
||||
aWidgetChain->AppendElement(widget.get());
|
||||
// In the case when a menulist inside a panel is open, clicking in the
|
||||
// panel should still roll up the menu, so if a different type is found,
|
||||
// stop scanning.
|
||||
if (!sameTypeCount) {
|
||||
count++;
|
||||
if (!parent ||
|
||||
item->Frame()->PopupType() != parent->Frame()->PopupType() ||
|
||||
item->IsContextMenu() != parent->IsContextMenu()) {
|
||||
sameTypeCount = count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user