Bug 1289223: Make EventTree process all accessibility show events
MozReview-Commit-ID: CKiyHobOFKz
--- a/accessible/generic/DocAccessible-inl.h
+++ b/accessible/generic/DocAccessible-inl.h
@@ -172,12 +172,24 @@ DocAccessible::CreateSubtree(Accessible*
// account active item?
if (focusedAcc) {
FocusMgr()->DispatchFocusEvent(this, focusedAcc);
SelectionMgr()->
SetControlSelectionListener(focusedAcc->GetNode()->AsElement());
}
}
+inline void
+DocAccessible::ProcessChildShowEvents()
+{
+ TreeMutation mt(this);
+ uint32_t childCount = ChildCount();
+ for (uint32_t i = 0; i < childCount; i++) {
+ Accessible* child = GetChildAt(i);
+ mt.AfterInsertion(child);
+ }
+ mt.Done();
+}
+
} // namespace a11y
} // namespace mozilla
#endif
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -1457,22 +1457,17 @@ DocAccessible::DoInitialUpdate()
// this reorder event is processed by parent document then events targeted to
// this document may be fired prior to this reorder event. If this is
// a problem then consider to keep event processing per tab document.
if (!IsRoot()) {
RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(Parent());
ParentDocument()->FireDelayedEvent(reorderEvent);
}
- uint32_t childCount = ChildCount();
- for (uint32_t i = 0; i < childCount; i++) {
- Accessible* child = GetChildAt(i);
- RefPtr<AccShowEvent> event = new AccShowEvent(child);
- FireDelayedEvent(event);
- }
+ ProcessChildShowEvents();
}
void
DocAccessible::ProcessLoad()
{
mLoadState |= eCompletelyLoaded;
#ifdef A11Y_LOG
--- a/accessible/generic/DocAccessible.h
+++ b/accessible/generic/DocAccessible.h
@@ -508,16 +508,22 @@ protected:
*
* While children are cached we may encounter the case there's no accessible
* for referred content by related accessible. Store these related nodes to
* invalidate their containers later.
*/
void ProcessInvalidationList();
/**
+ * Put children into EventTree to process show events.
+ *
+ */
+ void ProcessChildShowEvents();
+
+ /**
* Update the accessible tree for content removal.
*/
void UpdateTreeOnRemoval(Accessible* aContainer, nsIContent* aChildNode);
/**
* Validates all aria-owns connections and updates the tree accordingly.
*/
void ValidateARIAOwned();