Disables Font Loading API for Firefox.

This commit is contained in:
Yury Delendik 2016-10-06 09:30:18 -05:00
parent e48f388d24
commit e336604ef1

View File

@ -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();
});