SubscribeRSS Feed

document.all and Opera

The Desktop team today released a new snapshot of Opera 9.5 beta containing some pretty significant changes to Opera’s handling of document.all.

From the Desktop team blog:

“Too many sites check for support of document.all and assume that the browser is Internet Explorer. As a result, they often give Opera code that is designed only to work with Internet Explorer’s bugs, which Opera does not have. If they fail to detect it, they use standards compliant code instead, which would work with Opera.

“Occasionally, sites use document.all correctly without testing if it exists, and without providing a standards-based approach, which is why we added document.all support in the first place. Cloaking will cause the first case to use the standards approach, while allowing the second to continue to function.

Opera’s new cloaking behavior of document.all follows that of Firefox and Safari. Hopefully with this change, many of the webpages containing legacy code will start giving Opera the same code as Firefox, rather than of the buggy IE.

Opera’s JavaScript guru, Hallvord Steen, wrote about it in his blog today. He provides a bit of background to the obsolete document.all and its successors document.getElementById and getElementsByTagName.

Update: I should point out that the change of Opera’s handling of document.all is still experimental at this point. The Desktop team is looking for your feedback on this; let them know if this change breaks any sites in Opera.

If you enjoyed this post, then make sure you subscribe to my RSS Feed.




9 Comments

  1. 1 GT500

    A good addition to Opera. It probably should have been done in Merlin as well, but it’s still better late than never.

    Pass on my thanks to Opera’s devs for implementing this (even if it doesn’t directly affect me).

  2. 2 David Naylor

    I don’t really understand this document.all business but this all sounds good. :)

  3. 3 Gongo

    Albeit i’ve seen some slowdown in the last build

  4. 4 lolcat

    “We don’t do quite what Safari or Mozilla do either” (quote from Hallvors blog)

    why? why create another minority group that for sure is going to be completly ignored instead of jumping the firefox bandwagon?

  5. 5 loldog

    Because maybe Firefox isn’t the be all end all Überbrowser? Maybe it can be done better than Firefox?

  6. 6 GT500

    Good response. ;)

  7. 7 Berend Ytsma

    As far as I understand. this metod is an experiment to see if opera’s
    way can make more site send right code, and if this experiment would fail.
    Then there’s always the Safari or/and Firefox way, AFAIS this could be a win win situation.

    But I can’t understand how cloaking document.all allows site that need document.all to use it.
    is this on the principle that if a site needs it, it’s just there, even when You can’t see it, and what if a site tries to detect it, can it be found then?

  8. 8 Ayush

    @Berend Ytsma
    But I can’t understand how cloaking document.all allows site that need document.all to use it.
    See http://www.mozillazine.org/talkback.html?article=5063

  9. 9 j_sk

    These are rather good news.
    Keep shining.