The global object in browsers

Maciej Stachowiak mjs at apple.com
Wed Feb 18 02:17:06 PST 2009


On Feb 17, 2009, at 6:31 PM, Mark Miller wrote:

> On Tue, Feb 17, 2009 at 5:24 PM, Ian Hickson <ian at 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 the grounds that it could not be implemented in a high- 
> performance
> manner. They requested that the spec be changed to match what  
> Mozilla and
> Safari do. What Opera does is known to be incompatible with deployed
> content (they expose Window objects that aren't === to each other).
>
> The browsers all do slightly different things. The HTML5 spec right  
> now is
> a mix of what Gecko and Webkit do.
>
>
> 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 example would return  
> 2.

That would either allow access to new variable bindings to functions  
in old documents from different origins (violating security  
requirements, my constraint 2, from another email) or would require a  
security check for every global variable lookup (violating my  
performance constraint 3).

Regards,
Maciej



More information about the Es-discuss mailing list