Closed
Bug 6432
Opened 26 years ago
Closed 26 years ago
JS window.onload = eh does not work in M5
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
VERIFIED
FIXED
M9
People
(Reporter: mle, Assigned: joki)
Details
(Whiteboard: [TESTCASE] setting windowref.onload only works for self)
Attachments
(1 file)
This is a bug in the most recent M5 build.
window.onload = onload_event_handler seems to do a nop.
The following html file demonstrates this problem. Save it as
"onload.html". It show a button, when you click on the button
onload loads a copy of itself into another window and sets
an event onload to run a handler. Even though the document
is loaded and displayed the handler never gets triggered.
<html>
<head><title>OnLoadTest</title>
</head>
<body>
<form name="form1">
<input value="Validate" type="button" size="80" onClick="LoadReadme();"></input>
</form>
<script>
var hubw;
function LoadReadme() {
hubw = window.open("onload.html","onload",
"width=300,height=600,toolbar=no,location=yes,directories=no,status=yes,menubar=
no,scrollbars=yes,resizable=yes");
hubw.onload = DoSomething;
}
function DoSomething() {
dump("\nShow this message if validateTargets get executed.\n");
dump("\nroot element: " + hubw.document.documentElement);
}
</script>
</body>
</html>
Updated•26 years ago
|
Assignee: norris → vidur
Component: JavaScript → DOM Level 0
Updated•26 years ago
|
Assignee: vidur → joki
Updated•26 years ago
|
Whiteboard: [MAKINGTEST] christian@wenz.org
Comment 1•26 years ago
|
||
Updated•26 years ago
|
Whiteboard: [MAKINGTEST] christian@wenz.org → [TESTCASE] setting windowref.onload only works for self
Comment 2•26 years ago
|
||
Description
setting window.onload does only work for self
Steps to reproduce:
1) open my attachment
2 [details] [diff] [review]) Click on the "Validate" button
3) a new window is opened and the onload property of this window is set to
DoSomething which should write the text "loaded" in the text edit of the new
window
Actual results:
nothing happens, the value of the text edit remains "loading..."
Expected results:
text edit's value changing to "loaded".
if you remove the comment before the line "window.onload=DoSomething;", the
value of the text edit changes to "loaded", so settting self.onload does work
Build Date and Platforms:
Occurs on M7 as well as the current daily build (Win32)
Does not occur on NN3+ and IE3+ (Win32)
Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M9
Assignee | ||
Comment 3•26 years ago
|
||
So the basic issue is that we clear the js scope when we load the new content.
We need to not do that when we leave the initially blank window we've created.
Looking into nailing down the details of the fix.
Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 4•26 years ago
|
||
This should be fixed now.
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 5•26 years ago
|
||
Verified. Working fine now.
You need to log in
before you can comment on or make changes to this bug.
Description
•