This project is archived and is in readonly mode.

#428 ✓resolved
Daniel Steigerwald

fix for new Document ie leak fix

Reported by Daniel Steigerwald | October 16th, 2008 @ 03:25 AM | in 2.0 (closed)

Current master document native has leak-fix for IE. This fix is only aimed for Internet Explorer. But it relies on -> document.window property, which is defined by window native. So you have to instantiate window at first, even you only want to work with mooed document only. Fix is easy, just to change doc.window -> doc.parentWindow.


var Document = new Native({

	name: 'Document',

	legacy: (Browser.Engine.trident) ? null: window.Document,

	initialize: function(doc){
		$uid(doc);
		doc.head = doc.getElementsByTagName('head')[0];
		doc.html = doc.getElementsByTagName('html')[0];
		if (Browser.Engine.trident4) $try(function(){
			doc.execCommand("BackgroundImageCache", false, true);
		});
		if (Browser.Engine.trident) doc.parentWindow.attachEvent('onunload', function() {
			doc.parentWindow.detachEvent('onunload', arguments.callee);
			doc.head = doc.html = doc.window = null;
		});
		return $extend(doc, Document.Prototype);
	},

	afterImplement: function(property, value){
		document[property] = Document.Prototype[property] = value;
	}

});

Comments and changes to this ticket

  • batman42ca

    batman42ca March 31st, 2009 @ 03:14 PM

    I don't know what you mean by "So you have to instantiate window at first, even you only want to work with mooed document only"

    But, I'm getting an error that seems related to this using moo-1.2.1 with IE6.

    Line 425: "'doc.window' is null or not an object"

    I haven't yet figured out what makes the moo enabled web page that is reporting this any different from any other moo enabled web page I created that isn't reporting this error.

  • batman42ca

    batman42ca March 31st, 2009 @ 03:34 PM

    Just figured out what I did wrong to cause this error for me. I was including mootools twice. Once I fixed that, the problem went away.

  • fakedarren

    fakedarren February 8th, 2010 @ 05:34 PM

    • State changed from “new” to “open”

    Valerio - yes / no ?

  • Christoph Pojer

    Christoph Pojer April 16th, 2011 @ 10:08 AM

    • State changed from “open” to “resolved”
    • Milestone order changed from “0” to “0”

Create your profile

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

Shared Ticket Bins

Pages