Ensure that mDocument is current before accessing it. Fixes some timing-related focus problems. Bug 241942, r+sr=jst, a=asa.

This commit is contained in:
bryner%brianryner.com 2004-05-20 07:17:03 +00:00
parent ebbce189ea
commit 2cf459d69c

View File

@ -3986,6 +3986,7 @@ nsEventStateManager::SetContentState(nsIContent *aContent, PRInt32 aState)
}
if ((aState & NS_EVENT_STATE_FOCUS)) {
EnsureDocument(mPresContext);
if (aContent && (aContent == mCurrentFocus) && gLastFocusedDocument == mDocument) {
// gLastFocusedDocument appears to always be correct, that is why
// I'm not setting it here. This is to catch an edge case.