Re: typeof document.all

On Oct 13, 2009, at 9:50 AM, Anne van Kesteren wrote:

> On Tue, 13 Oct 2009 12:28:56 +0200, Maciej Stachowiak  
> <mjs@apple.com> wrote:
>> [...]
>
> FWIW, Opera overrides ToBoolean and typeof, similarly to WebKit as I  
> understand things. I skimmed through our bug report on the issue and  
> it seems that nobody was really in favor of what Gecko was doing.

Nobody who? Tasteful engineers may prefer something like what you did,  
especially if they work for Opera :-P.

This is not about art, it's not the Mona Lisa -- it's stinking  
(undetected) document.all!

Anyway, an informal spec-let detailing what Opera does to at least the  
level of detail that Maciej gave would be helpful.


> Violating the ECMAScript specification was apparently much more  
> straightforward, and would not give weird results when assigning  
> document.all to a variable.

We found that necessary for IE-only page compatibility:

https://bugzilla.mozilla.org/show_bug.cgi?id=259935

Does Opera work  correctly (more precisely, did it work correctly  
~2004-2005) on the pages cited in comment 0 of that bug? If so, why?  
It must not have been running the code we were, or else assigning  
document.all to a variable must not have created the collection.


> Or that document.all == undefined is true but document.all ==  
> document.all is false.

Since I already called that a bug and an unintended consequence, let's  
move past it. It was never a requirement for IE-only page  
compatibility and I bet smarties at Opera could figure that out and  
avoid cloning it, assuming they ever did check out what Mozilla code  
does to this level of detail.


> (I also got a comment to the effect that too much time is wasted on  
> document.all, though I personally think it is worthwhile to document  
> how it ought to work given that every browser had to implement it  
> and converged to hiding it.)

It's worth specifying enough for interoperation. It is not worth  
specifying everything, since our code bases do not match on every  
detail including bug for bug compatibility. Diminishing returns is law  
still.

/be

Received on Tuesday, 13 October 2009 18:08:34 UTC