Closed
Bug 365149
Opened 18 years ago
Closed 15 years ago
Firefox crashes due to JavaScript infinite recursion by calling onload() from the BODY tag's onload handler
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 201828
People
(Reporter: mozilla, Unassigned)
References
()
Details
User-Agent: Opera/9.10 (Windows NT 5.1; U; en)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
Seems to happen when you try to set the BODY tag's onload event to "onload();" - causes infinite recursion. The crash doesn't happen in 2.0.
Reproducible: Always
Steps to Reproduce:
1.Go to the specified URL.
Actual Results:
Firefox crashes.
Expected Results:
It should either throw a JS exception (like 2.0 does) or not treat onload() as a special function (like other browsers).
Updated•18 years ago
|
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
Comment 1•18 years ago
|
||
I just inadvertantly hit this myself, an "onload" handler named "onload" causes an immediate crash in 1.5.0.9
<html>
<head>
<title>OnLoad Test</title>
<script>
function onload() {
alert("onload()");
}
</script>
</head>
<body onload="onload()">
This is the body
</body>
</html>
Updated•18 years ago
|
Assignee: nobody → events
Component: General → DOM: Events
QA Contact: general → ian
Comment 2•18 years ago
|
||
WFM Ubuntu Edgy FF2.0.0.1. Firefox doesn't crash, but firebug alerts me "too much recursion".
Robin
Comment 3•15 years ago
|
||
3.5 still has the infinite recursion issue (no crash though). Firebug shows the code from the "onload" attribute is actually being put into a function named "onload".
Not a huge problem, but seems like something that ought to be fixed. In my case I had my PHP backend automatically adding the onload attribute if it found a script for the current page with a function by that name, and scratched my head a little while wondering why it didn't fire.
Updated•15 years ago
|
Assignee: events → nobody
QA Contact: ian → events
Comment 4•15 years ago
|
||
Same for me on Vista with Firefox trunk; "infinite recursion" error message but no crash.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•