зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
2ed860b51f
Коммит
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")) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче