Re: The global object in browsers

2009-07-06 Thread Ian Hickson
On Mon, 6 Jul 2009, Brendan Eich wrote: If we must have split windows in all top browser implementations (so the argument goes), then we must have them in a spec. If not ECMA-262, then HTML5. If split windows, then what |this| binds to (outer or inner) needs to be spec'ed. So here we are.

Re: The global object in browsers

2009-02-21 Thread David-Sarah Hopwood
Ian Hickson wrote: Right now ES3 assumes that there is a single global object, which is used at the top of the scope chain and that is returned for this in the global scope. It is possible to show that this is now what some browsers do: var x = 1; function f() { return x; }

Re: The global object in browsers

2009-02-21 Thread David-Sarah Hopwood
Maciej Stachowiak wrote: On Feb 19, 2009, at 1:20 AM, David-Sarah Hopwood wrote: Ian Hickson wrote: On Tue, 17 Feb 2009, Mark S. Miller wrote: I don't understand. If the object you're calling Window is inaccessible from ES code, and if the object you're calling WindowProxy forwards

Re: The global object in browsers

2009-02-21 Thread Maciej Stachowiak
On Feb 21, 2009, at 1:49 AM, David-Sarah Hopwood wrote: Ian Hickson wrote: Right now ES3 assumes that there is a single global object, which is used at the top of the scope chain and that is returned for this in the global scope. It is possible to show that this is now what some browsers

Re: The global object in browsers

2009-02-21 Thread Maciej Stachowiak
On Feb 20, 2009, at 4:13 PM, David-Sarah Hopwood wrote: Ian Hickson's description of the two objects was: # The global object is a Window object. This object is per-Document. # The object returned by the window attribute on that global object # is actually a WindowProxy object, which forwards

Re: The global object in browsers

2009-02-20 Thread David-Sarah Hopwood
Maciej Stachowiak wrote: On Feb 19, 2009, at 1:39 AM, David-Sarah Hopwood wrote: Ian Hickson wrote: On Tue, 17 Feb 2009, Mark Miller wrote: On Tue, Feb 17, 2009 at 5:03 PM, Ian Hickson i...@hixie.ch wrote: Indeed, I noted this earlier. The behavior HTML5 codifies is the behavior that the

Re: The global object in browsers

2009-02-19 Thread David-Sarah Hopwood
Ian Hickson wrote: On Tue, 17 Feb 2009, Mark Miller wrote: On Tue, Feb 17, 2009 at 5:03 PM, Ian Hickson i...@hixie.ch wrote: Indeed, I noted this earlier. The behavior HTML5 codifies is the behavior that the majority of browser vendors have asked me to codify. Majority, huh? Which vendors?

Re: The global object in browsers

2009-02-19 Thread Ian Hickson
On Thu, 19 Feb 2009, David-Sarah Hopwood wrote: MarkM's point is that *given that the object called Window is inaccessible*, there's no way to observe that the object called Window is at the top of the scope chain. Granted, but there _is_ a way to observe that the object at the top of the

Re: The global object in browsers

2009-02-19 Thread Ian Hickson
On Thu, 19 Feb 2009, David-Sarah Hopwood wrote: Ian Hickson wrote: On Tue, 17 Feb 2009, Mark Miller wrote: On Tue, Feb 17, 2009 at 5:03 PM, Ian Hickson i...@hixie.ch wrote: Indeed, I noted this earlier. The behavior HTML5 codifies is the behavior that the majority of browser vendors have

Re: The global object in browsers

2009-02-19 Thread David-Sarah Hopwood
Brendan Eich wrote: On Feb 17, 2009, at 2:48 PM, Mark Miller wrote: On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: Now, if the other page's script calls f() and g(), it will get different results (2 and 1 respectively, if I didn't screw up the example code). For HTML5,

Re: The global object in browsers

2009-02-19 Thread David-Sarah Hopwood
Ian Hickson wrote: On Thu, 19 Feb 2009, David-Sarah Hopwood wrote: Ian Hickson wrote: On Tue, 17 Feb 2009, Mark Miller wrote: On Tue, Feb 17, 2009 at 5:03 PM, Ian Hickson i...@hixie.ch wrote: Indeed, I noted this earlier. The behavior HTML5 codifies is the behavior that the majority of

Re: The global object in browsers

2009-02-19 Thread Ian Hickson
On Thu, 19 Feb 2009, David-Sarah Hopwood wrote: I think it should matter. The vendors should be asked to give a reason that makes technical sense. That this option could not be implemented in a high-performance manner does not make sense -- which means that it is quite possible that the

Re: The global object in browsers

2009-02-19 Thread Maciej Stachowiak
On Feb 19, 2009, at 1:39 AM, David-Sarah Hopwood wrote: Ian Hickson wrote: On Tue, 17 Feb 2009, Mark Miller wrote: On Tue, Feb 17, 2009 at 5:03 PM, Ian Hickson i...@hixie.ch wrote: Indeed, I noted this earlier. The behavior HTML5 codifies is the behavior that the majority of browser vendors

Re: The global object in browsers

2009-02-19 Thread Maciej Stachowiak
On Feb 19, 2009, at 1:20 AM, David-Sarah Hopwood wrote: Ian Hickson wrote: On Tue, 17 Feb 2009, Mark S. Miller wrote: I don't understand. If the object you're calling Window is inaccessible from ES code, and if the object you're calling WindowProxy forwards everything to your Window, why

RE: The global object in browsers

2009-02-19 Thread Ian Hickson
On Thu, 19 Feb 2009, Allen Wirfs-Brock wrote: Perhaps it would be useful to have a half day (or even full day) session on this general topic at the March F2F. Since Ian is affiliated with an ECMA member he could attend if he chooses and I might get an appropriate IE platform

Re: The global object in browsers

2009-02-18 Thread Maciej Stachowiak
On Feb 17, 2009, at 6:31 PM, Mark Miller wrote: On Tue, Feb 17, 2009 at 5:24 PM, Ian Hickson i...@hixie.ch wrote: Opera, Apple, and Mozilla. The HTML5 spec originally specced what IE does, namely throw an exception when running code whose global object doesn't match the current Window

Re: The global object in browsers

2009-02-18 Thread Maciej Stachowiak
On Feb 17, 2009, at 11:18 PM, Mark Miller wrote: You misunderstood me a bit, but no matter. Now that I better understand the constraints -- thanks! -- what I was trying to say is irrelevant. What I mess. I am at a loss to find anything sensible to recommend. I think that's how most of

Re: The global object in browsers

2009-02-18 Thread Brendan Eich
On Feb 17, 2009, at 11:18 PM, Mark Miller wrote: You misunderstood me a bit, but no matter. Sorry, I couldn't see how to interpret your proposal otherwise. Let me know what I missed if you like. Maciej's right, the object identities practically dictate split windows. I suppose the

RE: The global object in browsers

2009-02-18 Thread Ian Hickson
On Tue, 17 Feb 2009, Allen Wirfs-Brock wrote: Perhaps this would be a good initial W3C HTML WG/ECMA TC-39 joint work item if we can expeditiously get past the bureaucratic hurdles. The fact that there isn't an existing consensus behavior among the major browsers would seem to present an

Re: The global object in browsers

2009-02-18 Thread Brendan Eich
On Feb 18, 2009, at 3:24 PM, Ian Hickson wrote: I'm happy to spec into HTML5 whatever the majority of implementations eventually do (i.e. HTML5 will just track reality, whatever that is), I would hope the same applies to the ES specs. :-) We do try to pave the cowpaths (without giving the

The global object in browsers

2009-02-17 Thread Ian Hickson
Right now ES3 assumes that there is a single global object, which is used at the top of the scope chain and that is returned for this in the global scope. It is possible to show that this is now what some browsers do: var x = 1; function f() { return x; } var global = this;

Re: The global object in browsers

2009-02-17 Thread Mark S. Miller
On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: For HTML5, this behaviour has been defined in more detail. The global object is a Window object. This object is per-Document. The object returned by the window attribute on that global object is actually a WindowProxy object,

Re: The global object in browsers

2009-02-17 Thread Mark Miller
On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: Now, if the other page's script calls f() and g(), it will get different results (2 and 1 respectively, if I didn't screw up the example code). For HTML5, this behaviour has been defined in more detail. The global object is a

Re: The global object in browsers

2009-02-17 Thread Ian Hickson
On Tue, 17 Feb 2009, Mark S. Miller wrote: I don't understand. If the object you're calling Window is inaccessible from ES code, and if the object you're calling WindowProxy forwards everything to your Window, why not just relabel Window - InternalWindow, WindowProxy - Window? I don't

Re: The global object in browsers

2009-02-17 Thread Ian Hickson
On Tue, 17 Feb 2009, Mark Miller wrote: On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: Now, if the other page's script calls f() and g(), it will get different results (2 and 1 respectively, if I didn't screw up the example code). For HTML5, this behaviour has

Re: The global object in browsers

2009-02-17 Thread Brendan Eich
On Feb 17, 2009, at 3:09 PM, Brendan Eich wrote: On Feb 17, 2009, at 2:48 PM, Mark Miller wrote: On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: Now, if the other page's script calls f() and g(), it will get different results (2 and 1 respectively, if I didn't screw up

Re: The global object in browsers

2009-02-17 Thread Garrett Smith
On Tue, Feb 17, 2009 at 2:36 PM, Mark S. Miller erig...@google.com wrote: On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: The deeper problem here is that ES specs to date -- including the draft ES3.1 spec -- have not yet admitted the existence of multiple global objects. We

