This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25209 - Unload event should be dispatched to window, but have document as target, similar to load event. (Gecko/WebKit/Blink seem to have that behavior.)
Summary: Unload event should be dispatched to window, but have document as target, sim...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-30 20:45 UTC by contributor
Modified: 2014-05-06 22:16 UTC (History)
4 users (show)

See Also:


Attachments
test (761 bytes, text/html)
2014-03-31 19:29 UTC, Olli Pettay
Details

Description contributor 2014-03-30 20:45:08 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#unloading-documents
Complete: http://www.whatwg.org/c#unloading-documents
Referrer: 

Comment:
Unload event should be dispatched to window, but have document as target,
similar to load event. (Gecko/WebKit/Blink seem to have that behavior.)

Posted from: 62.78.246.79
User agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0
Comment 1 Ian 'Hixie' Hickson 2014-03-31 17:08:10 UTC
Do you have a test case demonstrating this?
Comment 2 Olli Pettay 2014-03-31 19:29:18 UTC
Created attachment 1460 [details]
test
Comment 3 Arkadiusz Michalski (Spirit) 2014-04-01 10:23:01 UTC
https://bugzilla.mozilla.org/show_bug.cgi?id=989805#add_comment

BTW, why target override must by done? This is because of compatibility reason?
Comment 4 Olli Pettay 2014-04-01 10:59:51 UTC
At least for load event the behavior must be the one spec'ed.
I tried to fix it to behave normally 2006, but it was too late already then.
Web pages relied on the behavior.

I don't dare to change the very commonly used unload event either in Gecko.
Comment 5 contributor 2014-05-06 22:16:30 UTC
Checked in as WHATWG revision r8609.
Check-in comment: align 'load' and 'unload' events since they have similar quirks in practice
http://html5.org/tools/web-apps-tracker?from=8608&to=8609