W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2009

Re: Notes from Monday's meeting with TC39 folks

From: Maciej Stachowiak <mjs@apple.com>
Date: Thu, 08 Oct 2009 10:43:34 -0700
Cc: Anne van Kesteren <annevk@opera.com>, Cameron McCormack <cam@mcc.id.au>, public-script-coord@w3.org
Message-id: <EABCBCDA-6A6E-406F-B323-89DC537D6430@apple.com>
To: Brendan Eich <brendan@mozilla.org>

On Oct 8, 2009, at 10:07 AM, Brendan Eich wrote:

>> However that somewhat depends on whether IE keeps support behind a  
>> version switch because then sites might do the X-UA-Compatible  
>> trick and will still work in IE while not in Opera. That'd be  
>> annoying. (I'm not up in the details on which sites rely on this  
>> exactly unfortunately.)
> X-UA-Compatible considered harmful.
> Ok, back to striking a balance between providing better forms that  
> supplant bad older ones, rather than simply codifying (if not  
> building on) bad patterns.
> An idea at the meeting from Mark Miller, you won't be surprised by  
> it, is to make undetected document.all emulation not occur in ES5  
> strict mode ("use strict"). If you opt into ES5 strict mode in your  
> JS, you can't use document.all.
> I like this idea because I don't think new code should use  
> document.all, and old code that does use it is unlikely to be  
> retrofitted with "use strict". There is a risk in coupling to strict  
> mode in this way, turning off legacy misfeatures based on a  
> JavaScript pragma. But it beats adding another opt-in mechanism. And  
> it cleans up JS-level semantics: no magic context-sensitive host- 
> object document.all reification, or ES-spec-violating  
> ToBoolean(document.all) -> false.

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. 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.

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.


Received on Thursday, 8 October 2009 17:44:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:01 UTC