mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
Bug 1173418 - Check if a document is top level in DocAccessibleParent::Destroy so that RemoteDocShutdown isn't erroneously called r=tbsaunde
This commit is contained in:
parent
db2464f3c0
commit
66a8fe1d95
@ -213,8 +213,11 @@ DocAccessibleParent::Destroy()
|
||||
|
||||
mAccessibles.EnumerateEntries(ShutdownAccessibles, nullptr);
|
||||
ProxyDestroyed(this);
|
||||
mParentDoc ? mParentDoc->RemoveChildDoc(this)
|
||||
: GetAccService()->RemoteDocShutdown(this);
|
||||
}
|
||||
}
|
||||
if (mParentDoc)
|
||||
mParentDoc->RemoveChildDoc(this);
|
||||
else if (IsTopLevel())
|
||||
GetAccService()->RemoteDocShutdown(this);
|
||||
}
|
||||
|
||||
} // a11y
|
||||
} // mozilla
|
||||
|
@ -26,7 +26,8 @@ class DocAccessibleParent : public ProxyAccessible,
|
||||
{
|
||||
public:
|
||||
DocAccessibleParent() :
|
||||
ProxyAccessible(this), mParentDoc(nullptr), mShutdown(false)
|
||||
ProxyAccessible(this), mParentDoc(nullptr),
|
||||
mTopLevel(false), mShutdown(false)
|
||||
{ MOZ_COUNT_CTOR_INHERITED(DocAccessibleParent, ProxyAccessible); }
|
||||
~DocAccessibleParent()
|
||||
{
|
||||
@ -35,6 +36,9 @@ public:
|
||||
MOZ_ASSERT(!ParentDoc());
|
||||
}
|
||||
|
||||
void SetTopLevel() { mTopLevel = true; }
|
||||
bool IsTopLevel() const { return mTopLevel; }
|
||||
|
||||
/*
|
||||
* Called when a message from a document in a child process notifies the main
|
||||
* process it is firing an event.
|
||||
@ -151,6 +155,7 @@ private:
|
||||
* proxy object so we can't use a real map.
|
||||
*/
|
||||
nsTHashtable<ProxyEntry> mAccessibles;
|
||||
bool mTopLevel;
|
||||
bool mShutdown;
|
||||
};
|
||||
|
||||
|
@ -1137,6 +1137,7 @@ TabParent::RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc,
|
||||
return parentDoc->AddChildDoc(doc, aParentID);
|
||||
} else {
|
||||
MOZ_ASSERT(!aParentID);
|
||||
doc->SetTopLevel();
|
||||
a11y::DocManager::RemoteDocAdded(doc);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user