Skip to content

Commit c9bdcd3

Browse files
committed
Manual merge of #988. Closes #988, fixes #987.
1 parent 268d01e commit c9bdcd3

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

components/prism-core.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,11 @@ if (script) {
484484

485485
if (document.addEventListener && !script.hasAttribute('data-manual')) {
486486
if(document.readyState !== "loading") {
487-
requestAnimationFrame(_.highlightAll, 0);
487+
if (window.requestAnimationFrame) {
488+
window.requestAnimationFrame(_.highlightAll);
489+
} else {
490+
window.setTimeout(_.highlightAll, 16);
491+
}
488492
}
489493
else {
490494
document.addEventListener('DOMContentLoaded', _.highlightAll);

components/prism-core.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prism.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,11 @@ if (script) {
489489

490490
if (document.addEventListener && !script.hasAttribute('data-manual')) {
491491
if(document.readyState !== "loading") {
492-
requestAnimationFrame(_.highlightAll, 0);
492+
if (window.requestAnimationFrame) {
493+
window.requestAnimationFrame(_.highlightAll);
494+
} else {
495+
window.setTimeout(_.highlightAll, 16);
496+
}
493497
}
494498
else {
495499
document.addEventListener('DOMContentLoaded', _.highlightAll);

0 commit comments

Comments
 (0)