<?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>27419</bug_id>
          
          <creation_ts>2014-11-24 15:10:34 +0000</creation_ts>
          <short_desc>Need to define that document.open() also creates a new Realm and global environment record per https://esdiscuss.org/topic/relationship-between-globals-realms-and-global-environment-records</short_desc>
          <delta_ts>2015-12-15 15:35:54 +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>https://html.spec.whatwg.org/#dom-document-open</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          <dependson>25981</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Domenic Denicola">d</assigned_to>
          <cc>annevk</cc>
    
    <cc>d</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>115390</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-11-24 15:10:34 +0000</bug_when>
    <thetext>Specification: https://html.spec.whatwg.org/multipage/webappapis.html
Multipage: https://html.spec.whatwg.org/multipage/#dom-document-open
Complete: https://html.spec.whatwg.org/#dom-document-open
Referrer: 

Comment:
Need to define that document.open() also creates a new Realm and global
environment record per
https://esdiscuss.org/topic/relationship-between-globals-realms-and-global-env
ironment-records

Posted from: 80.218.216.100 by annevk@annevk.nl
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0) Gecko/20100101 Firefox/36.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115408</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-11-24 18:14:56 +0000</bug_when>
    <thetext>What would a test that distinguishes whether or not we do this look like?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115451</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-11-25 10:26:50 +0000</bug_when>
    <thetext>I asked in that thread. Allen confirmed Realm/global/environment are 1:1:1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119893</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-04-24 19:37:11 +0000</bug_when>
    <thetext>So I read through that thread, and I don&apos;t really understand why this affects HTML. Shouldn&apos;t the ES spec take care of maintaining its invariants? HTML shouldn&apos;t need to know anything about realms and certainly shouldn&apos;t need to know anything about global environment records, surely.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119921</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-04-27 06:28:26 +0000</bug_when>
    <thetext>Ideally? Yes! See also bug 25981...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120101</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-05-05 21:31:40 +0000</bug_when>
    <thetext>Bug 25981 is mostly about plugging into the defined external-facing hooks in the ES6 spec. I don&apos;t see how this is an external-facing hook. Global environment records and Realms seem to be internal details of the ES language.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120112</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-05-05 22:02:38 +0000</bug_when>
    <thetext>Also, would I create a new Realm when I create the new Window anyway?

Normally when I create a Window I do so by invoking ECMAScript&apos;s Initialization(), which calls InitializeHostDefinedRealm(realm) with a new realm that was created for me, and I never even see the environment records. But I can&apos;t do that here because calling Initialization() manipulates the execution context stack.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120113</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-05-05 22:33:00 +0000</bug_when>
    <thetext>I meant &quot;Also, how would I...&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120114</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-05-05 22:49:14 +0000</bug_when>
    <thetext>Actually no, when I create a Window object I don&apos;t call Initialization(). That&apos;s for creating the event loop. I&apos;m not sure what I do when creating a Window. I&apos;m not sure how I create a Window. InitializeHostDefinedRealm() isn&apos;t called by any other algorithm in the JS spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120117</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-05-05 23:23:23 +0000</bug_when>
    <thetext>Ok see bug 25981. I guess I do call Iniitialization even for document.open()?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124433</commentid>
    <comment_count>10</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2015-12-15 15:35:54 +0000</bug_when>
    <thetext>https://github.com/whatwg/html/commit/cf0355d7e0e229b98f7fbd51b8c7608010c787f5</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>