diff --git a/src/core/xfa/som.js b/src/core/xfa/som.js index 6955292b1..cd2e92a84 100644 --- a/src/core/xfa/som.js +++ b/src/core/xfa/som.js @@ -15,6 +15,7 @@ import { $appendChild, + $getChildren, $getChildrenByClass, $getChildrenByName, $getParent, @@ -37,7 +38,12 @@ const operators = { }; const shortcuts = new Map([ - ["$data", (root, current) => root.datasets.data], + ["$data", (root, current) => (root.datasets ? root.datasets.data : root)], + [ + "$record", + (root, current) => + (root.datasets ? root.datasets.data : root)[$getChildren]()[0], + ], ["$template", (root, current) => root.template], ["$connectionSet", (root, current) => root.connectionSet], ["$form", (root, current) => root.form], diff --git a/test/pdfs/xfa_issue13994.pdf.link b/test/pdfs/xfa_issue13994.pdf.link new file mode 100644 index 000000000..27522b438 --- /dev/null +++ b/test/pdfs/xfa_issue13994.pdf.link @@ -0,0 +1 @@ +https://github.com/mozilla/pdf.js/files/7138335/Form_MGT-14-try-1.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index 0f83502a2..edeefda35 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1277,6 +1277,15 @@ "enableXfa": true, "type": "eq" }, + { "id": "xfa_issue13994", + "file": "pdfs/xfa_issue13994.pdf", + "md5": "787ad7cfbb822bb4f80e2243305c9f0c", + "link": true, + "rounds": 1, + "lastPage": 1, + "enableXfa": true, + "type": "eq" + }, { "id": "xfa_issue13855", "file": "pdfs/xfa_issue13855.pdf", "md5": "0aaaf62ff979c7837c2c63df44456238",