bug 1270916 - call CreateSubtree() before firing a show event for the tree root
r=davidb
This ensures that if creating the sub tree creates events to fire they will go
before the show event for the root of the tree. It is fine to fire show events
for the subtree before the root because they will just get coalesced away
anyway. However it is important that any hide events come before the hidden
subtree appears in the new tree.
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -1855,18 +1855,18 @@ DocAccessible::ProcessContentInserted(Ac
}
if (aContainer->InsertAfter(iter.Child(), iter.ChildBefore())) {
#ifdef A11Y_LOG
logging::TreeInfo("accessible was inserted", 0,
"container", aContainer, "child", iter.Child(), nullptr);
#endif
+ CreateSubtree(iter.Child());
mt.AfterInsertion(iter.Child());
- CreateSubtree(iter.Child());
continue;
}
MOZ_ASSERT_UNREACHABLE("accessible was rejected");
iter.Rejected();
} while (iter.Next());
mt.Done();
@@ -1902,20 +1902,20 @@ DocAccessible::ProcessContentInserted(Ac
child = GetAccService()->CreateAccessible(aNode, aContainer);
}
if (child) {
TreeMutation mt(aContainer);
if (!aContainer->InsertAfter(child, walker.Prev())) {
return;
}
+ CreateSubtree(child);
mt.AfterInsertion(child);
mt.Done();
- CreateSubtree(child);
FireEventsOnInsertion(aContainer);
}
}
#ifdef A11Y_LOG
logging::TreeInfo("children after insertion", logging::eVerbose, aContainer);
#endif
}