|
|
@@ -141,34 +141,34 @@ this.hooksFrame = this.hooksFrame || (() => {
|
|
|
console.warn("SingleFile is hooking the requestAnimationFrame and cancelAnimationFrame functions to load deferred images."); // eslint-disable-line no-console
|
|
|
warningRequestAnimationFrameDisplayed = true;
|
|
|
}
|
|
|
- let id;
|
|
|
+ let requestId;
|
|
|
if (loadDeferredImages) {
|
|
|
- id = setTimeout(() => {
|
|
|
- pendingSetTimeoutCalls.delete(id);
|
|
|
+ requestId = setTimeout(() => {
|
|
|
+ pendingSetTimeoutCalls.delete(requestId);
|
|
|
callback(0);
|
|
|
}, 0);
|
|
|
- pendingSetTimeoutCalls.set(id, callback);
|
|
|
+ pendingSetTimeoutCalls.set(requestId, callback);
|
|
|
} else {
|
|
|
- id = requestAnimationFrame(timestamp => {
|
|
|
- pendingRequestAnimationFrameCalls.delete(id);
|
|
|
+ requestId = requestAnimationFrame(timestamp => {
|
|
|
+ pendingRequestAnimationFrameCalls.delete(requestId);
|
|
|
callback(timestamp);
|
|
|
});
|
|
|
- pendingRequestAnimationFrameCalls.set(id, callback);
|
|
|
+ pendingRequestAnimationFrameCalls.set(requestId, callback);
|
|
|
}
|
|
|
- return id;
|
|
|
+ return requestId;
|
|
|
};
|
|
|
window.requestAnimationFrame.toString = function () { return "requestAnimationFrame() { [native code] }"; };
|
|
|
|
|
|
- window.cancelAnimationFrame = function (id) {
|
|
|
- const pendingCallDeleted = pendingRequestAnimationFrameCalls.delete(id);
|
|
|
+ window.cancelAnimationFrame = function (requestId) {
|
|
|
+ const pendingCallDeleted = pendingRequestAnimationFrameCalls.delete(requestId);
|
|
|
if (pendingCallDeleted) {
|
|
|
- return cancelAnimationFrame(id);
|
|
|
+ return cancelAnimationFrame(requestId);
|
|
|
} else {
|
|
|
- const pendingCallDeleted = pendingSetTimeoutCalls.delete(id);
|
|
|
+ const pendingCallDeleted = pendingSetTimeoutCalls.delete(requestId);
|
|
|
if (pendingCallDeleted) {
|
|
|
- return clearTimeout(id);
|
|
|
+ return clearTimeout(requestId);
|
|
|
} else {
|
|
|
- return cancelAnimationFrame(id);
|
|
|
+ return cancelAnimationFrame(requestId);
|
|
|
}
|
|
|
}
|
|
|
};
|