Closed
Bug 270700
Opened 20 years ago
Closed 20 years ago
error and infinite loop when accessing element properties from onfocus events
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 270696
People
(Reporter: bugzilla, Assigned: bugzilla)
Details
Attachments
(1 file)
|
783 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
This only seems to work when the offending code is within an alert() call, in an
onfocus event. The code shown below is a simple function that finds any
element's closest parent element. It causes an infinite loop when run like this.
Some, but not all elements cause errors in the JavaScript console - see the example.
Reproducible: Always
Steps to Reproduce:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Crash Bug</title>
<script type="text/javascript"><!--
function findParentDiv(el) {
do {
if (el.nodeName.toLowerCase() == 'div') {
return el;
}
} while (el = el.parentNode);
return false;
}
//-->
</script>
</head>
<body bgcolor="#ffffff">
<div id=foo class=lala>
<p>Test 1: <a href="#" onFocus="alert(findParentDiv(this))">click here</a>
and the browser enters an infinite loop</p>
<p>Test 2: <input type=text size=24 value="click here"
onFocus="alert(findParentDiv(this))"> and the same happens, but with errors in
the JavaScript console.</p>
</div>
</body>
</html>| Reporter | ||
Comment 1•20 years ago
|
||
Comment 2•20 years ago
|
||
*** This bug has been marked as a duplicate of 270696 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•