Bug 862863 - inactive document accessible might be lost, r=tbsaunde

This commit is contained in:
Alexander Surkov 2013-05-04 20:06:22 +09:00
Родитель 5c2672f45f
Коммит e0c75c54ed
2 изменённых файлов: 15 добавлений и 9 удалений

Просмотреть файл

@ -1917,7 +1917,10 @@ DocAccessible::ShutdownChildrenInSubtree(Accessible* aAccessible)
jdx++;
}
ShutdownChildrenInSubtree(child);
// Don't cross document boundaries. The outerdoc shutdown takes care about
// its subdocument.
if (!child->IsDoc())
ShutdownChildrenInSubtree(child);
}
UnbindFromDocument(aAccessible);

Просмотреть файл

@ -7,7 +7,7 @@
#include "Accessible-inl.h"
#include "nsAccUtils.h"
#include "DocAccessible.h"
#include "DocAccessible-inl.h"
#include "Role.h"
#include "States.h"
@ -109,22 +109,25 @@ OuterDocAccessible::Shutdown()
{
// XXX: sometimes outerdoc accessible is shutdown because of layout style
// change however the presshell of underlying document isn't destroyed and
// the document doesn't get pagehide events. Shutdown underlying document if
// any to avoid hanging document accessible.
// the document doesn't get pagehide events. Schedule a document rebind
// to its parent document. Otherwise a document accessible may be lost if its
// outerdoc has being recreated (see bug 862863 for details).
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eDocDestroy))
logging::OuterDocDestroy(this);
#endif
Accessible* childAcc = mChildren.SafeElementAt(0, nullptr);
if (childAcc) {
Accessible* child = mChildren.SafeElementAt(0, nullptr);
if (child) {
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eDocDestroy)) {
logging::DocDestroy("outerdoc's child document shutdown",
childAcc->AsDoc()->DocumentNode());
logging::DocDestroy("outerdoc's child document rebind is scheduled",
child->AsDoc()->DocumentNode());
}
#endif
childAcc->Shutdown();
RemoveChild(child);
mDoc->BindChildDocument(child->AsDoc());
}
AccessibleWrap::Shutdown();