Correct the default value for isRenderable in the AnnotationElement constructor, to fix breaking errors when rendering unsupported annotations

*This regressed in PR 8828.*

When attempting to open e.g. http://mirrors.ctan.org/macros/latex/contrib/pdfcomment/doc/example.pdf, the annotation layers are now missing since `Error: Abstract method `AnnotationElement.render` called` is thrown multiple times.
This commit is contained in:
Jonas Jenwald 2017-08-31 08:18:53 +02:00
parent a4cc85fc5f
commit 87fc9bafea

View File

@ -95,7 +95,7 @@ class AnnotationElementFactory {
}
class AnnotationElement {
constructor(parameters, isRenderable = true, ignoreBorder = false) {
constructor(parameters, isRenderable = false, ignoreBorder = false) {
this.isRenderable = isRenderable;
this.data = parameters.data;
this.layer = parameters.layer;
@ -250,6 +250,10 @@ class AnnotationElement {
}
class LinkAnnotationElement extends AnnotationElement {
constructor(parameters) {
super(parameters, /* isRenderable = */ true);
}
/**
* Render the link annotation's HTML element in the empty container.
*
@ -902,7 +906,7 @@ class StrikeOutAnnotationElement extends AnnotationElement {
class FileAttachmentAnnotationElement extends AnnotationElement {
constructor(parameters) {
super(parameters, true);
super(parameters, /* isRenderable = */ true);
let file = this.data.file;
this.filename = getFilenameFromUrl(file.filename);