<?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>17869</bug_id>
          
          <creation_ts>2012-07-18 07:09:15 +0000</creation_ts>
          <short_desc>Spec for document.open() doesn&apos;t match reality when the parser is script-created</short_desc>
          <delta_ts>2013-03-15 22:41:43 +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></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>hsivonen</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>70208</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 07:09:15 +0000</bug_when>
    <thetext>This was was cloned from bug 17077 as part of operation convergence.
Originally filed: 2012-05-16 11:20:00 +0000
Original reporter: Henri Sivonen &lt;hsivonen@iki.fi&gt;

================================================================================
 #0   Henri Sivonen                                   2012-05-16 11:20:04 +0000 
--------------------------------------------------------------------------------
http://www.whatwg.org/specs/web-apps/current-work/#dom-document-open says, in part:

&quot;If the document has an active parser that isn&apos;t a script-created parser, and the insertion point associated with that parser&apos;s input stream is not undefined (that is, it does point to somewhere in the input stream), then the method does nothing. Abort these steps and return the Document object on which the method was invoked.&quot;

AFAICT, the part &quot; that isn&apos;t a script-created parser&quot; is bogus per the behavior of Firefox (tested trunk), Chrome (tested dev), Opera (tested Next) and IE (tested 9).

See these demos:
http://hsivonen.iki.fi/test/moz/document-open-during-network-parse.html
http://hsivonen.iki.fi/test/moz/document-open-during-script-created-parse.html

(Aside: It seems that the spec sides with WebKit and Presto rather than Gecko and Trident on the &quot; and return the Document object on which the method was invoked&quot; point.)
================================================================================
 #1   Ian &apos;Hixie&apos; Hickson                             2012-06-21 06:36:11 +0000 
--------------------------------------------------------------------------------
I wonder why I wrote that then. Weird.
================================================================================</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74827</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-09-28 19:12:29 +0000</bug_when>
    <thetext>http://www.hixie.ch/tests/adhoc/dom/level0/document/open/005.html is the test that led to the current text. It shows that document.open() does work while you&apos;re in a script-created parser.

But I guess this means this should be defined differently. Is it just that while the script nesting level is greater than zero (i.e. script is invoked from parser) you ignore document.open()?

(Regarding the return value, please file a separate bug if you want that changed.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84491</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-03-15 22:41:43 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7757.
Check-in comment: Try to define when document.open() doesn&apos;t work more precisely.
http://html5.org/tools/web-apps-tracker?from=7756&amp;to=7757</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>