Skip to content

Commit

Permalink
[Annotation] A push button can have no action (bug 1778692)
Browse files Browse the repository at this point in the history
  • Loading branch information
calixteman committed Jul 8, 2022
1 parent b0a3c9e commit 52ae2f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ class PushButtonWidgetAnnotationElement extends LinkAnnotationElement {
container.title = this.data.alternativeText;
}

if (this.enableScripting && this.hasJSActions) {
if (this.enableScripting && this.hasJSActions && container.lastChild) {
const linkElement = container.lastChild;
this._setDefaultPropertiesFromJS(linkElement);

Expand Down
2 changes: 2 additions & 0 deletions test/pdfs/bug1778692.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://bugzilla.mozilla.org/attachment.cgi?id=9284681

10 changes: 10 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6837,5 +6837,15 @@
"rotation": 270
}
}
},
{ "id": "bug1778692",
"file": "pdfs/bug1778692.pdf",
"md5": "8855414caaa04fbbdfad1545d1c8a8ae",
"rounds": 1,
"link": true,
"firstPage": 2,
"lastPage": 2,
"type": "eq",
"annotations": true
}
]

0 comments on commit 52ae2f3

Please sign in to comment.