Re: The global object in browsers

2009-02-17 Thread Maciej Stachowiak
On Feb 17, 2009, at 2:02 PM, Ian Hickson wrote: Right now ES3 assumes that there is a single global object, which is used at the top of the scope chain and that is returned for this in the global scope. It is possible to show that this is now what some browsers do: var x = 1;

Re: The global object in browsers

2009-02-17 Thread Mark Miller
On Tue, Feb 17, 2009 at 3:02 PM, Ian Hickson i...@hixie.ch wrote: Here are some demos. 001 is a control test. If it says false, you have a violation of ES, and are likely incompatible with legacy content. If it says true, then test 002. If 002 says false, then ES is being violated in some

Re: The global object in browsers

2009-02-17 Thread Mark Miller
On Tue, Feb 17, 2009 at 5:03 PM, Ian Hickson i...@hixie.ch wrote: Indeed, I noted this earlier. The behavior HTML5 codifies is the behavior that the majority of browser vendors have asked me to codify. Majority, huh? Which vendors? How does the behavior they ask for correlate with what their

Re: The global object in browsers

2009-02-17 Thread Ian Hickson
On Tue, 17 Feb 2009, Mark Miller wrote: On Tue, Feb 17, 2009 at 5:03 PM, Ian Hickson i...@hixie.ch wrote: Indeed, I noted this earlier. The behavior HTML5 codifies is the behavior that the majority of browser vendors have asked me to codify. Majority, huh? Which vendors? How does the

Re: The global object in browsers

2009-02-17 Thread Brendan Eich
On Feb 17, 2009, at 4:03 PM, ihab.a...@gmail.com wrote: On Tue, Feb 17, 2009 at 3:35 PM, Garrett Smith dhtmlkitc...@gmail.com wrote: That document is not completely readable (at least in Firefox). I see the first heading: roduction. All subsequent headings appear truncted. Rats. Ok, so

Re: The global object in browsers

2009-02-17 Thread Mark Miller
On Tue, Feb 17, 2009 at 5:24 PM, Ian Hickson i...@hixie.ch wrote: Opera, Apple, and Mozilla. The HTML5 spec originally specced what IE does, namely throw an exception when running code whose global object doesn't match the current Window object, but Opera, Apple, and Mozilla rejected this on

Re: The global object in browsers

2009-02-17 Thread Brendan Eich
On Feb 17, 2009, at 6:31 PM, Mark Miller wrote: Now that I think I understand current and how weak the legacy constraints are, why not simply spec that your WindowProxy is the object to treated as the ECMAScript global object? The consequence would be that both f() and g() in your original

RE: The global object in browsers

2009-02-17 Thread Allen Wirfs-Brock
...@mozilla.org [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Brendan Eich Sent: Tuesday, February 17, 2009 3:17 PM To: Mark Miller; Ian Hickson Cc: es-discuss Steen Subject: Re: The global object in browsers On Feb 17, 2009, at 3:09 PM, Brendan Eich wrote: On Feb 17, 2009, at 2:48 PM, Mark Miller

Re: The global object in browsers

2009-02-17 Thread Mark Miller
:* Re: The global object in browsers On Feb 17, 2009, at 3:09 PM, Brendan Eich wrote: On Feb 17, 2009, at 2:48 PM, Mark Miller wrote: On Tue, Feb 17, 2009 at 2:02 PM, Ian Hickson i...@hixie.ch wrote: Now, if the other page's script calls f() and g(), it will get different results

Re: The global object in browsers

2009-02-17 Thread Mark Miller
On Tue, Feb 17, 2009 at 6:38 PM, Brendan Eich bren...@mozilla.com wrote: On Feb 17, 2009, at 6:31 PM, Mark Miller wrote: Now that I think I understand current and how weak the legacy constraints are, why not simply spec that your WindowProxy is the object to treated as the ECMAScript global

Re: The global object in browsers

2009-02-17 Thread Brendan Eich
On Feb 17, 2009, at 8:17 PM, Mark Miller wrote: On Tue, Feb 17, 2009 at 6:38 PM, Brendan Eich bren...@mozilla.com wrote: On Feb 17, 2009, at 6:31 PM, Mark Miller wrote: Now that I think I understand current and how weak the legacy constraints are, why not simply spec that your WindowProxy

Re: The global object in browsers

2009-02-17 Thread Mark Miller
You misunderstood me a bit, but no matter. Now that I better understand the constraints -- thanks! -- what I was trying to say is irrelevant. What I mess. I am at a loss to find anything sensible to recommend. On Tue, Feb 17, 2009 at 9:20 PM, Brendan Eich bren...@mozilla.com wrote: On Feb 17,