From 13ce354803885dd95efe32879967bbe52eadbc52 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Mon, 8 Jun 2020 08:07:20 +0000 Subject: [PATCH] Bug 1638711 - Call DisplayLoadError for NS_ERROR_DOM_BAD_URI during EndPageLoad, since we would also have done this for the same error during AsyncOpen. r=nika,ckerschb Previously we called DisplayLoadError with NS_ERROR_DOM_BASE_URI for errors detected during AsyncOpen, but not for asynchronous errors, and this patch queue changed when some security errors happen to be asynchronous. GeckoView has tests that require DisplayLoadError to be called (which allows for a custom error page to be loaded). Unfortunately, doing so breaks existing gecko tests, since the method of detecting a blocked load fails when GeckoView loads a custom error page. Differential Revision: https://phabricator.services.mozilla.com/D77171 --- docshell/base/nsDocShell.cpp | 1 + .../file_block_toplevel_data_navigation2.html | 14 +++++++++++++- .../test_block_toplevel_data_navigation.html | 9 +++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index f7e5aa0ef661..86be2496aba2 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -6185,6 +6185,7 @@ nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress, aStatus == NS_ERROR_NET_INADEQUATE_SECURITY || aStatus == NS_ERROR_NET_HTTP2_SENT_GOAWAY || aStatus == NS_ERROR_NET_HTTP3_PROTOCOL_ERROR || + aStatus == NS_ERROR_DOM_BAD_URI || NS_ERROR_GET_MODULE(aStatus) == NS_ERROR_MODULE_SECURITY) { // Errors to be shown for any frame DisplayLoadError(aStatus, url, nullptr, aChannel); diff --git a/dom/security/test/general/file_block_toplevel_data_navigation2.html b/dom/security/test/general/file_block_toplevel_data_navigation2.html index e0308e1ae60e..3753d23d311f 100644 --- a/dom/security/test/general/file_block_toplevel_data_navigation2.html +++ b/dom/security/test/general/file_block_toplevel_data_navigation2.html @@ -8,10 +8,22 @@ test2: data: URI in iframe tries to window.open(data:, _blank);