Tales from the Evil Empire

Bertrand Le Roy's blog

News

Ads Via DevMavens

ASP.NET AJAX UpdatePanel Control: Add Ajax interactivity to your ASP.NET 2.0 web pages

Add to Technorati Favorites

Blogs I read

My other stuff

Atlas compatibility layer: why did we extend Firefox to implement IE-isms?

Microsoft does not enjoy the best reputation when it comes to respecting standards. So when seeing that Atlas has a compatibility layer that extends Firefox and Safari APIs to implement IE-isms, some have seen it as an attempt to discard the standard.

The reason why Atlas extends Firefox and Safari to implement the IE APIs and not the other way around is in fact purely technical. Firefox and in a lesser extent Safari allow the extension of HTML element prototypes whereas IE does not. Standards have nothing to do with this decision. There is a need to have a consistent API cross-browser to avoid having the rest of the libraries checking for the existence of an API and branching the code all the time. For example, instead of constantly doing if (obj.attachEvent) {obj.attachEvent(...)} else {obj.addEventListener(...)}, we can just do attachEvent and it works cross-browser. We (and the MSN team before us) just chose the simplest possible way to achieve that. The way people used to do it before was to implement helper methods to encapsulate the branching, which if you think about it is not any more standard than what we're doing, it was just introducing a third way to do it in addition to the standard one and to the IE-ism.

I'd like to hear your constructive thoughts about that but please don't see any malice where there is none. ;)

Comments

Scott said:

No malice here. That's what I've been prescribing for some time. Since you can't extend IE, it's best to treat it like the slow child ("yes, IE you can keep using innerText"(pats IE on head)) and have the other browsers implement it's quirks.

It's all about spackling the DOM model sad to say.

http://www.lazycoder.com/weblog/index.php/archives/2005/02/08/adding-innertext-to-mozilla-and-other-browsers/
# April 8, 2006 2:22 PM

TrackBack said:

Ars Technica points to this blog (again). Can't complain...
# April 19, 2006 3:47 AM

ASP.NET Team Blogs said:

It's the second time in just a few days that I see blog comments attack Atlas on its compatibility layer.

# August 1, 2006 2:48 PM

Devil's Advocate said:

Since IE doesn't follow the W3C standard for events: http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/ Wouldn't it have made more sense to provide compatibility scripts for IE to get it up-to-speed with the standard instead of dragging the other browsers down?
# August 15, 2006 12:45 PM

Bertrand Le Roy said:

Devil's advocate: see http://weblogs.asp.net/bleroy/archive/2006/04/13/442815.aspx where I explain that: "why did we extend Firefox and Safari and not IE? Simply because Firefox and in a lesser extent Safari are far more extensible than IE [...] If IE had the same extensibility, we would happily have made it converge to the standard instead of bringing Firefox and Safari to implement the IEisms. We would have absolutely loved that but it's simply not possible."

# August 15, 2006 1:58 PM

More Atlas stuff said:

It's the second time in just a few days that I see blog comments attack Atlas on its compatibility

# September 1, 2006 3:56 AM

Showme said:

MS said SQL Reports will work in Firefox, it doesn't. MS said ClickOnce will work in all browsers, it's IE only. MS said Atlas will work in Firefox, it .... give me a break. (It's not done until Lotus 123 won't run)
# October 1, 2006 8:44 PM

Bertrand Le Roy said:

Showme: I don't know about the other products you mention but Atlas *already* works on Firefox. You can very this yourself as it's a free download.

So yes, MS said Atlas will work in Firefox and it already does.

# October 2, 2006 3:07 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)