diff --git a/src/core/xfa/layout.js b/src/core/xfa/layout.js index 231c676c2..3017b4081 100644 --- a/src/core/xfa/layout.js +++ b/src/core/xfa/layout.js @@ -290,13 +290,13 @@ function checkDimensions(node, space) { return true; } if (parent[$extra].numberInLine === 0) { - return space.height > 0; + return space.height > ERROR; } return false; } - return space.width > 0; + return space.width > ERROR; } // No layout failure. @@ -307,7 +307,7 @@ function checkDimensions(node, space) { return Math.round(w - space.width) <= ERROR; } - return space.width > 0; + return space.width > ERROR; } // Second attempt: try to put the element on the next line. @@ -322,14 +322,14 @@ function checkDimensions(node, space) { } if (node.w === "" || Math.round(w - space.width) <= ERROR) { - return space.height > 0; + return space.height > ERROR; } if (parent[$isThereMoreWidth]()) { return false; } - return space.height > 0; + return space.height > ERROR; case "table": case "tb": if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { @@ -345,14 +345,14 @@ function checkDimensions(node, space) { // in the provided space and maybe a children won't fit. if (node.w === "" || Math.round(w - space.width) <= ERROR) { - return space.height > 0; + return space.height > ERROR; } if (parent[$isThereMoreWidth]()) { return false; } - return space.height > 0; + return space.height > ERROR; case "position": if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { return true; diff --git a/test/pdfs/xfa_issue13855.pdf.link b/test/pdfs/xfa_issue13855.pdf.link new file mode 100644 index 000000000..2dedacb80 --- /dev/null +++ b/test/pdfs/xfa_issue13855.pdf.link @@ -0,0 +1 @@ +https://github.com/mozilla/pdf.js/files/6924738/imm5710f.1.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index 5dc6d9881..e42c29613 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1246,6 +1246,16 @@ "enableXfa": true, "type": "eq" }, + { "id": "xfa_issue13855", + "file": "pdfs/xfa_issue13855.pdf", + "md5": "0aaaf62ff979c7837c2c63df44456238", + "link": true, + "rounds": 1, + "firstPage": 3, + "lastPage": 3, + "enableXfa": true, + "type": "eq" + }, { "id": "xfa_issue13584", "file": "pdfs/xfa_issue13584.pdf", "md5": "c41af0754dabd81996a0d54db1900beb",