<?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>21875</bug_id>
          
          <creation_ts>2013-04-30 12:23:59 +0000</creation_ts>
          <short_desc>open() doesn&apos;t always produce an insertion point, but write() assumes it does</short_desc>
          <delta_ts>2013-05-28 20:47:16 +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/#document.write()</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>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>87001</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-04-30 12:23:59 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html
Multipage: http://www.whatwg.org/C#document.write()
Complete: http://www.whatwg.org/c#document.write()
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html

Comment:
open() doesn&apos;t always produce an insertion point

Posted from: 98.110.194.206 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:23.0) Gecko/20130419 Firefox/23.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87002</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-04-30 12:27:03 +0000</bug_when>
    <thetext>Specifically, consider this testcase:

  var newDocument = document.implementation.createHTMLDocument( &apos;&apos; );
  newDocument.write( whatever );

In this case, I believe both the ignore-opens-during-unload counter and the ignore-opens-during-unload counter are 0, so step 3 of http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-document-write calls open().  Step 2 of http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-document-ope aborts the steps, since the document is not active.  But write() makes no allowance for that, only for the user refusing for the document to be unloaded, and starts talking about insertion points, which is nonsensical in this case: there is no parser.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87032</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-30 18:17:07 +0000</bug_when>
    <thetext>Should document.write() just abort on non-active documents? document.open() does, it seems like an oversight that document.write() doesn&apos;t.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87035</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-04-30 18:26:49 +0000</bug_when>
    <thetext>That would make sense to me, yes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88291</commentid>
    <comment_count>4</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-05-28 20:47:16 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7869.
Check-in comment: Make document.write() a no-op on non-active documents.
http://html5.org/tools/web-apps-tracker?from=7868&amp;to=7869</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>