mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 20:22:00 +00:00
Fixing focus regression I caused by over eargly releasing documents from nsEventStateManager
This commit is contained in:
parent
af3c2b73d2
commit
d854d084a2
@ -206,9 +206,11 @@ nsEventStateManager::Shutdown()
|
||||
mPrefService = null_nsCOMPtr();
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(gLastFocusedContent);
|
||||
NS_IF_RELEASE(gLastFocusedDocument);
|
||||
|
||||
if(mInstanceCount == 1) {
|
||||
NS_IF_RELEASE(gLastFocusedContent);
|
||||
NS_IF_RELEASE(gLastFocusedDocument);
|
||||
}
|
||||
|
||||
m_haveShutdown = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
@ -492,13 +494,13 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
|
||||
if (gLastFocusedContent) {
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
gLastFocusedContent->GetDocument(*getter_AddRefs(doc));
|
||||
if(doc)
|
||||
if(doc)
|
||||
doc->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
|
||||
else {
|
||||
mDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
|
||||
NS_RELEASE(gLastFocusedContent);
|
||||
}
|
||||
}
|
||||
mDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
|
||||
NS_RELEASE(gLastFocusedContent);
|
||||
}
|
||||
}
|
||||
else mDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
|
||||
|
||||
// Suppress the command dispatcher for the duration of the
|
||||
|
@ -206,9 +206,11 @@ nsEventStateManager::Shutdown()
|
||||
mPrefService = null_nsCOMPtr();
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(gLastFocusedContent);
|
||||
NS_IF_RELEASE(gLastFocusedDocument);
|
||||
|
||||
if(mInstanceCount == 1) {
|
||||
NS_IF_RELEASE(gLastFocusedContent);
|
||||
NS_IF_RELEASE(gLastFocusedDocument);
|
||||
}
|
||||
|
||||
m_haveShutdown = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
@ -492,13 +494,13 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
|
||||
if (gLastFocusedContent) {
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
gLastFocusedContent->GetDocument(*getter_AddRefs(doc));
|
||||
if(doc)
|
||||
if(doc)
|
||||
doc->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
|
||||
else {
|
||||
mDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
|
||||
NS_RELEASE(gLastFocusedContent);
|
||||
}
|
||||
}
|
||||
mDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
|
||||
NS_RELEASE(gLastFocusedContent);
|
||||
}
|
||||
}
|
||||
else mDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
|
||||
|
||||
// Suppress the command dispatcher for the duration of the
|
||||
|
Loading…
x
Reference in New Issue
Block a user