Bug 131607 - Changing system time when using SetInterval()
Summary: Changing system time when using SetInterval()
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 525.x (Safari 3.2)
Hardware: PC Windows 8
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-14 00:46 PDT by Marek
Modified: 2014-04-14 00:46 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek 2014-04-14 00:46:08 PDT
Using setInterval() or setTimeout() in Javascript code and changing system time backward for example 1 hour causes browser (newest Safari)/ or engine (older version of QT WebKit) to freeze.

Sample code:
HTML:
<p id="date"></p>

JS:
setInterval(SetTime, 1000);
function SetTime() {
document.getElementById('date').textContent=new Date();
}

OR:

(function loop() {
document.getElementById('date').textContent=new Date();
setTimeout(loop, 1000);
})();

StackOverflow question: http://stackoverflow.com/questions/23013324/webkit-setinterval-and-system-time-change