Fixing topcrash bug 179548 (crash when closing tab via mouse gesture) by null checking the event target frame before dispatching the event the second time, since the first dispatch can nuke the frame. r=dbaron, sr=bzbarsky.

git-svn-id: svn://10.0.0.236/trunk@133871 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%netscape.com
2002-11-15 00:59:28 +00:00
parent bead128de2
commit e42bf44e7d
2 changed files with 8 additions and 4 deletions

View File

@@ -6218,12 +6218,14 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView, PRUint32 aFlags,
}
}
//Continue with second dispatch to system event handlers
//Continue with second dispatch to system event handlers.
// Need to null check mCurrentEventContent and mCurrentEventFrame
// since the previous dispatch could have nuked them.
if (mCurrentEventContent) {
rv = mCurrentEventContent->HandleDOMEvent(mPresContext, aEvent, nsnull,
aFlags | NS_EVENT_FLAG_SYSTEM_EVENT, aStatus);
}
else {
else if (mCurrentEventFrame) {
nsIContent* targetContent;
if (NS_OK == mCurrentEventFrame->GetContentForEvent(mPresContext, aEvent, &targetContent) && nsnull != targetContent) {
rv = targetContent->HandleDOMEvent(mPresContext, aEvent, nsnull,

View File

@@ -6218,12 +6218,14 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView, PRUint32 aFlags,
}
}
//Continue with second dispatch to system event handlers
//Continue with second dispatch to system event handlers.
// Need to null check mCurrentEventContent and mCurrentEventFrame
// since the previous dispatch could have nuked them.
if (mCurrentEventContent) {
rv = mCurrentEventContent->HandleDOMEvent(mPresContext, aEvent, nsnull,
aFlags | NS_EVENT_FLAG_SYSTEM_EVENT, aStatus);
}
else {
else if (mCurrentEventFrame) {
nsIContent* targetContent;
if (NS_OK == mCurrentEventFrame->GetContentForEvent(mPresContext, aEvent, &targetContent) && nsnull != targetContent) {
rv = targetContent->HandleDOMEvent(mPresContext, aEvent, nsnull,