bug 419881. Crash [ @ nsDocAccessible::FlushPendingEvents ]. r=ginn, a=beltzner for 1.9b4

This commit is contained in:
aaronleventhal@moonset.net 2008-02-28 09:36:37 -08:00
parent 7e30932a4d
commit 3e80d74d08

View File

@ -1499,6 +1499,9 @@ NS_IMETHODIMP nsDocAccessible::FlushPendingEvents()
{
PRUint32 length = mEventsToFire.Count();
NS_ASSERTION(length, "How did we get here without events to fire?");
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
if (!presShell)
length = 0; // The doc is now shut down, don't fire events in it anymore
PRUint32 index;
for (index = 0; index < length; index ++) {
nsCOMPtr<nsIAccessibleEvent> accessibleEvent(
@ -1523,7 +1526,6 @@ NS_IMETHODIMP nsDocAccessible::FlushPendingEvents()
// such as a:focus { overflow: scroll; }
nsCOMPtr<nsIContent> focusContent(do_QueryInterface(domNode));
if (focusContent) {
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
nsIFrame *focusFrame = presShell->GetRealPrimaryFrameFor(focusContent);
nsIAtom *newFrameType =
(focusFrame && focusFrame->GetStyleVisibility()->IsVisible()) ?