From b261446981809db266eaedc62f30e4d079d6c125 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Sat, 26 Jun 2021 23:21:43 +0200 Subject: [PATCH] XFA - Fix width of a container with lr-tb layout (bug 1718037) --- src/core/xfa/layout.js | 2 +- test/pdfs/xfa_bug1718037.pdf.link | 1 + test/test_manifest.json | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/pdfs/xfa_bug1718037.pdf.link diff --git a/src/core/xfa/layout.js b/src/core/xfa/layout.js index ad12c70dc..58a0b9781 100644 --- a/src/core/xfa/layout.js +++ b/src/core/xfa/layout.js @@ -112,7 +112,6 @@ function addHTML(node, html, bbox) { extra.height = Math.max(extra.height, extra.prevHeight + h); } else { const [, , w, h] = bbox; - extra.width = Math.max(extra.width, extra.currentWidth); extra.currentWidth = w; extra.prevHeight = extra.height; extra.height += h; @@ -120,6 +119,7 @@ function addHTML(node, html, bbox) { // The element has been added on a new line so switch to line mode now. extra.attempt = 0; } + extra.width = Math.max(extra.width, extra.currentWidth); break; case "rl-row": case "row": { diff --git a/test/pdfs/xfa_bug1718037.pdf.link b/test/pdfs/xfa_bug1718037.pdf.link new file mode 100644 index 000000000..b2cd211b2 --- /dev/null +++ b/test/pdfs/xfa_bug1718037.pdf.link @@ -0,0 +1 @@ +https://bugzilla.mozilla.org/attachment.cgi?id=9228741 diff --git a/test/test_manifest.json b/test/test_manifest.json index e309b96f7..49de9ba75 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -946,6 +946,14 @@ "enableXfa": true, "type": "eq" }, + { "id": "xfa_bug1718037", + "file": "pdfs/xfa_bug1718037.pdf", + "md5": "a0b53d50e9faed9d57950a5159d5da12", + "link": true, + "rounds": 1, + "enableXfa": true, + "type": "eq" + }, { "id": "xfa_bug1717681", "file": "pdfs/xfa_bug1717681.pdf", "md5": "435b1eae7e017b1a932fe204d1ba8be5",