Remove the addLinkAttributes warnings in the Annotation/XFA-layers (PR 14092 follow-up)

These warnings have now been present in three releases, see PR 14092, hence it should (hopefully) be fine to remove them now.
This commit is contained in:
Jonas Jenwald 2022-03-13 11:38:56 +01:00
parent 9e4aaf18f7
commit 0c349c701f
2 changed files with 2 additions and 19 deletions

View File

@ -481,15 +481,7 @@ class LinkAnnotationElement extends AnnotationElement {
const link = document.createElement("a");
if (data.url) {
if (
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
!linkService.addLinkAttributes
) {
warn(
"LinkAnnotationElement.render - missing `addLinkAttributes`-method on the `linkService`-instance."
);
}
linkService.addLinkAttributes?.(link, data.url, data.newWindow);
linkService.addLinkAttributes(link, data.url, data.newWindow);
} else if (data.action) {
this._bindNamedAction(link, data.action);
} else if (data.dest) {

View File

@ -16,7 +16,6 @@
/** @typedef {import("./display_utils").PageViewport} PageViewport */
/** @typedef {import("../../web/interfaces").IPDFLinkService} IPDFLinkService */
import { warn } from "../shared/util.js";
import { XfaText } from "./xfa_text.js";
/**
@ -134,15 +133,7 @@ class XfaLayer {
}
if (isHTMLAnchorElement) {
if (
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
!linkService.addLinkAttributes
) {
warn(
"XfaLayer.setAttribute - missing `addLinkAttributes`-method on the `linkService`-instance."
);
}
linkService.addLinkAttributes?.(
linkService.addLinkAttributes(
html,
attributes.href,
attributes.newWindow