mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Merge pull request #13735 from Snuffleupagus/bug-1720411
Ensure that the field value, for checkboxes, refers to an existing appearance state (bug 1720411)
This commit is contained in:
commit
07955fa1d3
4 changed files with 26 additions and 12 deletions
|
@ -2198,8 +2198,8 @@ describe("annotation", function () {
|
|||
});
|
||||
|
||||
it("should handle checkboxes with export value", async function () {
|
||||
buttonWidgetDict.set("V", Name.get("1"));
|
||||
buttonWidgetDict.set("DV", Name.get("2"));
|
||||
buttonWidgetDict.set("V", Name.get("Checked"));
|
||||
buttonWidgetDict.set("DV", Name.get("Off"));
|
||||
|
||||
const appearanceStatesDict = new Dict();
|
||||
const normalAppearanceDict = new Dict();
|
||||
|
@ -2222,15 +2222,15 @@ describe("annotation", function () {
|
|||
);
|
||||
expect(data.annotationType).toEqual(AnnotationType.WIDGET);
|
||||
expect(data.checkBox).toEqual(true);
|
||||
expect(data.fieldValue).toEqual("1");
|
||||
expect(data.defaultFieldValue).toEqual("2");
|
||||
expect(data.fieldValue).toEqual("Checked");
|
||||
expect(data.defaultFieldValue).toEqual("Off");
|
||||
expect(data.radioButton).toEqual(false);
|
||||
expect(data.exportValue).toEqual("Checked");
|
||||
});
|
||||
|
||||
it("should handle checkboxes without export value", async function () {
|
||||
buttonWidgetDict.set("V", Name.get("1"));
|
||||
buttonWidgetDict.set("DV", Name.get("2"));
|
||||
buttonWidgetDict.set("V", Name.get("Checked"));
|
||||
buttonWidgetDict.set("DV", Name.get("Off"));
|
||||
|
||||
const buttonWidgetRef = Ref.get(124, 0);
|
||||
const xref = new XRefMock([
|
||||
|
@ -2245,14 +2245,14 @@ describe("annotation", function () {
|
|||
);
|
||||
expect(data.annotationType).toEqual(AnnotationType.WIDGET);
|
||||
expect(data.checkBox).toEqual(true);
|
||||
expect(data.fieldValue).toEqual("1");
|
||||
expect(data.defaultFieldValue).toEqual("2");
|
||||
expect(data.fieldValue).toEqual("Checked");
|
||||
expect(data.defaultFieldValue).toEqual("Off");
|
||||
expect(data.radioButton).toEqual(false);
|
||||
});
|
||||
|
||||
it("should handle checkboxes without /Off appearance", async function () {
|
||||
buttonWidgetDict.set("V", Name.get("1"));
|
||||
buttonWidgetDict.set("DV", Name.get("2"));
|
||||
buttonWidgetDict.set("V", Name.get("Checked"));
|
||||
buttonWidgetDict.set("DV", Name.get("Off"));
|
||||
|
||||
const appearanceStatesDict = new Dict();
|
||||
const normalAppearanceDict = new Dict();
|
||||
|
@ -2274,8 +2274,8 @@ describe("annotation", function () {
|
|||
);
|
||||
expect(data.annotationType).toEqual(AnnotationType.WIDGET);
|
||||
expect(data.checkBox).toEqual(true);
|
||||
expect(data.fieldValue).toEqual("1");
|
||||
expect(data.defaultFieldValue).toEqual("2");
|
||||
expect(data.fieldValue).toEqual("Checked");
|
||||
expect(data.defaultFieldValue).toEqual("Off");
|
||||
expect(data.radioButton).toEqual(false);
|
||||
expect(data.exportValue).toEqual("Checked");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue