Send UnsupportedFeature notification when errors are ignored in FontFaceObject.getPathGenerator

This commit is contained in:
Jonas Jenwald 2018-06-13 11:02:10 +02:00
parent bf0db0fb72
commit 0958006713
2 changed files with 19 additions and 10 deletions

View file

@ -1885,6 +1885,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
isEvalSupported: params.isEvalSupported,
disableFontFace: params.disableFontFace,
ignoreErrors: params.ignoreErrors,
onUnsupportedFeature: this._onUnsupportedFeature.bind(this),
fontRegistry,
});
var fontReady = (fontObjs) => {
@ -1987,15 +1988,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
}
}, this);
messageHandler.on('UnsupportedFeature', function(data) {
if (this.destroyed) {
return; // Ignore any pending requests if the worker was terminated.
}
let loadingTask = this.loadingTask;
if (loadingTask.onUnsupportedFeature) {
loadingTask.onUnsupportedFeature(data.featureId);
}
}, this);
messageHandler.on('UnsupportedFeature', this._onUnsupportedFeature, this);
messageHandler.on('JpegDecode', function(data) {
if (this.destroyed) {
@ -2061,6 +2054,16 @@ var WorkerTransport = (function WorkerTransportClosure() {
}, this);
},
_onUnsupportedFeature({ featureId, }) {
if (this.destroyed) {
return; // Ignore any pending requests if the worker was terminated.
}
let loadingTask = this.loadingTask;
if (loadingTask.onUnsupportedFeature) {
loadingTask.onUnsupportedFeature(featureId);
}
},
getData: function WorkerTransport_getData() {
return this.messageHandler.sendWithPromise('GetData', null);
},