From 6cb54103b1cc991b0a17ed0537633be3ccfa1e02 Mon Sep 17 00:00:00 2001 From: Norisz Fay Date: Thu, 2 Jun 2022 22:43:15 +0300 Subject: [PATCH] Backed out changeset 516dad1c0595 (bug 1772032) for causing geckoview-junit failures CLOSED TREE --- accessible/android/SessionAccessibility.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/accessible/android/SessionAccessibility.cpp b/accessible/android/SessionAccessibility.cpp index 7223af642728..9827963bc761 100644 --- a/accessible/android/SessionAccessibility.cpp +++ b/accessible/android/SessionAccessibility.cpp @@ -263,15 +263,11 @@ RefPtr SessionAccessibility::GetInstanceFor( MOZ_ASSERT(NS_IsMainThread()); PresShell* presShell = nullptr; if (LocalAccessible* localAcc = aAccessible->AsLocal()) { - DocAccessible* docAcc = localAcc->Document(); - // If the accessible is being shutdown from the doc's shutdown - // the doc accessible won't have a ref to a presshell anymore, - // but we should have a ref to the DOM document node, and the DOM doc - // has a ref to the presshell. - dom::Document* doc = docAcc ? docAcc->DocumentNode() : nullptr; - if (doc && doc->IsContentDocument()) { + DocAccessible* doc = localAcc->Document(); + if (doc && !doc->HasShutdown() && + doc->DocumentNode()->IsContentDocument()) { // Only content accessibles should have an associated SessionAccessible. - presShell = doc->GetPresShell(); + presShell = doc->PresShellPtr(); } } else { dom::CanonicalBrowsingContext* cbc =