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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user