From e336604ef1e1d424c4b9cac8833469abe0f7a3ee Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Thu, 6 Oct 2016 09:30:18 -0500 Subject: [PATCH] Disables Font Loading API for Firefox. --- src/display/font_loader.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/display/font_loader.js b/src/display/font_loader.js index 74f676c7230c1..7fb31579f8907 100644 --- a/src/display/font_loader.js +++ b/src/display/font_loader.js @@ -118,6 +118,10 @@ FontLoader.prototype = { warn('Failed to load font "' + nativeFontFace.family + '": ' + e); }); }; + // Firefox Font Loading API does not work with mozPrintCallback -- + // disabling it in this case. + var isFontLoadingAPISupported = FontLoader.isFontLoadingAPISupported && + !FontLoader.isSyncFontLoadingSupported; for (var i = 0, ii = fonts.length; i < ii; i++) { var font = fonts[i]; @@ -128,7 +132,7 @@ FontLoader.prototype = { } font.attached = true; - if (FontLoader.isFontLoadingAPISupported) { + if (isFontLoadingAPISupported) { var nativeFontFace = font.createNativeFontFace(); if (nativeFontFace) { this.addNativeFontFace(nativeFontFace); @@ -145,7 +149,7 @@ FontLoader.prototype = { } var request = this.queueLoadingCallback(callback); - if (FontLoader.isFontLoadingAPISupported) { + if (isFontLoadingAPISupported) { Promise.all(fontLoadPromises).then(function() { request.complete(); });