зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1660189
- Bail out from nsPrintJob::DoCommonPrint if the docshell was destroyed in beforeprint event handlers. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D87827
This commit is contained in:
Родитель
c57fa21220
Коммит
c3e70abe26
|
@ -183,6 +183,7 @@ static CallState CollectDocuments(Document& aDoc,
|
|||
return CallState::Continue;
|
||||
}
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
static void DispatchEventToWindowTree(Document& aDoc, const nsAString& aEvent) {
|
||||
nsTArray<nsCOMPtr<Document>> targets;
|
||||
CollectDocuments(aDoc, targets);
|
||||
|
@ -655,6 +656,9 @@ nsresult nsPrintJob::DoCommonPrint(bool aIsPrintPreview,
|
|||
// for print output. (Obviously if `aSourceDoc` is a clone, it already
|
||||
// has these changes.)
|
||||
DispatchEventToWindowTree(*aSourceDoc, u"beforeprint"_ns);
|
||||
if (mIsDestroying) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче