Merge pull request #7694 from yurydelendik/print-ff

Disables Font Loading API for Firefox.
This commit is contained in:
Tim van der Meij 2016-10-06 23:17:12 +02:00 committed by GitHub
commit f8bd3d4473

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