зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
e737a69253
Коммит
f75d0d61d6
|
@ -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);
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
|
|
Загрузка…
Ссылка в новой задаче