mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 801659 - clean up cache of DocAccessible on pres shells, and add fast path to nsAccDocManager::GetDocAccessible() r=surkov, dholbert
This commit is contained in:
parent
428c858534
commit
bc9ac5fb2d
@ -40,7 +40,14 @@ public:
|
||||
*/
|
||||
DocAccessible* GetDocAccessible(const nsIPresShell* aPresShell)
|
||||
{
|
||||
return aPresShell ? GetDocAccessible(aPresShell->GetDocument()) : nullptr;
|
||||
if (!aPresShell)
|
||||
return nullptr;
|
||||
|
||||
DocAccessible* doc = aPresShell->GetDocAccessible();
|
||||
if (doc)
|
||||
return doc;
|
||||
|
||||
return GetDocAccessible(aPresShell->GetDocument());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,7 +86,7 @@ DocAccessible::
|
||||
{
|
||||
mFlags |= eDocAccessible | eNotNodeMapEntry;
|
||||
if (mPresShell)
|
||||
mPresShell->SetAccDocument(this);
|
||||
mPresShell->SetDocAccessible(this);
|
||||
|
||||
mDependentIDsHash.Init();
|
||||
// XXX aaronl should we use an algorithm for the initial cache size?
|
||||
@ -636,7 +636,7 @@ DocAccessible::Shutdown()
|
||||
logging::DocDestroy("document shutdown", mDocument, this);
|
||||
#endif
|
||||
|
||||
mPresShell->SetAccDocument(nullptr);
|
||||
mPresShell->SetDocAccessible(nullptr);
|
||||
|
||||
if (mNotificationController) {
|
||||
mNotificationController->Shutdown();
|
||||
|
@ -277,9 +277,20 @@ public:
|
||||
nsIViewManager* GetViewManager() const { return mViewManager; }
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
void SetAccDocument(DocAccessible* aAccDocument)
|
||||
/**
|
||||
* Return the document accessible for this pres shell if there is one.
|
||||
*/
|
||||
DocAccessible* GetDocAccessible() const
|
||||
{
|
||||
mAccDocument = aAccDocument;
|
||||
return mDocAccessible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the document accessible for this pres shell.
|
||||
*/
|
||||
void SetDocAccessible(DocAccessible* aDocAccessible)
|
||||
{
|
||||
mDocAccessible = aDocAccessible;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1371,7 +1382,7 @@ protected:
|
||||
nsWeakPtr mForwardingContainer;
|
||||
nsRefreshDriver* mHiddenInvalidationObserverRefreshDriver;
|
||||
#ifdef ACCESSIBILITY
|
||||
DocAccessible* mAccDocument;
|
||||
DocAccessible* mDocAccessible;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -937,14 +937,14 @@ PresShell::Destroy()
|
||||
return;
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
if (mAccDocument) {
|
||||
if (mDocAccessible) {
|
||||
#ifdef DEBUG
|
||||
if (a11y::logging::IsEnabled(a11y::logging::eDocDestroy))
|
||||
a11y::logging::DocDestroy("presshell destroyed", mDocument);
|
||||
#endif
|
||||
|
||||
mAccDocument->Shutdown();
|
||||
mAccDocument = nullptr;
|
||||
mDocAccessible->Shutdown();
|
||||
mDocAccessible = nullptr;
|
||||
}
|
||||
#endif // ACCESSIBILITY
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user