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

View File

@@ -298,13 +298,3 @@ function getChainForUsage(results, usage) {
} }
return null; 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"; "use strict";
const { setText, viewCertHelper, checkCertHelper } = ChromeUtils.importESModule( const { setText, viewCertHelper } = ChromeUtils.importESModule(
"resource://gre/modules/psm/pippki.sys.mjs" "resource://gre/modules/psm/pippki.sys.mjs"
); );
@@ -28,13 +28,6 @@ function initExceptionDialog() {
let l10nUpdatedElements = [confirmButton, warningText]; let l10nUpdatedElements = [confirmButton, warningText];
confirmButton.disabled = true; confirmButton.disabled = true;
document
.getElementById("locationTextBox")
.addEventListener("input", () => handleTextChange());
document
.getElementById("viewCertButton")
.addEventListener("input", () => viewCertButtonClick());
var args = window.arguments; var args = window.arguments;
if (args && args[0]) { if (args && args[0]) {
if (args[0].location) { if (args[0].location) {
@@ -124,7 +117,11 @@ async function checkCert() {
let uri = getURI(); let uri = getURI();
if (uri) { 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 { } else {
gChecking = false; gChecking = false;
await document.l10n.translateElements(updateCertStatus()); await document.l10n.translateElements(updateCertStatus());
@@ -327,5 +324,3 @@ function addException() {
function inPrivateBrowsingMode() { function inPrivateBrowsingMode() {
return PrivateBrowsingUtils.isWindowPrivate(window); 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 - 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/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?csp default-src chrome:; image-src chrome: moz-icon; ?>
<!DOCTYPE window> <!DOCTYPE window>
<window windowtype="mozilla:exceptiondialog" <window windowtype="mozilla:exceptiondialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"
data-l10n-id="exception-mgr"> data-l10n-id="exception-mgr"
onload="initExceptionDialog();">
<dialog id="exceptiondialog" <dialog id="exceptiondialog"
buttonidextra1="exception-mgr-extra-button" buttonidextra1="exception-mgr-extra-button"
buttons="cancel,extra1,extra2" buttons="cancel,extra1,extra2"
@@ -55,6 +54,7 @@
id="certLocationLabel" id="certLocationLabel"
data-l10n-id="exception-mgr-cert-location-url"/> data-l10n-id="exception-mgr-cert-location-url"/>
<html:input id="locationTextBox" <html:input id="locationTextBox"
oninput="handleTextChange();"
value="https://" value="https://"
class="uri-element"/> class="uri-element"/>
<button id="checkCertButton" <button id="checkCertButton"
@@ -68,7 +68,8 @@
flex="1"/> flex="1"/>
<button id="viewCertButton" <button id="viewCertButton"
data-l10n-id="exception-mgr-cert-status-view-cert" data-l10n-id="exception-mgr-cert-status-view-cert"
disabled="true"/> disabled="true"
oncommand="viewCertButtonClick();"/>
</hbox> </hbox>
<description id="statusDescription" <description id="statusDescription"
class="description"/> class="description"/>

View File

@@ -27,11 +27,7 @@
*/ */
function onLoad() { function onLoad() {
// Ensure the first password textbox has focus. // Ensure the first password textbox has focus.
let pw1 = document.getElementById("pw1"); document.getElementById("pw1").focus();
pw1.focus();
pw1.addEventListener("input", () => onPasswordInput(true));
let pw2 = document.getElementById("pw2");
pw2.addEventListener("input", () => onPasswordInput(false));
document.addEventListener("dialogaccept", onDialogAccept); document.addEventListener("dialogaccept", onDialogAccept);
document.addEventListener("dialogcancel", onDialogCancel); document.addEventListener("dialogcancel", onDialogCancel);
} }
@@ -129,5 +125,3 @@ function onPasswordInput(recalculatePasswordStrength) {
document.getElementById("setp12password").getButton("accept").disabled = document.getElementById("setp12password").getButton("accept").disabled =
pw1 != pw2; 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 - 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/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?csp default-src chrome:; style-src chrome: 'unsafe-inline'; ?>
<!DOCTYPE window> <!DOCTYPE window>
<window <window
@@ -12,6 +10,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"
style="width: 48em" style="width: 48em"
onload="onLoad();"
> >
<dialog id="setp12password" buttons="accept,cancel"> <dialog id="setp12password" buttons="accept,cancel">
<linkset> <linkset>
@@ -30,11 +29,15 @@
<vbox> <vbox>
<hbox class="input-row"> <hbox class="input-row">
<label flex="1" data-l10n-id="set-password-backup-pw" /> <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>
<hbox class="input-row"> <hbox class="input-row">
<label flex="1" data-l10n-id="set-password-repeat-backup-pw" /> <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> </hbox>
</vbox> </vbox>
<separator /> <separator />

View File

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