Backed out 2 changesets (bug 1954940, bug 1955438) for causing bc failures @exceptionDialog.xhtml. CLOSED TREE

Backed out changeset cbf1b21a62af (bug 1955438)
Backed out changeset e77512e4c8fb (bug 1954940)
This commit is contained in:
Goloman Adrian
2025-03-24 11:54:54 +02:00
parent fd5904e40d
commit 7d7daf8766
7 changed files with 23 additions and 39 deletions

View File

@@ -1297,7 +1297,6 @@ static nsLiteralCString sStyleSrcUnsafeInlineAllowList[] = {
"chrome://pippki/content/downloadcert.xhtml"_ns,
"chrome://pippki/content/editcacert.xhtml"_ns,
"chrome://pippki/content/load_device.xhtml"_ns,
"chrome://pippki/content/setp12password.xhtml"_ns,
};
// img-src data: blob:
static nsLiteralCString sImgSrcDataBlobAllowList[] = {
@@ -1944,6 +1943,8 @@ void nsContentSecurityUtils::AssertChromePageHasCSP(Document* aDocument) {
"chrome://global/content/win.xhtml"_ns,
"chrome://global/skin/in-content/info-pages.css"_ns,
"chrome://layoutdebug/content/layoutdebug.xhtml"_ns,
"chrome://pippki/content/exceptionDialog.xhtml"_ns,
"chrome://pippki/content/setp12password.xhtml"_ns,
// Test files
"chrome://mochikit/"_ns,
"chrome://mochitests/"_ns,

View File

@@ -298,13 +298,3 @@ function getChainForUsage(results, usage) {
}
return null;
}
// Performs an XMLHttpRequest because the script for the dialog is prevented
// from doing so by CSP.
export async function checkCertHelper(uri, grabber) {
let req = new XMLHttpRequest();
req.open("GET", uri.prePath);
req.onerror = grabber.bind(null, req);
req.onload = grabber.bind(null, req);
req.send(null);
}

View File

@@ -4,7 +4,7 @@
"use strict";
const { setText, viewCertHelper, checkCertHelper } = ChromeUtils.importESModule(
const { setText, viewCertHelper } = ChromeUtils.importESModule(
"resource://gre/modules/psm/pippki.sys.mjs"
);
@@ -28,13 +28,6 @@ function initExceptionDialog() {
let l10nUpdatedElements = [confirmButton, warningText];
confirmButton.disabled = true;
document
.getElementById("locationTextBox")
.addEventListener("input", () => handleTextChange());
document
.getElementById("viewCertButton")
.addEventListener("input", () => viewCertButtonClick());
var args = window.arguments;
if (args && args[0]) {
if (args[0].location) {
@@ -124,7 +117,11 @@ async function checkCert() {
let uri = getURI();
if (uri) {
checkCertHelper(uri, grabCert);
let req = new XMLHttpRequest();
req.open("GET", uri.prePath);
req.onerror = grabCert.bind(this, req);
req.onload = grabCert.bind(this, req);
req.send(null);
} else {
gChecking = false;
await document.l10n.translateElements(updateCertStatus());
@@ -327,5 +324,3 @@ function addException() {
function inPrivateBrowsingMode() {
return PrivateBrowsingUtils.isWindowPrivate(window);
}
window.addEventListener("load", () => initExceptionDialog());

View File

@@ -3,14 +3,13 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?csp default-src chrome:; image-src chrome: moz-icon; ?>
<!DOCTYPE window>
<window windowtype="mozilla:exceptiondialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
data-l10n-id="exception-mgr">
data-l10n-id="exception-mgr"
onload="initExceptionDialog();">
<dialog id="exceptiondialog"
buttonidextra1="exception-mgr-extra-button"
buttons="cancel,extra1,extra2"
@@ -55,6 +54,7 @@
id="certLocationLabel"
data-l10n-id="exception-mgr-cert-location-url"/>
<html:input id="locationTextBox"
oninput="handleTextChange();"
value="https://"
class="uri-element"/>
<button id="checkCertButton"
@@ -68,7 +68,8 @@
flex="1"/>
<button id="viewCertButton"
data-l10n-id="exception-mgr-cert-status-view-cert"
disabled="true"/>
disabled="true"
oncommand="viewCertButtonClick();"/>
</hbox>
<description id="statusDescription"
class="description"/>

View File

@@ -27,11 +27,7 @@
*/
function onLoad() {
// Ensure the first password textbox has focus.
let pw1 = document.getElementById("pw1");
pw1.focus();
pw1.addEventListener("input", () => onPasswordInput(true));
let pw2 = document.getElementById("pw2");
pw2.addEventListener("input", () => onPasswordInput(false));
document.getElementById("pw1").focus();
document.addEventListener("dialogaccept", onDialogAccept);
document.addEventListener("dialogcancel", onDialogCancel);
}
@@ -129,5 +125,3 @@ function onPasswordInput(recalculatePasswordStrength) {
document.getElementById("setp12password").getButton("accept").disabled =
pw1 != pw2;
}
window.addEventListener("load", () => onLoad());

View File

@@ -3,8 +3,6 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?csp default-src chrome:; style-src chrome: 'unsafe-inline'; ?>
<!DOCTYPE window>
<window
@@ -12,6 +10,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
style="width: 48em"
onload="onLoad();"
>
<dialog id="setp12password" buttons="accept,cancel">
<linkset>
@@ -30,11 +29,15 @@
<vbox>
<hbox class="input-row">
<label flex="1" data-l10n-id="set-password-backup-pw" />
<html:input id="pw1" type="password" />
<html:input id="pw1" type="password" oninput="onPasswordInput(true);" />
</hbox>
<hbox class="input-row">
<label flex="1" data-l10n-id="set-password-repeat-backup-pw" />
<html:input id="pw2" type="password" />
<html:input
id="pw2"
type="password"
oninput="onPasswordInput(false);"
/>
</hbox>
</vbox>
<separator />

View File

@@ -109,8 +109,8 @@ add_task(async function testPasswordStrengthAndEquality() {
password2Textbox.value = testCase.password2;
// Setting the value of the password textboxes via |.value| apparently
// doesn't cause the oninput handlers to be called, so we do it here.
password1Textbox.dispatchEvent(new Event("input", { bubbles: true }));
password2Textbox.dispatchEvent(new Event("input", { bubbles: true }));
password1Textbox.oninput();
password2Textbox.oninput();
Assert.equal(
win.document.getElementById("setp12password").getButton("accept")