Friday, July 02, 2010

About Internet Explorer DOM bugs

Almost four year ago I wrote a post http://goo.gl/VKTc in my blog describing incorrect behavior of window.onblur event in IE and a workaround. At that time I tried hardly to submit a bug report to Microsoft, but couldn't find a way to do that. My blog isn't really that popular, but I received numerous thanks from web developers for posting a workaround.

Two years ago I found an article in a famous among .NET developers blog by Rick Strahl http://goo.gl/a4Cy about another very unfortunate Internet Explorer feature: it automatically creates matching global JavaScript objects for all DOM elements on the page based on their id. This clatters global space and often leads to clashes with user-defined JavaScript objects, which often leads to "Object doesn’t support this property or method" errors being displayed.

Recently, thanks to Dimitri Glazkov's buzz about Enhanced Scripting in IE9 http://goo.gl/CO1v I asked the same questions on MSDN IE blog http://goo.gl/Un5g and got a suggestion to submit bug report to Microsoft Connect.

Then I found that someone already submitted "Incorrect behavior of window.onblur event" bug to IE blog http://goo.gl/6HlF. Unfortunately it was marked as "Won't fix" by IE 9 team. So, are we looking for another four years before this bug will be fixed? I doubt Internet Explorer would survive that long.

At least I went ahead and submitted "IE automatically creates matching global JavaScript objects for all DOM elements on the page based on their id" bug http://goo.gl/Eugd on Rick's behalf. Let's see if MS IE team would be willing to fix that.

Want to buzz about it?

An update of 10/19/2010: I got a nice message from Microsoft Connect Team saying the following:

“Greetings from Microsoft Connect!
This notification was generated for feedback item: IE automatically creates matching global JavaScript objects for all DOM elements on the page based on their id. which you submitted at the Microsoft Connect site.

Thank you for your feedback.
This issue was resolved in Internet Explorer 9 Platform Preview Build 3 released on 6/23/2010. Please verify the change and file a new feedback (or reactivate the existing one) if the problem persists.

The fix prevents the error message. Note, IE still allows the DOM element to exist as a global javascript object. (Bold-italic mine, V.K.)

Best regards,
The Internet Explorer Team
Thank you for using Microsoft Connect!”

Well, I’m not sure that keeping DOM elements in global JavaScript namespace is a good idea (other browsers don’t do it), but at least they found a workaround.
It was a first time in my life MS directly communicated to me, that’s nice.