From 623860bf8fad11ab35bd87d5cc82d7d5191bbd7d Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 9 Sep 2021 12:39:10 +0200 Subject: [PATCH] XFA - Remove the checked attribute from the checkbox when unchecked (bug 1729877) - it aims to fix: https://bugzilla.mozilla.org/show_bug.cgi?id=1729877. --- src/display/xfa_layer.js | 4 ++++ test/pdfs/xfa_bug1729877.pdf.link | 1 + test/test_manifest.json | 15 +++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 test/pdfs/xfa_bug1729877.pdf.link diff --git a/src/display/xfa_layer.js b/src/display/xfa_layer.js index ab838a945..88c2bada3 100644 --- a/src/display/xfa_layer.js +++ b/src/display/xfa_layer.js @@ -37,6 +37,10 @@ class XfaLayer { ) { if (storedData.value === element.attributes.xfaOn) { html.setAttribute("checked", true); + } else if (storedData.value === element.attributes.xfaOff) { + // The checked attribute may have been set when opening the file, + // unset through the UI and we're here because of printing. + html.removeAttribute("checked"); } if (intent === "print") { break; diff --git a/test/pdfs/xfa_bug1729877.pdf.link b/test/pdfs/xfa_bug1729877.pdf.link new file mode 100644 index 000000000..ac1fe56bf --- /dev/null +++ b/test/pdfs/xfa_bug1729877.pdf.link @@ -0,0 +1 @@ +https://bugzilla.mozilla.org/attachment.cgi?id=9240352 diff --git a/test/test_manifest.json b/test/test_manifest.json index 0f83502a2..b1a9f9a31 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -967,6 +967,21 @@ "enableXfa": true, "type": "eq" }, + { "id": "xfa_bug1729877", + "file": "pdfs/xfa_bug1729877.pdf", + "md5": "1bf5429ea13a090f52edcd49cb0c4a47", + "link": true, + "rounds": 1, + "enableXfa": true, + "type": "eq", + "lastPage": 1, + "print": true, + "annotationStorage": { + "jobReq13847": { + "value": "0" + } + } + }, { "id": "xfa_bug1722038", "file": "pdfs/xfa_bug1722038.pdf", "md5": "95170baaade2ab6e1d0372f35db01747",