<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25209</bug_id>
          
          <creation_ts>2014-03-30 20:45:08 +0000</creation_ts>
          <short_desc>Unload event should be dispatched to window, but have document as target, similar to load event. (Gecko/WebKit/Blink seem to have that behavior.)</short_desc>
          <delta_ts>2014-05-06 22:16:30 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#unloading-documents</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bugs</cc>
    
    <cc>crimsteam</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>103151</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-03-30 20:45:08 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103180</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-03-31 17:08:10 +0000</bug_when>
    <thetext>Do you have a test case demonstrating this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103194</commentid>
    <comment_count>2</comment_count>
      <attachid>1460</attachid>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-03-31 19:29:18 +0000</bug_when>
    <thetext>Created attachment 1460
test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103219</commentid>
    <comment_count>3</comment_count>
    <who name="Arkadiusz Michalski (Spirit)">crimsteam</who>
    <bug_when>2014-04-01 10:23:01 +0000</bug_when>
    <thetext>https://bugzilla.mozilla.org/show_bug.cgi?id=989805#add_comment

BTW, why target override must by done? This is because of compatibility reason?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103221</commentid>
    <comment_count>4</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-04-01 10:59:51 +0000</bug_when>
    <thetext>At least for load event the behavior must be the one spec&apos;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&apos;t dare to change the very commonly used unload event either in Gecko.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105251</commentid>
    <comment_count>5</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-05-06 22:16:30 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8609.
Check-in comment: align &apos;load&apos; and &apos;unload&apos; events since they have similar quirks in practice
http://html5.org/tools/web-apps-tracker?from=8608&amp;to=8609</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1460</attachid>
            <date>2014-03-31 19:29:18 +0000</date>
            <delta_ts>2014-03-31 19:29:18 +0000</delta_ts>
            <desc>test</desc>
            <filename>unloadevent.html</filename>
            <type>text/html</type>
            <size>761</size>
            <attacher name="Olli Pettay">bugs</attacher>
            
              <data encoding="base64">PGh0bWw+CiAgPGhlYWQ+CiAgICA8dGl0bGU+PC90aXRsZT4KICAgIDxzY3JpcHQ+CiAgICBmdW5j
dGlvbiB0ZXN0KCkgewogICAgICB2YXIgbCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJsb2ci
KTsKICAgICAgdmFyIGkgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgiaWZyYW1lIilb
MF07CiAgICAgIGkuY29udGVudERvY3VtZW50Lm9udW5sb2FkID0KICAgICAgICBmdW5jdGlvbihl
KSB7CiAgICAgICAgICBsLnRleHRDb250ZW50ICs9ICJkb2N1bWVudC5vbnVubG9hZDogdGFyZ2V0
PSIgKyBlLnRhcmdldCArICIsIGUuY3VycmVudFRhcmdldD0iICsgZS5jdXJyZW50VGFyZ2V0ICsg
IlxuIjsKICAgICAgICB9CiAgICAgIGkuY29udGVudFdpbmRvdy5vbnVubG9hZCA9CiAgICAgICAg
ZnVuY3Rpb24oZSkgewogICAgICAgICAgbC50ZXh0Q29udGVudCArPSAid2luZG93Lm9udW5sb2Fk
OiB0YXJnZXQ9IiArIGUudGFyZ2V0ICsgIiwgZS5jdXJyZW50VGFyZ2V0PSIgKyBlLmN1cnJlbnRU
YXJnZXQgKyAiXG4iOwogICAgICAgIH0KICAgICAgICBpLmNvbnRlbnRXaW5kb3cubG9jYXRpb24g
PSAiaHR0cDovL3d3dy5oZWxzaW5raS5maSI7CiAgICB9CiAgICA8L3NjcmlwdD4KICAgIDxzdHls
ZT4KICAgIDwvc3R5bGU+CiAgPC9oZWFkPgogIDxib2R5IG9ubG9hZD0idGVzdCgpIj4KICAgIDxp
ZnJhbWUgc3JjPSJhYm91dDpibGFuayI+PC9pZnJhbWU+CiAgICA8cHJlIGlkPSJsb2ciPjwvcHJl
PgogIDwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>