See https://bugzilla.mozilla.org/show_bug.cgi?id=1735738 for reference.
annotationLayerCanvas = self.annotationLayerCanvas;
                  if (!annotationLayerCanvas) {
                    annotationLayerCanvas = document.createElement("canvas");
                    self.annotationLayerCanvas = annotationLayerCanvas;
                  }
                  annotationLayerCanvas.width = viewport.width;
                  annotationLayerCanvas.height = viewport.height;
                  var annotationLayerContext =
                    annotationLayerCanvas.getContext("2d");
                  annotationLayerContext.clearRect(
                    0,
                    0,
                    annotationLayerCanvas.width,
                    annotationLayerCanvas.height
                  );
                  if (!renderXfa) {
                    
                    
                    initPromise = page
                      .getAnnotations({ intent: "display" })
                      .then(function (annotations) {
                        return rasterizeAnnotationLayer(
                          annotationLayerContext,
                          viewport,
                          annotations,
                          page,
                          IMAGE_RESOURCES_PATH,
                          renderForms
                        );
                      });