check if there is an active focus controller before sending the blur

(r=pink/sr=bryner/a=brendan) bug 198153
This commit is contained in:
pinkerton%netscape.com 2003-09-09 21:09:22 +00:00
Родитель cc713fc8d3
Коммит 7bad112096
1 изменённых файлов: 10 добавлений и 1 удалений

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

@ -3972,9 +3972,18 @@ nsEventStateManager::SetContentState(nsIContent *aContent, PRInt32 aState)
aContent = nsnull;
}
} else {
// see comments in ShiftFocusInternal on mCurrentFocus overloading
PRBool fcActive = PR_FALSE;
if (mDocument) {
nsCOMPtr<nsIFocusController> fc;
fc = getter_AddRefs(GetFocusControllerForDocument(mDocument));
if (fc)
fc->GetActive(&fcActive);
}
notifyContent[3] = gLastFocusedContent;
NS_IF_ADDREF(gLastFocusedContent);
SendFocusBlur(mPresContext, aContent, PR_TRUE);
// only raise window if the the focus controller is active
SendFocusBlur(mPresContext, aContent, fcActive);
}
}