mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Catch, and propagate, errors in the requestAnimationFrame
branch of InternalRenderTask._scheduleNext
To support these changes, `InternalRenderTask._next` now returns a Promise.
This commit is contained in:
parent
2030d1718f
commit
778981ec89
1 changed files with 21 additions and 17 deletions
|
@ -2455,13 +2455,16 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
|
||||||
|
|
||||||
_scheduleNext: function InternalRenderTask__scheduleNext() {
|
_scheduleNext: function InternalRenderTask__scheduleNext() {
|
||||||
if (this.useRequestAnimationFrame && typeof window !== 'undefined') {
|
if (this.useRequestAnimationFrame && typeof window !== 'undefined') {
|
||||||
window.requestAnimationFrame(this._nextBound);
|
window.requestAnimationFrame(() => {
|
||||||
|
this._nextBound().catch(this.callback);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Promise.resolve().then(this._nextBound).catch(this.callback);
|
Promise.resolve().then(this._nextBound).catch(this.callback);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_next: function InternalRenderTask__next() {
|
_next: function InternalRenderTask__next() {
|
||||||
|
return new Promise(() => {
|
||||||
if (this.cancelled) {
|
if (this.cancelled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2479,6 +2482,7 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
|
||||||
this.callback();
|
this.callback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue