Author: pbr
Date: 2007-12-19 11:16:13 -0800 (Wed, 19 Dec 2007)
New Revision: 7617

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
Log:
Change 20071218-Philip-6 by [EMAIL PROTECTED] on 2007-12-18 16:27:25 EST
     in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/trunk
     for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fixed text size caching in IE7

New Features:

Bugs Fixed: LPP-5176

Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
LzTextSprite.getTextSize() has a cache to save computation, and this cache is 
erased every 1000 entries. The problem is the counter is also zeroed. In IE, 
the tag name includes the counter value and the name cannot be reused without 
generating javascript errors. I think IE is trying to reuse the name, but the 
object has been deleted.

The fix is to never zero the counter. The cache is erased but the counter value 
is set to its old value.


Tests:
Run test in LPP-5176 in IE7/dhtml. Also tested in FF/dhtml.

Files:
M      WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071218-Philip-6.tar



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js       
2007-12-19 19:13:55 UTC (rev 7616)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js       
2007-12-19 19:16:13 UTC (rev 7617)
@@ -267,7 +267,11 @@
         this._styledirty = false;
     }
 
-    if (this._sizecache.counter > this.__sizecacheupperbound) this._sizecache 
= {counter: 0};
+    // Empty the cache when full, but do not reset the counter because
+    // IE holds onto the object.
+    if (this._sizecache.counter > 0 && this._sizecache.counter % 
this.__sizecacheupperbound == 0) {
+        this._sizecache = {counter: this._sizecache.counter};
+    }
     if (this._sizecache[style] == null) this._sizecache[style] = {};
 
     var root = document.getElementById('lzTextSizeCache');


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to