This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27419 - 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
Summary: Need to define that document.open() also creates a new Realm and global envir...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Domenic Denicola
QA Contact: contributor
URL: https://html.spec.whatwg.org/#dom-doc...
Whiteboard:
Keywords:
Depends on: 25981
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-24 15:10 UTC by contributor
Modified: 2015-12-15 15:35 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2014-11-24 15:10:34 UTC
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
Comment 1 Ian 'Hixie' Hickson 2014-11-24 18:14:56 UTC
What would a test that distinguishes whether or not we do this look like?
Comment 2 Anne 2014-11-25 10:26:50 UTC
I asked in that thread. Allen confirmed Realm/global/environment are 1:1:1.
Comment 3 Ian 'Hixie' Hickson 2015-04-24 19:37:11 UTC
So I read through that thread, and I don't really understand why this affects HTML. Shouldn't the ES spec take care of maintaining its invariants? HTML shouldn't need to know anything about realms and certainly shouldn't need to know anything about global environment records, surely.
Comment 4 Anne 2015-04-27 06:28:26 UTC
Ideally? Yes! See also bug 25981...
Comment 5 Ian 'Hixie' Hickson 2015-05-05 21:31:40 UTC
Bug 25981 is mostly about plugging into the defined external-facing hooks in the ES6 spec. I don't see how this is an external-facing hook. Global environment records and Realms seem to be internal details of the ES language.
Comment 6 Ian 'Hixie' Hickson 2015-05-05 22:02:38 UTC
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'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't do that here because calling Initialization() manipulates the execution context stack.
Comment 7 Ian 'Hixie' Hickson 2015-05-05 22:33:00 UTC
I meant "Also, how would I...".
Comment 8 Ian 'Hixie' Hickson 2015-05-05 22:49:14 UTC
Actually no, when I create a Window object I don't call Initialization(). That's for creating the event loop. I'm not sure what I do when creating a Window. I'm not sure how I create a Window. InitializeHostDefinedRealm() isn't called by any other algorithm in the JS spec.
Comment 9 Ian 'Hixie' Hickson 2015-05-05 23:23:23 UTC
Ok see bug 25981. I guess I do call Iniitialization even for document.open()?