From 44e637a0641fe0e7d70f12b9523cbf2eea90f544 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 24 Jun 2026 10:39:12 +0200 Subject: [PATCH] Remove explicit `xref` usage in the `ScreenAnnotation.prototype.#renditionActions` method Rather than fetching "raw" dictionary-data and then manually resolving any references, we can simply use `Dict.prototype.get` and `Dict`-iteration to access the needed data *directly* instead. --- src/core/annotation.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/annotation.js b/src/core/annotation.js index ad9d79efa..d3caab0b8 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -5686,7 +5686,7 @@ class ScreenAnnotation extends MediaAnnotation { * } | null} */ static #findAsset(dict, xref) { - for (const action of this.#renditionActions(dict, xref)) { + for (const action of this.#renditionActions(dict)) { const asset = this.#findRenditionAsset( action.get("R"), xref, @@ -5699,10 +5699,10 @@ class ScreenAnnotation extends MediaAnnotation { return null; } - static *#renditionActions(dict, xref) { + static *#renditionActions(dict) { // The rendition action may be the activation action (/A) or one of the // additional actions (/AA), e.g. page-open. - const action = xref.fetchIfRef(dict.getRaw("A")); + const action = dict.get("A"); if ( action instanceof Dict && isName(action.get("S"), "Rendition") && @@ -5712,8 +5712,7 @@ class ScreenAnnotation extends MediaAnnotation { } const additionalActions = dict.get("AA"); if (additionalActions instanceof Dict) { - for (const key of additionalActions.getKeys()) { - const aa = xref.fetchIfRef(additionalActions.getRaw(key)); + for (const [, aa] of additionalActions) { if ( aa instanceof Dict && isName(aa.get("S"), "Rendition") &&