Bug 1255614 - make ProcessInvalidationList to insert accessibles instead the recaching, r=yzen

This commit is contained in:
Alexander Surkov 2016-03-14 17:28:08 -04:00
Родитель 09ab5adb49
Коммит f5fca44245
2 изменённых файлов: 29 добавлений и 5 удалений

Просмотреть файл

@ -1391,8 +1391,21 @@ DocAccessible::ProcessInvalidationList()
nsIContent* content = mInvalidationList[idx];
if (!HasAccessible(content)) {
Accessible* container = GetContainerAccessible(content);
if (container)
UpdateTreeOnInsertion(container);
if (container) {
TreeWalker walker(container);
if (container->IsAcceptableChild(content) && walker.Seek(content)) {
Accessible* child =
GetAccService()->GetOrCreateAccessible(content, container);
if (child) {
AutoTreeMutation mMut(container);
RefPtr<AccReorderEvent> reorderEvent =
new AccReorderEvent(container);
container->InsertAfter(child, walker.Prev());
uint32_t flags = UpdateTreeInternal(child, true, reorderEvent);
FireEventsOnInsertion(container, reorderEvent, flags);
}
}
}
}
}
@ -1830,14 +1843,22 @@ DocAccessible::ProcessContentInserted(Accessible* aContainer,
aContainer);
#endif
FireEventsOnInsertion(aContainer, reorderEvent, updateFlags);
}
void
DocAccessible::FireEventsOnInsertion(Accessible* aContainer,
AccReorderEvent* aReorderEvent,
uint32_t aUpdateFlags)
{
// Content insertion did not cause an accessible tree change.
if (updateFlags == eNoAccessible) {
if (aUpdateFlags == eNoAccessible) {
return;
}
// Check to see if change occurred inside an alert, and fire an EVENT_ALERT
// if it did.
if (!(updateFlags & eAlertAccessible) &&
if (!(aUpdateFlags & eAlertAccessible) &&
(aContainer->IsAlert() || aContainer->IsInsideAlert())) {
Accessible* ancestor = aContainer;
do {
@ -1850,7 +1871,7 @@ DocAccessible::ProcessContentInserted(Accessible* aContainer,
}
MaybeNotifyOfValueChange(aContainer);
FireDelayedEvent(reorderEvent);
FireDelayedEvent(aReorderEvent);
}
void

Просмотреть файл

@ -187,6 +187,9 @@ public:
*/
void FireDelayedEvent(AccEvent* aEvent);
void FireDelayedEvent(uint32_t aEventType, Accessible* aTarget);
void FireEventsOnInsertion(Accessible* aContainer,
AccReorderEvent* aReorderEvent,
uint32_t aUpdateFlags);
/**
* Fire value change event on the given accessible if applicable.