Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Annotation] A push button can have no action (bug 1778692) #15153

Merged
merged 1 commit into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
]