Bug 1363595: Invalidate accessible handler cache when change events occur; r=eeejay

MozReview-Commit-ID: kODsDsy9vJ

--HG--
extra : rebase_source : 653d7fa5694eb767df974f8b1df92cdf8d77c662
This commit is contained in:
Aaron Klotz 2017-08-08 15:55:50 -06:00
Родитель b594b508ec
Коммит 556c69541d
1 изменённых файлов: 33 добавлений и 0 удалений

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

@ -1137,6 +1137,35 @@ AccessibleWrap::SetID(uint32_t aID)
mID = aID;
}
static bool
IsHandlerInvalidationNeeded(uint32_t aEvent)
{
// We want to return true for any events that would indicate that something
// in the handler cache is out of date.
switch (aEvent) {
case EVENT_OBJECT_STATECHANGE:
case EVENT_OBJECT_LOCATIONCHANGE:
case EVENT_OBJECT_NAMECHANGE:
case EVENT_OBJECT_DESCRIPTIONCHANGE:
case EVENT_OBJECT_VALUECHANGE:
case IA2_EVENT_ACTION_CHANGED:
case IA2_EVENT_DOCUMENT_LOAD_COMPLETE:
case IA2_EVENT_DOCUMENT_LOAD_STOPPED:
case IA2_EVENT_DOCUMENT_ATTRIBUTE_CHANGED:
case IA2_EVENT_DOCUMENT_CONTENT_CHANGED:
case IA2_EVENT_PAGE_CHANGED:
case IA2_EVENT_TEXT_ATTRIBUTE_CHANGED:
case IA2_EVENT_TEXT_CHANGED:
case IA2_EVENT_TEXT_INSERTED:
case IA2_EVENT_TEXT_REMOVED:
case IA2_EVENT_TEXT_UPDATED:
case IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED:
return true;
default:
return false;
}
}
void
AccessibleWrap::FireWinEvent(Accessible* aTarget, uint32_t aEventType)
{
@ -1159,6 +1188,10 @@ AccessibleWrap::FireWinEvent(Accessible* aTarget, uint32_t aEventType)
return;
}
if (IsHandlerInvalidationNeeded(winEvent)) {
InvalidateHandlers();
}
// Fire MSAA event for client area window.
::NotifyWinEvent(winEvent, hwnd, OBJID_CLIENT, childID);