Closed Bug 304764 Opened 19 years ago Closed 19 years ago

Body event handlers don't survive a back/forward trip

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mrbkap, Assigned: mrbkap)

References

Details

Attachments

(2 files, 1 obsolete file)

I noticed after my checkin for bug 303267, event handlers on the <BODY> element
weren't making it through a back/forward trip. This is because we incorrectly
null out mListenerManager on the newInner in nsGlobalWindow::SetNewDocument. I
have a simple patch that fixes this, but I need to check to make sure that it
isn't going to allow multiple inner windows to hold the same listener manager.
Attached file testcase
Steps to reproduce:
* Click on the body
- Note the onclick handler is called and shows the alert
* Click on the link
- Note that the onclick handler is called for the link and for the body. The
new page loads.
* Click on the back button.
* Click on the body.
- Note that the onclick handler is *not* called.
* Click on the link.
- The link's onclick handler is called, but the body's is not.
Attached patch potential patch (obsolete) — Splinter Review
I need to test this for whether or not this allows the same listener manager to
be held by two inner windows (I don't think this is possible, but if it is,
then we need to clone the listener manager instead of simply copying it over).
Status: NEW → ASSIGNED
Based on the assertions that we decided to make about reUseInnerWindow, I think
that we can make the same ones about aRemoveEventListeners. I tried to make the
new page load after the about:blank page would have loaded (i.e., w =
window.open(); w.onload = ...; w.location.href = ...) and things seemed to work
fine.
Attachment #192794 - Attachment is obsolete: true
Attachment #192856 - Flags: review?(jst)
Comment on attachment 192856 [details] [diff] [review]
some more assertions

r=jst, looks good.
Attachment #192856 - Flags: review?(jst) → review+
Attachment #192856 - Flags: superreview?(bzbarsky)
Comment on attachment 192856 [details] [diff] [review]
some more assertions

Blake says this is being handled elsewhere.
Attachment #192856 - Flags: superreview?(bzbarsky)
This was fixed by the checkin for bug 303765.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: