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 8f26ba5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1440,8 +1440,8 @@ class PushButtonWidgetAnnotationElement extends LinkAnnotationElement {
container.title = this.data.alternativeText;
}

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

linkElement.addEventListener("updatefromsandbox", jsEvent => {
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 8f26ba5

Please sign in to comment.