From d06a39a730c4787d63adfb58959e3b84719fd4ef Mon Sep 17 00:00:00 2001 From: James Teh Date: Mon, 28 Jul 2025 19:31:35 +0000 Subject: [PATCH] Bug 1977166: When moving a RemoteAccessible, ensure it doesn't still have a parent. a=diannaS Original Revision: https://phabricator.services.mozilla.com/D257206 Differential Revision: https://phabricator.services.mozilla.com/D258841 --- accessible/ipc/DocAccessibleParent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/accessible/ipc/DocAccessibleParent.cpp b/accessible/ipc/DocAccessibleParent.cpp index d5230f1d324d..b9fce0a3228a 100644 --- a/accessible/ipc/DocAccessibleParent.cpp +++ b/accessible/ipc/DocAccessibleParent.cpp @@ -221,7 +221,11 @@ RemoteAccessible* DocAccessibleParent::CreateAcc( RemoteAccessible* newProxy; if ((newProxy = GetAccessible(aAccData.ID()))) { // This is a move. Reuse the Accessible; don't destroy it. - MOZ_ASSERT(!newProxy->RemoteParent()); + if (newProxy->RemoteParent()) { + MOZ_ASSERT_UNREACHABLE( + "Attempt to move RemoteAccessible which still has a parent!"); + return nullptr; + } return newProxy; }