Followup fix for bug 265921. Don't always throw exceptions from window.dispatchEvent(). r=bryner@brianruyner.com, sr=brendan@mozilla.org

This commit is contained in:
jst%mozilla.jstenback.com 2004-10-28 00:26:27 +00:00
Родитель e737a69253
Коммит f75d0d61d6
1 изменённых файлов: 13 добавлений и 13 удалений

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

@ -3936,21 +3936,21 @@ NS_IMETHODIMP
GlobalWindowImpl::DispatchEvent(nsIDOMEvent* aEvent, PRBool* _retval)
{
nsCOMPtr<nsIDocument> doc(do_QueryInterface(mDocument));
if (doc) {
// Obtain a presentation shell
nsIPresShell *shell = doc->GetShellAt(0);
if (!shell) {
return NS_OK;
}
// Retrieve the context
nsCOMPtr<nsPresContext> aPresContext = shell->GetPresContext();
aPresContext->EventStateManager()->
DispatchNewEvent(NS_STATIC_CAST(nsIScriptGlobalObject*, this),
aEvent, _retval);
if (!doc) {
return NS_ERROR_FAILURE;
}
return NS_ERROR_FAILURE;
// Obtain a presentation shell
nsIPresShell *shell = doc->GetShellAt(0);
if (!shell) {
return NS_OK;
}
// Retrieve the context
nsCOMPtr<nsPresContext> aPresContext = shell->GetPresContext();
return aPresContext->EventStateManager()->
DispatchNewEvent(NS_STATIC_CAST(nsIScriptGlobalObject*, this),
aEvent, _retval);
}
//*****************************************************************************