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)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

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>
Assignee: norris → vidur
Component: JavaScript → DOM Level 0
QA Contact: 4590 → 4015
Assignee: vidur → joki
QA Contact: 4015 → 4616
Whiteboard: [MAKINGTEST] christian@wenz.org
Whiteboard: [MAKINGTEST] christian@wenz.org → [TESTCASE] setting windowref.onload only works for self
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)
Status: NEW → ASSIGNED
Target Milestone: M9
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.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
This should be fixed now.
Status: RESOLVED → VERIFIED
Verified. Working fine now.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: