mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-25 09:35:48 +02:00
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.
This commit is contained in:
parent
15d93e1f34
commit
44e637a064
@ -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") &&
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user