!document.all == true
Friday, January 25, 2008 2:22:58 PM
Just about one year later, W3C's DOM1 specification gave us two methods that made document.all obsolete, document.getElementById and getElementsByTagName. But as usual web developers had to cater for the browsers people use - and for several years onwards that meant using document.all to keep things working in IE4. We're still stuck with hundreds of thousands of legacy pages using it.
When Opera started working on implementing the DOM standard (getElementsByTagName is available since Opera 5, released in December 2000) and we all eagerly looked forward to seeing dynamic menus and fancy scripting stuff start working, it soon became pretty obvious that much of the DHTML content of the day built on document.all. So it was implemented - first as a sort of hack when we identified as IE, later always enabled.
Sometimes supporting document.all caused problems. It still does. We go through IE branches when we would rather run the standards-compatible ones. I guess Mozilla learnt from our problems when they implemented document.all some four years later. Mozilla implemented it with a twist: document.all would be there, but invisible - you couldn't test for it and decide to go down the IE branch of a script. Making an object "invisibly" present isn't possible by the ECMA-262 spec, so it is a sort of standards violation to do so - quoting developer Lars Thomas Hansen:
it requires support directly from the ecmascript engine for a non-null non-undefined non-constant object value whose boolean value is false. It's doable, and probably not too expensive, but its existence directly contradicts section 9.2 of ES-262, which requires every object value to be converted to "true"
- but apparently it has worked well for both Firefox and Safari.
In the latest snapshot of Opera 9.5 you can play with Opera's new "undetectable document.all" support. It's a BIG experiment that will change the behaviour of millions of scripts all over the web. We don't do quite what Safari or Mozilla do either, and of course we'll have to figure out whether this change improves or damages compatibility with web content in general. That's where you come in - please use this build for daily browsing if you can, we need as much testing mileage for this as practically possible.
Feedback on JavaScript problems specific to this build welcome in the desktopteam blog, in comments below or as bug reports!









James Justin HarrellHeroreV # Friday, January 25, 2008 8:44:14 PM
In both Firefox quirks mode and Opera 9.5, the test for ("all" in document) is true. I know the "in" operator isn't used very much, but If Opera is going to differ from Firefox, it might as well do a better job of hiding document.all than Firefox does.
porneL # Friday, January 25, 2008 8:47:23 PM
Magnus KristiansenDashiva # Friday, January 25, 2008 9:50:07 PM
João EirasxErath # Friday, January 25, 2008 9:52:36 PM
Kamaleshkamalesh # Friday, January 25, 2008 9:55:51 PM
I'm having good luck with Build 4622 in my daily browsing, except for a couple sites I'll note at the ODT blog.
Can you explain for us any ramifications of cloaking document.all relating to user-agent strings that Opera changes for a few sites like WSJ.com and MSNBC.com...??
<porneL> just asked also, I think.
Hallvord R. M. Steenhallvors # Friday, January 25, 2008 10:15:59 PM
kamalesh: document.all basically doesn't relate to user-agent strings at all, except that some scripts use it to "detect" IE in a simpler way than parsing the user-agent string.
Linux_FanZibi1981 # Friday, January 25, 2008 11:35:30 PM
I'm using Opera (downloaded as a shared qt rpm-file) 9.5 Beta 2 build 1772 on Mandriva 2008.0. The top of the site seems messed up.
scipio # Saturday, January 26, 2008 10:51:37 AM
Originally posted by hallvors:
Any details on the differences?MyOpera team, please fix this!fearphage # Saturday, January 26, 2008 7:59:41 PM
returns a true value in opera: "[object HTMLCollection]"
It would be beneficial if there was no incarnation of document.all that could return a true value. It would also be sensible to hide it until masked as IE or in quirksmode as suggested.
João EirasxErath # Saturday, January 26, 2008 9:08:51 PM
nah.. it's return's an object which always evaluates to false, but toString returns what you see.
MyOpera team, please fix this!fearphage # Sunday, January 27, 2008 2:32:57 AM
Hallvord R. M. Steenhallvors # Sunday, January 27, 2008 9:56:00 AM
Hallvord R. M. Steenhallvors # Sunday, January 27, 2008 10:03:48 AM
http://www.mandrivaclub.pl/forum/templates/strefa/rekl.js . Actually it's a typical example of a sniffer that will now return a different result (and a fairly braindead sniffer at that, since it first "detects" us as Opera, then proceeds to overwrite that result by "detecting" either IE, Netscape or Mozilla..). I don't have time to investigate the problems right now but will follow up.
João EirasxErath # Monday, January 28, 2008 1:24:57 AM
Stan Sykesmetcomm # Monday, January 28, 2008 12:12:15 PM
Constantineblaberus # Wednesday, January 30, 2008 2:30:46 PM
a Russian site about Opera with the same news looks odd now ))
http://forum.myopera.net/showflat.php?Cat=&Board=newsuser&Number=37654
MyOpera team, please fix this!fearphage # Wednesday, January 30, 2008 3:18:25 PM
JoeGoJoeGo # Wednesday, January 30, 2008 5:56:07 PM
Mark 'Tarquin' Wilton-Jonestarquinwj # Wednesday, January 30, 2008 7:26:48 PM
Originally posted by hallvors:
They do, and because they use repeated "if" instead of "else if", they now detect Opera as "MO" instead of "OP". However, that function never gets used, so the browser version is always undefined, no matter what browser you use. Must be something else for us to look into
Edit:
Got it. Known issue. Already fixed in core. Extra } in one of the stylesheets causes the rest of it to be ignored.
MyOpera team, please fix this!fearphage # Thursday, January 31, 2008 12:03:25 AM
JoeGoJoeGo # Thursday, January 31, 2008 3:35:07 PM
Linux_FanZibi1981 # Saturday, February 2, 2008 10:11:17 AM
MyOpera team, please fix this!fearphage # Monday, February 4, 2008 7:47:06 PM
@Hallvord: Any chance that window.opera will be cloaked when masking as FF/IE?
Hallvord R. M. Steenhallvors # Monday, February 4, 2008 10:40:46 PM
We don't currently plan to hide window.opera either. I should probably have a look and try to find sites where that might make a difference.
MyOpera team, please fix this!fearphage # Tuesday, February 5, 2008 1:05:18 AM
shaver # Tuesday, February 5, 2008 6:35:35 PM
Hallvord R. M. Steenhallvors # Wednesday, February 6, 2008 12:51:51 PM
I'll be a bit more detailed on what exactly we do (and what Mozilla/Safari appear to do) in the future when I know if our implementation will stay what it is.