Bug 1509234: Add some assertions to help debug crashes. r=yzen

Differential Revision: https://phabricator.services.mozilla.com/D38967

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Teh 2019-07-24 00:08:01 +00:00
parent bfedfea6e4
commit b9e786af73

View File

@ -266,6 +266,7 @@ void FocusManager::ProcessFocusEvent(AccEvent* aEvent) {
// Emit focus event if event target is the active item. Otherwise then check
// if it's still focused and then update active item and emit focus event.
Accessible* target = aEvent->GetAccessible();
MOZ_ASSERT(!target->IsDefunct());
if (target != mActiveItem) {
// Check if still focused. Otherwise we can end up with storing the active
// item for control that isn't focused anymore.
@ -281,6 +282,7 @@ void FocusManager::ProcessFocusEvent(AccEvent* aEvent) {
if (activeItem) {
mActiveItem = activeItem;
target = activeItem;
MOZ_ASSERT(!target->IsDefunct());
}
}
@ -349,7 +351,9 @@ void FocusManager::ProcessFocusEvent(AccEvent* aEvent) {
// Fire scrolling_start event when the document receives the focus if it has
// an anchor jump. If an accessible within the document receive the focus
// then null out the anchor jump because it no longer applies.
MOZ_ASSERT(!target->IsDefunct());
DocAccessible* targetDocument = target->Document();
MOZ_ASSERT(targetDocument);
Accessible* anchorJump = targetDocument->AnchorJump();
if (anchorJump) {
if (target == targetDocument) {