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

Merge pull request #13881 from calixteman/bug_1723734

XFA - Elements under an area must be bound (bug 1723734)
This commit is contained in:
Brendan Dahl 2021-08-06 11:56:58 -07:00 committed by GitHub
commit 3d18c76a53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 0 deletions

View file

@ -1400,4 +1400,30 @@ describe("XFAParser", function () {
).toEqual(["a", "b", "c", "d", "e"]);
});
});
it("should make a binding with a element in an area", function () {
const xml = `
<?xml version="1.0"?>
<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">
<template xmlns="http://www.xfa.org/schema/xfa-template/3.3">
<subform name="A" mergeMode="matchTemplate">
<area>
<field name="B"/>
</area>
</subform>
</template>
<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
<xfa:data>
<A><B>foobar</B></A>
</xfa:data>
</xfa:datasets>
</xdp:xdp>
`;
const root = new XFAParser().parse(xml);
const form = new Binder(root).bind();
expect(searchNode(form, form, "A..B..text")[0][$dump]().$content).toBe(
"foobar"
);
});
});