History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5347
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: -- --
Assignee: Max Carlson
Reporter: Dan Swaney
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Using IE, browser reports 'no such interface' javascript error when closing or refreshing the window

Created: 10/Jan/08 09:20 AM   Updated: 14/Feb/08 08:53 PM
Component/s: Kernel - DHTML
Affects Version/s: 4.0.6/Jujube, RingDing (4.1)
Fix Version/s: RingDing (4.1)

Time Tracking:
Not Specified

Severity: Major
Fixed in Change#: 8,037
Runtime: N/A
Fix in hand: False


 Description  « Hide
When using Internet Explorer 7...

Error message is:
...A Runtime Error has occurred.
...Do you wish to debug?
...
...Line: 3210
...Error: No such interface supported.

This may be related to the DOM cache that IE uses. After 1000 cache updates, problems occur.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dan Swaney - 10/Jan/08 09:20 AM
Problem is in the 'LzSprite.js' for OpenLaszlo's LFC runtime library.

The function where the problem occurs is:
...... __cleanUpForIE()
...... .... LzSprite.prototype.__discardElement()
...... .... ...
...... .... $2.appendChild( $1 )

$2:
..... id: __LZIELeakGarbageBin
..... innerHTML: "Yq_qy"

$1:
...... innerHTML: '' (two single quotes)

Dan Swaney - 10/Jan/08 09:23 AM
Worked around this by adding check to determine if the element nodeType is 1 (an element node in the HTML)
(See URL for discussion related to this: http://www.codingforums.com/shothread.php?p=342582 )

Snippit below shows changes done to OL 4.0.6 (and similarly to 4.1.x):

[snippit from LzSprite.js]
....
LzSprite.prototype.__discardElement = function (element) {
...if (LzSprite.prototype.quirks.ie_leak_prevention) {
......// Used instead of node.removeChild to eliminate 'pseudo-leaks' in IE - see http://outofhanwell.com/ieleak/index.php?title=Fixing_Leaks
......if( element.nodeType == 1 ) // <<< ELEMENT_NODE Only
......{
.........if (element.owner) element.owner = null;
.........var garbageBin = document.getElementById('__LZIELeakGarbageBin');
.........if (!garbageBin) {
............garbageBin = document.createElement('DIV');
............garbageBin.id = '__LZIELeakGarbageBin';
............garbageBin.style.display = 'none';
............document.body.appendChild(garbageBin);
.........}
.........
.........// move the element to the garbage bin
.........garbageBin.appendChild(element);
.........garbageBin.innerHTML = '';
.........//garbageBin.outerHTML = '';
......}
...} else {
......if (element.parentNode) element.parentNode.removeChild(element);
...}
}
[end snippit]

Dan Swaney - 10/Jan/08 02:59 PM
After further research, there are 12 node types that could exist and be passed in to discardElement().

Should these also be included in the condition about to prevent memory leaks in IE while also preventing the javascript error 'no such interface' from appearing?

For example:
..... if( ( element.nodeType >= 1 ) && ( element.nodeType < 13 ) ) // ensures element is valid node
..... {
..... [ same code as in previous comment]
..... }
..... else
..... {
..... element.innerHTML = '';
..... element = null;
..... }

Max Carlson - 14/Feb/08 08:53 PM
Author: max
Date: 2008-02-14 20:53:11 -0800 (Thu, 14 Feb 2008)
New Revision: 8037

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
Log:
Change 20080214-maxcarlson-9 by maxcarlson@Roboto on 2008-02-14 19:57:57 PST
    in /Users/maxcarlson/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix errors on page reloads in IE DHTML

New Features:

Bugs Fixed: LPP-5347 - Using IE, browser reports 'no such interface' javascript error when closing or refreshing the window

Technical Reviewer: promanik
QA Reviewer: a.bargull@intensis.de
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: Check div.nodeType in discardElement()
    

Tests: See LPP-5347



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2008-02-15 04:00:29 UTC (rev 8036)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2008-02-15 04:53:11 UTC (rev 8037)
@@ -1527,19 +1527,22 @@
     if (LzSprite.prototype.quirks.ie_leak_prevention) {
         // Used instead of node.removeChild to eliminate 'pseudo-leaks' in IE - see http://outofhanwell.com/ieleak/index.php?title=Fixing_Leaks
         //alert('__discardElement' + element);
- if (element.owner) element.owner = null;
- var garbageBin = document.getElementById('__LZIELeakGarbageBin');
- if (!garbageBin) {
- garbageBin = document.createElement('DIV');
- garbageBin.id = '__LZIELeakGarbageBin';
- garbageBin.style.display = 'none';
- document.body.appendChild(garbageBin);
+ if( ( element.nodeType >= 1 ) && ( element.nodeType < 13 ) ) {
+ // ensures element is valid node
+ if (element.owner) element.owner = null;
+ var garbageBin = document.getElementById('__LZIELeakGarbageBin');
+ if (!garbageBin) {
+ garbageBin = document.createElement('DIV');
+ garbageBin.id = '__LZIELeakGarbageBin';
+ garbageBin.style.display = 'none';
+ document.body.appendChild(garbageBin);
+ }
+
+ // move the element to the garbage bin
+ garbageBin.appendChild(element);
+ garbageBin.innerHTML = '';
+ //garbageBin.outerHTML = '';
         }
-
- // move the element to the garbage bin
- garbageBin.appendChild(element);
- garbageBin.innerHTML = '';
- //garbageBin.outerHTML = '';
     } else {
         if (element.parentNode) element.parentNode.removeChild(element);
     }


_______________________________________________
Laszlo-checkins mailing list
Laszlo-checkins@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins