1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

XFA - Avoid to put something in very small areas

- it aims to fix #13855.
This commit is contained in:
Calixte Denizet 2021-08-03 16:22:52 +02:00
parent 4ad5c5d52a
commit be1ee155d1
3 changed files with 18 additions and 7 deletions

View file

@ -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;