зеркало из https://github.com/mozilla/gecko-dev.git
bug 1326084 - rework ProxyAccessible handling of outer docs
This commit is contained in:
Родитель
3466173cca
Коммит
96fc2fb77a
|
@ -25,7 +25,6 @@ void
|
|||
ProxyAccessibleBase<Derived>::Shutdown()
|
||||
{
|
||||
MOZ_DIAGNOSTIC_ASSERT(!IsDoc());
|
||||
NS_ASSERTION(!mOuterDoc, "Why do we still have a child doc?");
|
||||
xpcAccessibleDocument* xpcDoc =
|
||||
GetAccService()->GetCachedXPCDocument(Document());
|
||||
if (xpcDoc) {
|
||||
|
@ -34,16 +33,17 @@ ProxyAccessibleBase<Derived>::Shutdown()
|
|||
|
||||
// XXX Ideally this wouldn't be necessary, but it seems OuterDoc accessibles
|
||||
// can be destroyed before the doc they own.
|
||||
if (!mOuterDoc) {
|
||||
uint32_t childCount = mChildren.Length();
|
||||
if (!mOuterDoc) {
|
||||
for (uint32_t idx = 0; idx < childCount; idx++)
|
||||
mChildren[idx]->Shutdown();
|
||||
} else {
|
||||
if (mChildren.Length() != 1)
|
||||
MOZ_CRASH("outer doc doesn't own adoc!");
|
||||
|
||||
if (childCount > 1) {
|
||||
MOZ_CRASH("outer doc has too many documents!");
|
||||
} else if (childCount == 1) {
|
||||
mChildren[0]->AsDoc()->Unbind();
|
||||
}
|
||||
}
|
||||
|
||||
mChildren.Clear();
|
||||
ProxyDestroyed(static_cast<Derived*>(this));
|
||||
|
@ -76,9 +76,7 @@ ProxyAccessibleBase<Derived>::ClearChildDoc(DocAccessibleParent* aChildDoc)
|
|||
// in SetChildDoc(). This could result in two subsequent calls to
|
||||
// ClearChildDoc() even though mChildren.Length() == 1.
|
||||
MOZ_ASSERT(mChildren.Length() <= 1);
|
||||
if (mChildren.RemoveElement(aChildDoc)) {
|
||||
mOuterDoc = false;
|
||||
}
|
||||
mChildren.RemoveElement(aChildDoc);
|
||||
}
|
||||
|
||||
template <class Derived>
|
||||
|
|
Загрузка…
Ссылка в новой задаче