This project is archived and is in readonly mode.

#1010 ✓resolved
Michael McWilliam

Element.clean() throws exception on object tags in IE 8 on Windows 7

Reported by Michael McWilliam | September 17th, 2010 @ 07:31 PM | in 1.3.0 rc2 (closed)

Environment: Windows 7 Ultimate 64-bit

Browser: Internet Explorer 8.0.7600.16385 32-bit


Issue

Element.clean() has a special block of code for object tags. This block throws an "Element not found." runtime error when trying to clean an ActiveX object on the above environment. I have been able to reproduce this with a number of VMs.

    for (var p in item){
      if (typeof item[p] == 'function') item[p] = $empty;
    }
    Element.dispose(item);

item in the above code at the time of the error is the ActiveX object tag DispHTMLObjectElement, the attribute it is trying to access is useMap. useMap is the third last attribute to be cleaned (leaving only vspace and width left) in my case. Element.clean() is being called through a call to Element.empty() on a div element containing the ActiveX object.


Repo

I have tried to reproduce on other versions of Windows with IE 8, but the error only seems to occur under Windows 7.

  1. Create HTML to load an ActiveX object inside of a div.
  2. Empty the div of its contents using the .empty() method.

Notes: The empty must be on domready or load, and the ActiveX control must have successfully loaded. This error does not occur before the COM object is initialized.


The quick fix

Wrap the for loop in a try statement.

    try {
      if ((/object/i).test(item.tagName)){
        for (var p in item){
          if (typeof item[p] == 'function') item[p] = $empty;
        }
        Element.dispose(item);
      }
    } catch(e) {}

Comments and changes to this ticket

  • Christoph Pojer

    Christoph Pojer September 21st, 2010 @ 01:53 PM

    • Milestone set to 1.3.0 rc2
    • State changed from “new” to “resolved”
    • Assigned user set to “Christoph Pojer”
    • Milestone order changed from “799” to “0”

    Thank you for your report. This is fixed in MooTools Core 1.3.

    Feel free to try it out with MooTools Core 1.3 ( clone http://github.com/mootools/mootools-core - initialize the submodules and run ./build ) and report back if the bug is indeed not fixed.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages