mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 633154. When alerts/prompts/confirms are suppressed, just return silently instead of throwing. r=sicking
This commit is contained in:
parent
c885d7466a
commit
e84591ec58
@ -6918,7 +6918,9 @@ nsGlobalWindow::AlertOrConfirm(bool aAlert,
|
||||
MOZ_ASSERT(IsOuterWindow());
|
||||
|
||||
if (!AreDialogsEnabled()) {
|
||||
aError.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||
// Just silently return. In the case of alert(), the return value is
|
||||
// ignored. In the case of confirm(), returning false is the same thing as
|
||||
// would happen if the user cancels.
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -7058,7 +7060,7 @@ nsGlobalWindow::PromptOuter(const nsAString& aMessage, const nsAString& aInitial
|
||||
SetDOMStringToNull(aReturn);
|
||||
|
||||
if (!AreDialogsEnabled()) {
|
||||
aError.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||
// Return null, as if the user just canceled the prompt.
|
||||
return;
|
||||
}
|
||||
|
||||
@ -7496,6 +7498,8 @@ nsGlobalWindow::PrintOuter(ErrorResult& aError)
|
||||
}
|
||||
|
||||
if (!AreDialogsEnabled()) {
|
||||
// We probably want to keep throwing here; silently doing nothing is a bit
|
||||
// weird given the typical use cases of print().
|
||||
aError.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||
return;
|
||||
}
|
||||
@ -9553,6 +9557,8 @@ nsGlobalWindow::ShowModalDialogOuter(const nsAString& aUrl, nsIVariant* aArgumen
|
||||
EnsureReflowFlushAndPaint();
|
||||
|
||||
if (!AreDialogsEnabled()) {
|
||||
// We probably want to keep throwing here; silently doing nothing is a bit
|
||||
// weird given the typical use cases of showModalDialog().
|
||||
aError.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||
return nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user