mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1221551 - unbind child documents before rebinding them r=davidb
It seems possible that a child document could be bound to a parent document without first being unbound. Some evidence for this being possible is that OuterDocAccessible::InsertChildAt() explicitly checks for this and does something similar if it already has a child.
This commit is contained in:
parent
0afd6bcdf9
commit
1def7d87c4
@ -206,6 +206,7 @@ DocAccessibleParent::RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uin
|
||||
MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
|
||||
|
||||
auto childDoc = static_cast<DocAccessibleParent*>(aChildDoc);
|
||||
childDoc->Unbind();
|
||||
bool result = AddChildDoc(childDoc, aID, false);
|
||||
MOZ_ASSERT(result);
|
||||
MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
|
||||
|
@ -64,7 +64,10 @@ public:
|
||||
void Unbind()
|
||||
{
|
||||
mParent = nullptr;
|
||||
ParentDoc()->mChildDocs.RemoveElement(this);
|
||||
if (DocAccessibleParent* parent = ParentDoc()) {
|
||||
parent->mChildDocs.RemoveElement(this);
|
||||
}
|
||||
|
||||
mParentDoc = nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user