bug 869806 - fix assertion about event type in accessibleWrap.cpp r=surkov

This commit is contained in:
Trevor Saunders 2013-05-24 14:24:19 -04:00
parent ef2871fde3
commit 16dd3eacc7
4 changed files with 17 additions and 9 deletions

View File

@ -954,6 +954,11 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
Accessible* accessible = aEvent->GetAccessible();
NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
// The accessible can become defunct if we have an xpcom event listener
// which decides it would be fun to change the DOM and flush layout.
if (accessible->IsDefunct())
return NS_OK;
uint32_t type = aEvent->GetEventType();
AtkObject* atkObj = AccessibleWrap::GetAtkObject(accessible);

View File

@ -151,6 +151,10 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
if (!mDocument)
return;
if (mObservingState == eRefreshProcessing ||
mObservingState == eRefreshProcessingForUpdate)
return;
// Any generic notifications should be queued if we're processing content
// insertions or generic notifications.
mObservingState = eRefreshProcessingForUpdate;
@ -265,18 +269,20 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
mDocument->ProcessInvalidationList();
// If a generic notification occurs after this point then we may be allowed to
// process it synchronously.
mObservingState = eRefreshObserving;
// process it synchronously. However we do not want to reenter if fireing
// events causes script to run.
mObservingState = eRefreshProcessing;
ProcessEventQueue();
mObservingState = eRefreshObserving;
if (!mDocument)
return;
// Stop further processing if there are no new notifications of any kind or
// events and document load is processed.
if (mContentInsertions.Length() == 0 && mNotifications.Length() == 0 &&
mEvents.Length() == 0 && mTextHash.Count() == 0 &&
mHangingChildDocuments.Length() == 0 &&
if (mContentInsertions.IsEmpty() && mNotifications.IsEmpty() &&
mEvents.IsEmpty() && mTextHash.Count() == 0 &&
mHangingChildDocuments.IsEmpty() &&
mDocument->HasLoadState(DocAccessible::eCompletelyLoaded) &&
mPresShell->RemoveRefreshObserver(this, Flush_Display)) {
mObservingState = eNotObservingRefresh;

View File

@ -212,6 +212,7 @@ private:
enum eObservingState {
eNotObservingRefresh,
eRefreshObserving,
eRefreshProcessing,
eRefreshProcessingForUpdate
};
eObservingState mObservingState;

View File

@ -17,10 +17,6 @@
src="../actions.js"></script>
<script type="application/javascript">
if (navigator.platform.startsWith("Linux")) {
SimpleTest.expectAssertions(2);
}
function getAnchorTargetDocumentAcc()
{
var thisTabDocAcc = getTabDocAccessible();