+++ This bug was initially created as a clone of Bug #7080 +++ At current, infinite javascript loops are really infinite, we need a way to detect and stop them. This currently occurs in: - bug 3552 - bug 6693 - bug 6958 Any sort of infinite loop in a javascript method will take over the entire browser, and requires a "Force Quit..." on OS X to get Safari to stop hogging all the CPU. Try the following test case: <html> <head> <title>Abort Feature 1</title> <script type="text/javascript"> var run = true; var a = 1; function startLoop(){ while(run){ a++; document.forms[0].elements[0].value=a; } } </script> </head> <body> <h3>Abort Feature 1</h3> <p> Activate the "Start Loop" link below to start an infinite loop by script execution.<br/> Then stop script execution using script cancellation UI feature. </p> <p> <a href="#" onClick="startLoop()">Start Loop</a><br/> <form><input/></form> </p> </body> </html>
How to reproduce: Load the test case provided in the description. Click the link "Start Loop" Expected result: The script execution should be stopped by cancellation. Actual result: The script execution cannot be stopped. After clicking Start Loop, the browser hangs and can't do another operaton on the browser. *** This bug has been marked as a duplicate of 7080 ***
Created attachment 8358 [details] onClick() Javascript infinite loop The source code of this test file is already available in the description.
TSW Error ID: EQWU-6KZ9QR
Closed.