mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
XFA - Don't fail xfa loading because of a JS subexpression in SOM expressions
- Fix for one pdf in bug 1717668 (PDFIUM-292-0.pdf).
This commit is contained in:
parent
a0aff125dd
commit
0486d24e36
5 changed files with 40 additions and 6 deletions
|
@ -172,6 +172,9 @@ function handleBreak(node) {
|
|||
let target = null;
|
||||
if (node.target) {
|
||||
target = root[$searchNode](node.target, node[$getParent]());
|
||||
if (!target) {
|
||||
return false;
|
||||
}
|
||||
target = target ? target[0] : target;
|
||||
}
|
||||
|
||||
|
@ -197,12 +200,12 @@ function handleBreak(node) {
|
|||
target = null;
|
||||
}
|
||||
|
||||
const pageArea = target[$getParent]();
|
||||
const contentAreas = pageArea.contentArea.children;
|
||||
const pageArea = target && target[$getParent]();
|
||||
|
||||
let index;
|
||||
if (node.startNew) {
|
||||
if (target) {
|
||||
const contentAreas = pageArea.contentArea.children;
|
||||
index = contentAreas.findIndex(e => e === target) - 1;
|
||||
} else {
|
||||
index = currentPageArea.contentArea.children.findIndex(
|
||||
|
@ -210,6 +213,7 @@ function handleBreak(node) {
|
|||
);
|
||||
}
|
||||
} else if (target && target !== currentContentArea) {
|
||||
const contentAreas = pageArea.contentArea.children;
|
||||
index = contentAreas.findIndex(e => e === target) - 1;
|
||||
} else {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue