<?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>18707</bug_id>
          
          <creation_ts>2012-08-27 17:22:30 +0000</creation_ts>
          <short_desc>It seems that if you document.write from within the load event and then reload the window, it is as if the insertion point was defined (i.e. it reloads the original content, not the document.written content). So something about the interaction of the inse</short_desc>
          <delta_ts>2012-11-27 04:43:27 +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/#the-end</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>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>james</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72822</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-08-27 17:22:30 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#the-end
Complete: http://www.whatwg.org/c#the-end

Comment:
It seems that if you document.write from within the load event and then reload
the window, it is as if the insertion point was defined (i.e. it reloads the
original content, not the document.written content). So something about the
interaction of the insertion point, the reload override flag and
document.write is wrong

Posted from: 85.229.223.104
User agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; Edition Next; en) Presto/2.11.310 Version/12.50</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72888</commentid>
    <comment_count>1</comment_count>
    <who name="James Graham">james</who>
    <bug_when>2012-08-28 14:52:00 +0000</bug_when>
    <thetext>See the rendered view of http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1720

But note that WebKit and Gecko have different behaviours if you document.write *after* the load event; in WebKit/Opera reload reloads the original document, and in Gecko/IE it reloads the string:

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1723 (rendered view)

There are also some incompatibilities in the number of history positions in various cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77709</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-11-01 22:18:41 +0000</bug_when>
    <thetext>In both cases (in Gecko) the content _is_ blown away, though:
   http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1885
   http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1884

Also worth considering:
   http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1886
   http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1887

The above is now specced (diff below).

The weird stuff though is:
   http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=1888
   http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=1889

Specifically, why is the nested onload=&quot;&quot; not firing for 1888, in Gecko?

I&apos;ve not tried to spec Gecko&apos;s behaviour in 1888. Reopen if you think I should.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77710</commentid>
    <comment_count>3</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-11-01 22:18:51 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7497.
Check-in comment: Try to get a little closer to browsers.
http://html5.org/tools/web-apps-tracker?from=7496&amp;to=7497</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78887</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-11-27 04:43:27 +0000</bug_when>
    <thetext>&gt; Specifically, why is the nested onload=&quot;&quot; not firing for 1888, in Gecko?

Because the open() happens during the firing of onload, so isn&apos;t treated as a new load, basically.  It&apos;s somewhat an artifact of how Gecko tracks whether it&apos;s in the middle of a load or not and the checks to prevent reentrant onload firing when onload does open()/close() pairs and other weird stuff like that.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>