Skip to content

Commit 1279880

Browse files
committed
Annotation - For checkboxes, get field value from AS (if any) instead of V (bug 1722036)
- it aims to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1722036. - AS and V should share the same value for checkbox: it's at least what the specs say; - the pdf in the above bug opens correctly in Acrobat so it likely means that AS is chosen over V.
1 parent d6a2786 commit 1279880

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/core/annotation.js

+6
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,12 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
20832083
return;
20842084
}
20852085

2086+
if (this.appearance) {
2087+
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1722036
2088+
// If we've an AS and V then take AS.
2089+
this.data.fieldValue = this._decodeFormValue(params.dict.get("AS"));
2090+
}
2091+
20862092
const exportValues = normalAppearance.getKeys();
20872093
if (!exportValues.includes("Off")) {
20882094
// The /Off appearance is optional.

test/pdfs/bug1722036.pdf.link

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://bugzilla.mozilla.org/attachment.cgi?id=9232845

test/test_manifest.json

+7
Original file line numberDiff line numberDiff line change
@@ -5899,5 +5899,12 @@
58995899
"rounds": 1,
59005900
"lastPage": 1,
59015901
"type": "eq"
5902+
},
5903+
{ "id": "bug1722036",
5904+
"file": "pdfs/bug1722036.pdf",
5905+
"md5": "bbc7f62ca85609c97069bd3ce2658288",
5906+
"rounds": 1,
5907+
"link": true,
5908+
"type": "eq"
59025909
}
59035910
]

0 commit comments

Comments
 (0)