Bug 444644 - When an OBJECT_SHOW event is fired, its MSAA states are not properly set yet; r=MarcoZ, r=surkov

This commit is contained in:
David Bolter 2009-06-22 14:28:20 -04:00
Родитель d7c598848c
Коммит 08957cd314
2 изменённых файлов: 18 добавлений и 1 удалений

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

@ -1935,6 +1935,14 @@ nsAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
{
NS_ENSURE_ARG_POINTER(aState);
if (!IsDefunct()) {
// Flush layout so that all the frame construction, reflow, and styles are
// up-to-date since we rely on frames, and styles when calculating state.
// We don't flush the display because we don't care about painting.
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
presShell->FlushPendingNotifications(Flush_Layout);
}
nsresult rv = GetStateInternal(aState, aExtraState);
NS_ENSURE_A11Y_SUCCESS(rv, rv);

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

@ -1584,8 +1584,17 @@ NS_IMETHODIMP nsDocAccessible::FlushPendingEvents()
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
if (!presShell)
length = 0; // The doc is now shut down, don't fire events in it anymore
else
else {
// Flush layout so that all the frame construction, reflow, and styles are
// up-to-date. This will ensure we can get frames for the related nodes, as
// well as get the most current information for calculating things like
// visibility. We don't flush the display because we don't care about
// painting. If no flush is necessary the method will simple return.
presShell->FlushPendingNotifications(Flush_Layout);
// filter events
nsAccEvent::ApplyEventRules(mEventsToFire);
}
for (PRUint32 index = 0; index < length; index ++) {
nsCOMPtr<nsIAccessibleEvent> accessibleEvent(