mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Bug 1772032 - Use DOM document node for getting SessionAcc instance. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D148045
This commit is contained in:
parent
8fa17f2e94
commit
c6fb2fffb7
@ -263,11 +263,15 @@ RefPtr<SessionAccessibility> SessionAccessibility::GetInstanceFor(
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
PresShell* presShell = nullptr;
|
||||
if (LocalAccessible* localAcc = aAccessible->AsLocal()) {
|
||||
DocAccessible* doc = localAcc->Document();
|
||||
if (doc && !doc->HasShutdown() &&
|
||||
doc->DocumentNode()->IsContentDocument()) {
|
||||
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()) {
|
||||
// Only content accessibles should have an associated SessionAccessible.
|
||||
presShell = doc->PresShellPtr();
|
||||
presShell = doc->GetPresShell();
|
||||
}
|
||||
} else {
|
||||
dom::CanonicalBrowsingContext* cbc =
|
||||
|
Loading…
Reference in New Issue
Block a user