XFA - Avoid to put something in very small areas
- it aims to fix #13855.
This commit is contained in:
parent
4ad5c5d52a
commit
be1ee155d1
@ -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;
|
||||
|
1
test/pdfs/xfa_issue13855.pdf.link
Normal file
1
test/pdfs/xfa_issue13855.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
https://github.com/mozilla/pdf.js/files/6924738/imm5710f.1.pdf
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user