mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1597043: RootAccessible::ProcessDOMEvent: Return early if AsXULMultiSelectControl() on a XUL tree element fails. r=MarcoZ
This really shouldn't be possible. All XUL trees should have nsIDOMXULMultiSelectControlElement, and the tree is focused at this point, so it shouldn't be dying. Nevertheless, this sometimes happens in the wild and was causing crashes. Differential Revision: https://phabricator.services.mozilla.com/D53373 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2ed860b51f
commit
135e99b607
@ -348,6 +348,15 @@ void RootAccessible::ProcessDOMEvent(Event* aDOMEvent, nsINode* aTarget) {
|
||||
if (FocusMgr()->HasDOMFocus(targetNode)) {
|
||||
nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSel =
|
||||
targetNode->AsElement()->AsXULMultiSelectControl();
|
||||
if (!multiSel) {
|
||||
// This shouldn't be possible. All XUL trees should have
|
||||
// nsIDOMXULMultiSelectControlElement, and the tree is focused, so it
|
||||
// shouldn't be dying. Nevertheless, this sometimes happens in the wild
|
||||
// (bug 1597043).
|
||||
MOZ_ASSERT_UNREACHABLE(
|
||||
"XUL tree doesn't have nsIDOMXULMultiSelectControlElement");
|
||||
return;
|
||||
}
|
||||
nsAutoString selType;
|
||||
multiSel->GetSelType(selType);
|
||||
if (selType.IsEmpty() || !selType.EqualsLiteral("single")) {
|
||||
|
Loading…
Reference in New Issue
Block a user