|
|
@@ -105,7 +105,6 @@ this.hooksFrame = this.hooksFrame || (() => {
|
|
|
});
|
|
|
if (pendingRequestAnimationFrameCalls.size) {
|
|
|
Array.from(pendingRequestAnimationFrameCalls).forEach(([id, callback]) => {
|
|
|
- pendingRequestAnimationFrameCalls.delete(id);
|
|
|
cancelAnimationFrame(id);
|
|
|
callback();
|
|
|
});
|
|
|
@@ -155,9 +154,11 @@ this.hooksFrame = this.hooksFrame || (() => {
|
|
|
window.requestAnimationFrame.toString = function () { return "requestAnimationFrame() { [native code] }"; };
|
|
|
|
|
|
window.cancelAnimationFrame = function (id) {
|
|
|
- pendingRequestAnimationFrameCalls.delete(id);
|
|
|
- if (loadDeferredImages) {
|
|
|
- return clearTimeout(id);
|
|
|
+ const pendingCallDeleted = pendingRequestAnimationFrameCalls.delete(id);
|
|
|
+ if (loadDeferredImages || !pendingCallDeleted) {
|
|
|
+ if (loadDeferredImages) {
|
|
|
+ return clearTimeout(id);
|
|
|
+ }
|
|
|
} else {
|
|
|
return cancelAnimationFrame(id);
|
|
|
}
|