зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1351414 - shutdown a moving accessible if it has no insertion point, r=yzen
This commit is contained in:
Родитель
83c58678dc
Коммит
696f8370cf
|
@ -2242,18 +2242,21 @@ DocAccessible::MoveChild(Accessible* aChild, Accessible* aNewParent,
|
|||
return false;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(aIdxInParent <= static_cast<int32_t>(aNewParent->ChildCount()),
|
||||
"Wrong insertion point for a moving child");
|
||||
|
||||
// If the child cannot be re-inserted into the tree, then make sure to remove
|
||||
// it from its present parent and then shutdown it.
|
||||
bool hasInsertionPoint = (aIdxInParent != -1) ||
|
||||
(aIdxInParent <= static_cast<int32_t>(aNewParent->ChildCount()));
|
||||
|
||||
TreeMutation rmut(curParent);
|
||||
rmut.BeforeRemoval(aChild, TreeMutation::kNoShutdown);
|
||||
rmut.BeforeRemoval(aChild, hasInsertionPoint && TreeMutation::kNoShutdown);
|
||||
curParent->RemoveChild(aChild);
|
||||
rmut.Done();
|
||||
|
||||
// No insertion point for the child.
|
||||
if (aIdxInParent == -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (aIdxInParent > static_cast<int32_t>(aNewParent->ChildCount())) {
|
||||
MOZ_ASSERT_UNREACHABLE("Wrong insertion point for a moving child");
|
||||
if (!hasInsertionPoint) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче