Bug 1262415 - make Accessible to keep weak pointers to parent and children, r=yzen

This commit is contained in:
Alexander Surkov
2016-04-12 11:20:56 -04:00
parent c1e0046066
commit 74ae4487a9
3 changed files with 5 additions and 6 deletions

View File

@@ -94,8 +94,7 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// Accessible: nsISupports and cycle collection
NS_IMPL_CYCLE_COLLECTION(Accessible,
mContent, mParent, mChildren)
NS_IMPL_CYCLE_COLLECTION(Accessible, mContent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Accessible)
if (aIID.Equals(NS_GET_IID(Accessible)))
@@ -1970,7 +1969,7 @@ Accessible::BindToParent(Accessible* aParent, uint32_t aIndexInParent)
#ifdef A11Y_LOG
if (mParent) {
logging::TreeInfo("BindToParent: stealing accessible", 0,
"old parent", mParent.get(),
"old parent", mParent,
"new parent", aParent,
"child", this, nullptr);
}

View File

@@ -1094,8 +1094,8 @@ protected:
nsCOMPtr<nsIContent> mContent;
DocAccessible* mDoc;
RefPtr<Accessible> mParent;
nsTArray<RefPtr<Accessible> > mChildren;
Accessible* mParent;
nsTArray<Accessible*> mChildren;
int32_t mIndexInParent;
static const uint8_t kStateFlagsBits = 13;

View File

@@ -99,7 +99,7 @@ private:
if (parent && parent->IsListControl()) {
Accessible* combobox = parent->Parent();
return combobox && combobox->IsCombobox() ? combobox : mParent.get();
return combobox && combobox->IsCombobox() ? combobox : mParent;
}
return nullptr;