Open
Bug 931618
Opened 11 years ago
Updated 2 years ago
onpopstate event can't work after document.write() is used
Categories
(Core :: DOM: Events, defect, P5)
Tracking
()
REOPENED
People
(Reporter: owyntyler, Unassigned)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 Steps to reproduce: 1. document.write() 2. window.onpopstate = function( e ) {alert(1);} 3. history.back() Actual results: no event firing Expected results: alert(1)
Comment 1•11 years ago
|
||
Could you upload a minimal testcase (note, in certain cases webkit/blink based browsers don't have document.write and session history the way it is specified in HTML spec so this might be related to that).
Reporter | ||
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
So document.write in that timeout creates a new window object, and you set listener there. Then back goes back to the previous window/document-before-write and possible events fire on that window, not the window object which was created when document.write was called. This is exactly the case where webkit/blink don't follow the spec, so you'll get different behavior there. As far as I see this is invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 4•11 years ago
|
||
>and possible events fire on that window
no, it's not firing anywhere and I don't see a way for onpopstate event to possible be triggered after execution of document.write(), here's testpage where event listener is set to window before doing document.write()
Comment 5•11 years ago
|
||
Ok, I can see a problem. Well two problems. The spec has changed (again) after popstate was implemented so popstate dispatching should be async and SharesDocumentWith doesn't seem to do the right thing always.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Comment 6•6 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•