Bug 1271946 - no alert, menupopup_start events from created subtree, partial backout of bug 1262420, r=marcoz

This commit is contained in:
Alexander Surkov 2016-05-18 08:58:26 -04:00
parent 83b2cc47a0
commit 59bfc9cc59
2 changed files with 12 additions and 11 deletions

View File

@ -170,6 +170,17 @@ DocAccessible::CreateSubtree(Accessible* aChild)
Accessible* focusedAcc = nullptr;
CacheChildrenInSubtree(aChild, &focusedAcc);
// Fire events for ARIA elements.
if (aChild->HasARIARole()) {
roles::Role role = aChild->ARIARole();
if (role == roles::MENUPOPUP) {
FireDelayedEvent(nsIAccessibleEvent::EVENT_MENUPOPUP_START, aChild);
}
else if (role == roles::ALERT) {
FireDelayedEvent(nsIAccessibleEvent::EVENT_ALERT, aChild);
}
}
// XXX: do we really want to send focus to focused DOM node not taking into
// account active item?
if (focusedAcc) {

View File

@ -2181,19 +2181,9 @@ DocAccessible::CacheChildrenInSubtree(Accessible* aRoot,
return;
}
roles::Role role = aRoot->ARIARole();
if (role == roles::MENUPOPUP) {
FireDelayedEvent(nsIAccessibleEvent::EVENT_MENUPOPUP_START, aRoot);
return;
}
if (role == roles::ALERT) {
FireDelayedEvent(nsIAccessibleEvent::EVENT_ALERT, aRoot);
return;
}
// XXX: we should delay document load complete event if the ARIA document
// has aria-busy.
roles::Role role = aRoot->ARIARole();
if (!aRoot->IsDoc() && (role == roles::DIALOG || role == roles::DOCUMENT)) {
FireDelayedEvent(nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE, aRoot);
}