IE9 does not pick up an overwrite of fireEvent on Element.prototype - by cpojer

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

ID 595944 Comments
Status Closed Workarounds
Type Bug Repros 3
Opened 9/7/2010 5:23:16 PM
Access Restriction Public


Expected Output (See for example Chrome 6): "Test", "FireEvent"
Current Behavior in IE9: "Test"


Use case: MooTools overwrites the native fireEvent method in IE. The bug mentioned above breaks MooTools 1.2

We are going to rename this method eventually but we must provide compatibility for our users.
Sign in to post a comment.
Posted by Microsoft on 5/4/2011 at 9:01 AM
Thank you for your feedback.

This issue was resolved in Internet Explorer 9 Platform Preview Build released on 10/28/2010. Please verify the change and file a new feedback (or reactivate the existing one) if the problem persists.

Best regards,

The Internet Explorer Team
Posted by John-David Dalton [MSFT] on 9/14/2010 at 8:43 AM
Actually this may not be a bug. After getting more info on it this is what I found out.
IE8 does not have the HTMLElement constructor. So modding Element.prototype.fireEvent is reflected on elements like document.body. However in IE9 HTMLElement exists and HTMLElement.prototype has its own fireEvent. Modding Element.prototype.fireEvent won't cause a change to document.body because it inherits HTMLElement's fireEvent method instead.
Posted by Microsoft on 9/13/2010 at 3:03 PM
Thank you for your feedback.

We were able to reproduce the issue and are investigating it.

Best regards,

The Internet Explorer Team
Posted by John-David Dalton [MSFT] on 9/8/2010 at 1:31 PM
*By should not error, I meant should be allowed to overwrite.
Posted by John-David Dalton [MSFT] on 9/8/2010 at 1:29 PM
After thinking about this for a while I remembered this blog post (scroll down to the "Native JavaScript Integration" section)

Because IE9 is basing its DOM on ES5 then overwriting a method on a prototype should not error.
Posted by John-David Dalton [MSFT] on 9/8/2010 at 7:50 AM
There are other bugs in MooTools 1.2.x that prevent IE9 from working and they come down to a similar issue of incorrectly assuming a certain behavior will work. Host objects should not be trusted. Simply accessing a property on them could throw an error. For more info check out this ticket

I know I am not the only one that thinks it's a very bad idea for browsers to cater to poorly programmed JavaScript. The IE team is currently giving PrototypeJS special treatment and I think that is nuts.

As with Prototype, MooTools users can use IE's compatibility modes to ensure support for MooTools pre 1.3: