Re: Notes from Monday's meeting with TC39 folks

On Oct 8, 2009, at 11:26 AM, Brendan Eich wrote:

> On Oct 8, 2009, at 10:43 AM, Maciej Stachowiak wrote:
>
>> At first glance, I'm not keen on the idea of making DOM API  
>> behavior depend on ES5 strict mode. Strict and non-strict code can  
>> mix freely, so to do the mode switching you have to know what kind  
>> of code is calling you - that seems yucky to implement and goes  
>> beyond the intent of strict mode that nearly all of its effects can  
>> happen at compile time.
>
> For our "detecting context" that makes document.all not appear to be  
> present when tested by if, ?:, &&, etc., as opposed to your always- 
> present but falsy object, compile-time is the right time. Just  
> noting this difference.

When testing in Firefox 3.5, I also noticed that document.all returns  
undefined in a variable assignment or an object initializer, e.g.

var x = document.all;
var y = {all: document.all};
document.write(document.all);
document.write(x);
document.write(y.all);

You get one all collection and two undefineds.

>
>
>> Also, affecting DOM APIs seems like major scope creep for strict  
>> mode. Right now, WebKit's DOM APIs have no idea what kind of code  
>> is calling them and I don't relish adding that functionality.
>
> Ok, good feedback. Thanks.
>
>
>> By contrast, document-level quirks mode vs. standards mode is a  
>> single global switch for the whole document. So it's much easier to  
>> implement the switching and verify that its correct. If we need to  
>> have switchable DOM API behavior, I'd rather base it on HTML  
>> standards vs. quirks rather than ES strict vs. non-strict.
>
> Are you open to making undetected-document.all emulation depend on  
> an HTML standards vs. quirks mode switch?

I think that would be a reasonable option, if that's enough to get the  
bulk of the compatibility benefit and if other implementors are on  
board.

> Probably we should move now to public-html, if there is no WebIDL  
> angle to any of this.

Sounds good to me.

Regards,
Maciej

Received on Thursday, 8 October 2009 18:39:38 UTC