Backed out changeset c7a8038bc730 (bug 1721651) for causing Xpcshell failures at test_bookmarks_html.js. CLOSED TREE

This commit is contained in:
Butkovits Atila 2021-07-29 15:50:30 +03:00
parent 4b52d8e894
commit 0a944c245f
4 changed files with 14 additions and 18 deletions

View File

@ -81,17 +81,12 @@ const KNOWN_ERROR_TITLE_IDS = new Set([
let searchParams = new URLSearchParams(document.documentURI.split("?")[1]);
let gErrorCode = searchParams.get("e");
// Set to true on init if the error code is nssBadCert.
let gIsCertError;
let gIsCertError = gErrorCode == "nssBadCert";
// If the location of the favicon changes, FAVICON_CERTERRORPAGE_URL and/or
// FAVICON_ERRORPAGE_URL in toolkit/components/places/nsFaviconService.idl
// should also be updated.
document.getElementById("favicon").href =
gIsCertError || gErrorCode == "nssFailure2"
? "chrome://global/skin/icons/warning.svg"
: "chrome://global/skin/icons/info.svg";
function getErrorCode() {
return searchParams.get("e");
}
function getCSSClass() {
return searchParams.get("s");
@ -262,7 +257,7 @@ function initPage() {
});
}
var err = gErrorCode;
var err = getErrorCode();
// List of error pages with an illustration.
let illustratedErrors = [
"malformedURI",
@ -283,6 +278,7 @@ function initPage() {
document.body.classList.add("blocked");
}
gIsCertError = err == "nssBadCert";
// Only worry about captive portals if this is a cert error.
let showCaptivePortalUI = isCaptive() && gIsCertError;
if (showCaptivePortalUI) {
@ -498,7 +494,7 @@ function reportBlockingError() {
return;
}
let err = gErrorCode;
let err = getErrorCode();
// Ensure we only deal with XFO and CSP here.
if (!["xfoBlocked", "cspBlocked"].includes(err)) {
return;
@ -797,7 +793,7 @@ function setCertErrorDetails(event) {
let es = document.getElementById("errorWhatToDoText");
let errWhatToDoTitle = document.getElementById("edd_nssBadCert");
let est = document.getElementById("errorWhatToDoTitleText");
let error = gErrorCode;
let error = getErrorCode();
if (error == "sslv3Used") {
learnMoreLink.setAttribute("href", baseURL + "sslv3-error-messages");
@ -1056,7 +1052,7 @@ async function setTechnicalDetailsOnCertError(
}
let cssClass = getCSSClass();
let error = gErrorCode;
let error = getErrorCode();
let hostString = HOST_NAME;
let port = document.location.port;

View File

@ -22,7 +22,9 @@
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'" />
<title>&loadError.label;</title>
<link rel="stylesheet" href="chrome://browser/skin/aboutNetError.css" type="text/css" media="all" />
<link rel="icon" id="favicon"/>
<!-- If the location of the favicon is changed here, the FAVICON_ERRORPAGE_URL symbol in
toolkit/components/places/src/nsFaviconService.h should be updated. -->
<link rel="icon" id="favicon" href="chrome://global/skin/icons/info.svg"/>
<link rel="localization" href="browser/aboutCertError.ftl" />
<link rel="localization" href="browser/nsserrors.ftl" />
<link rel="localization" href="branding/brand.ftl"/>

View File

@ -335,9 +335,8 @@ nsFaviconService::SetAndFetchFaviconForPage(
// If the page url points to an image, the icon's url will be the same.
// TODO (Bug 403651): store a resample of the image. For now avoid that
// for database size and UX concerns.
// Don't store favicons for error pages either.
// Don't store favicons for error pages too.
if (icon.spec.Equals(page.spec) ||
icon.spec.EqualsLiteral(FAVICON_CERTERRORPAGE_URL) ||
icon.spec.EqualsLiteral(FAVICON_ERRORPAGE_URL)) {
return NS_OK;
}

View File

@ -332,6 +332,5 @@ interface nsIFaviconDataCallback : nsISupports
#define FAVICON_DEFAULT_MIMETYPE "image/svg+xml"
#define FAVICON_ERRORPAGE_URL "chrome://global/skin/icons/info.svg"
#define FAVICON_CERTERRORPAGE_URL "chrome://global/skin/icons/warning.svg"
%}