From ca05b650aa5e62adc499e9357a0d434b1a1cf29a Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 26 Sep 2022 13:21:00 +0200 Subject: [PATCH] Remove the unused `rules` parameter from the `_prepareFontLoadEvent` method (PR 3477 follow-up) This is yet another small piece of functionality that became unused in PR 3477 (which landed nine years ago). --- src/display/font_loader.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/display/font_loader.js b/src/display/font_loader.js index ad8c5f23d..42f57a962 100644 --- a/src/display/font_loader.js +++ b/src/display/font_loader.js @@ -114,7 +114,7 @@ class FontLoader { } await new Promise(resolve => { const request = this._queueLoadingCallback(resolve); - this._prepareFontLoadEvent([rule], [font], request); + this._prepareFontLoadEvent([font], request); }); // The font was, asynchronously, loaded. } @@ -218,7 +218,7 @@ class FontLoader { return shadow(this, "_loadTestFont", testFont); } - _prepareFontLoadEvent(rules, fonts, request) { + _prepareFontLoadEvent(fonts, request) { if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) { throw new Error("Not implemented: _prepareFontLoadEvent"); } @@ -252,9 +252,8 @@ class FontLoader { let called = 0; function isFontReady(name, callback) { - called++; // With setTimeout clamping this gives the font ~100ms to load. - if (called > 30) { + if (++called > 30) { warn("Load test font never loaded."); callback(); return;