W3C home > Mailing lists > Public > public-html@w3.org > October 2009

Re: typeof document.all

From: <hallvord@opera.com>
Date: Tue, 13 Oct 2009 21:16:35 +0000
Message-ID: <20091013211635.2knngs8uqx6os48s@staff.opera.com>
To: Brendan Eich <brendan@mozilla.org>
Cc: Anne van Kesteren <annevk@opera.com>, Maciej Stachowiak <mjs@apple.com>, HTML WG <public-html@w3.org>
Siterer Brendan Eich <brendan@mozilla.org>:

>>> How is that not what you called a "weird result"? It's similar to   
>>> what we do in assigning undefined, i.e., treating assignment as   
>>> "detecting".
>> Having the object evaluate to false does not seem so weird to me.

Just chiming in to confirm what Anne said (for proof and reference I  
attach a somewhat enhanced demo file we used to compare our doc.all  
cloaking and support to other implementations).

I didn't quite understand the comment about "treating assignment as  
'detecting'" because we do no such thing.

> Let me get this straight: the only cases where Opera evaluates
> document.all to false are cases in ECMA-262 that apply the ToBoolean
> internal helper. Otherwise it evaluates to a collection.

While I haven't looked up ToBoolean in 262 now to confirm, this sounds  
exactly right.

We seem to have gotten away without more magic, compatibility-wise. I  
looked through your Google code searches. Two things look like they  
are broken - you already pointed out one:


but the rest generally should work, either because the script uses IE  
APIs we already choose to support (i.e. attachEvent()) or because  
document.all usage is part of a larger browser sniffing approach that  
also handles Opera.

Hope this helps, Brendan. Let's un-ping Chris (who is back but working  
on other stuff) ;-)

- Hallvord R.

Received on Tuesday, 13 October 2009 21:17:15 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:52 UTC