Bug 1669708: do not disable cancel button when printing or waiting for page to finish rendering r=mstriemer

Differential Revision: https://phabricator.services.mozilla.com/D95584
This commit is contained in:
Emma Malysz 2020-11-03 23:44:50 +00:00
parent 55c7bb96b4
commit d19809a78c
2 changed files with 5 additions and 1 deletions

View File

@ -1562,7 +1562,7 @@ class PrintUIForm extends PrintUIControlMixin(HTMLFormElement) {
disable() {
for (let element of this.elements) {
element.disabled = true;
element.disabled = element.name != "cancel";
}
}

View File

@ -141,6 +141,10 @@ async function testPrintWithEnter(testFn, filename) {
await testFn(helper);
await helper.assertPrintToFile(file, () => {
EventUtils.sendKey("return", helper.win);
const cancelButton = helper.doc.querySelector(`button[name="cancel"]`);
ok(!cancelButton.disabled, "Cancel button is not disabled");
const printButton = helper.doc.querySelector(`button[name="print"]`);
ok(printButton.disabled, "Print button is disabled");
});
});
}