From 87fc9bafead57ee6c3def028cc211cae9c3d83d3 Mon Sep 17 00:00:00 2001
From: Jonas Jenwald <jonas.jenwald@gmail.com>
Date: Thu, 31 Aug 2017 08:18:53 +0200
Subject: [PATCH] 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.
---
 src/display/annotation_layer.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js
index 13c15184e..1014458eb 100644
--- a/src/display/annotation_layer.js
+++ b/src/display/annotation_layer.js
@@ -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);