Author: ptw
Date: 2008-01-03 11:05:46 -0800 (Thu, 03 Jan 2008)
New Revision: 7719
Modified:
openlaszlo/branches/wafflecone/
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzCSSStyle.js
Log:
Change 20080103-ptw-I by [EMAIL PROTECTED] on 2008-01-03 13:01:08 EST
in /Users/ptw/OpenLaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Merged revisions 7717 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/trunk
QA Reviewer: mamye (pending)
Details:
.......
r7717 | ptw | 2008-01-03 12:57:35 -0500 (Thu, 03 Jan 2008) | 24 lines
Change 20080103-maxcarlson-H by [EMAIL PROTECTED] on 2008-01-03 00:01:55 PST
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix memory leaks for CSS-styled elements
New Features:
Bugs Fixed: LPP-5321 - Serious memory leak for CSS styled nodes
Technical Reviewer: ptw
QA Reviewer: mdemmon
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Attach style caches to the relevant nodes, instead of keeping global
copies. This way, they're destroyed along with the nodes.
Tests: See LPP-5321. /trunk/test/style/metasuite.lzx continues to pass.
.......
Property changes on: openlaszlo/branches/wafflecone
___________________________________________________________________
Name: svnmerge-integrated
-
/openlaszlo/branches/legals:1-5746,5748-5756,5758-5770,5772-5819,5821-5860,5862-5890,5892-6065,6068-6177,6179-6228,6230-6236,6241-6266
/openlaszlo/trunk:1-3892,3894-3952,3954-4393,4395-4461,4463-4467,4469-4471,4473-5085,5087-5171,5173-5203,5205-5209,5211-5331,5333-5334,6484-6485,6487,6490-6492,6494-6495,6497,6500-6502,6504-6505,6507-6520,6531-6532,6534-6538,6540-6547,6549,6551-6558,6560-6567,6569-6581,6583-6586,6588,6590-6607,6610-6611,6613-6622,6624-6629,6632-6636,6638-6639,6641-6642,6646-6648,6653,6656-6663,6665-6669,6671-6683,6685-6686,6688-6706,6708-6715,7237,7489-7491,7494,7497-7498,7500-7521,7523-7527,7529,7531-7538,7540-7545,7547-7549,7551-7560,7563-7570,7572-7575
+
/openlaszlo/branches/legals:1-5746,5748-5756,5758-5770,5772-5819,5821-5860,5862-5890,5892-6065,6068-6177,6179-6228,6230-6236,6241-6266
/openlaszlo/trunk:1-3892,3894-3952,3954-4393,4395-4461,4463-4467,4469-4471,4473-5085,5087-5171,5173-5203,5205-5209,5211-5331,5333-5334,6484-6485,6487,6490-6492,6494-6495,6497,6500-6502,6504-6505,6507-6520,6531-6532,6534-6538,6540-6547,6549,6551-6558,6560-6567,6569-6581,6583-6586,6588,6590-6607,6610-6611,6613-6622,6624-6629,6632-6636,6638-6639,6641-6642,6646-6648,6653,6656-6663,6665-6669,6671-6683,6685-6686,6688-6706,6708-6715,7237,7489-7491,7494,7497-7498,7500-7521,7523-7527,7529,7531-7538,7540-7545,7547-7549,7551-7560,7563-7570,7572-7575,7717
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
2008-01-03 18:33:24 UTC (rev 7718)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
2008-01-03 19:05:46 UTC (rev 7719)
@@ -290,6 +290,10 @@
/** @access private */
var __LZUID = null;
/** @access private */
+var __LZPropertyCache = null;
+/** @access private */
+var __LZRuleCache = null;
+/** @access private */
var __LZdelegates = null;
var defaultattrs = { $hasdefaultattrs : true };
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzCSSStyle.js
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzCSSStyle.js
2008-01-03 18:33:24 UTC (rev 7718)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzCSSStyle.js
2008-01-03 19:05:46 UTC (rev 7719)
@@ -1,6 +1,6 @@
/**
*
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @affects lzcssstyle lzcssstylerule
@@ -80,11 +80,6 @@
return csssd;
}
-/** @access private */
-LzCSSStyle.__LZRuleCache = {};
-LzCSSStyle.__LZPropertyCache = {};
-
-
//LzCSSStyle.time1 = 0;
LzCSSStyle.getPropertyValueFor = function ( initialnode , pname ){
//Debug.warn("node: %w, pname: %w, rules: %w\n", node, pname, this._rules);
@@ -94,11 +89,14 @@
var node = initialnode;
while (node != canvas) {
- var uid = node.__LZUID;
- var val = this.__LZPropertyCache[uid + pname];
- if (val != null) return val;
+ if (! node.__LZPropertyCache) {
+ node.__LZPropertyCache = {};
+ } else {
+ var val = node.__LZPropertyCache[pname];
+ if (val != null) return val;
+ }
- var rules = this.__LZRuleCache[ uid ];
+ var rules = node.__LZRuleCache;
if ( !rules ) {
rules = new Array();
var r;
@@ -211,7 +209,7 @@
rules.sort(this.__compareSpecificity);
- this.__LZRuleCache[ uid ] = rules;
+ node.__LZRuleCache = rules;
}
//Debug.write("About to print rule array.")
@@ -223,7 +221,7 @@
var props = rules[i++].properties;
if (pname in props) {
val = props[pname];
- this.__LZPropertyCache[uid + pname] = val;
+ node.__LZPropertyCache[pname] = val;
break;
}
}
@@ -248,7 +246,7 @@
// Go through all the selectors in the selector, keeping a running
// count of various kinds of selectors:
/*
- count 1 if the selector is a ’style’ attribute rather than a selector,
+ count 1 if the selector is a `style` attribute rather than a selector,
0 otherwise (= a)
count the number of ID attributes in the selector (= b)
count the number of other attributes and pseudo-classes in the selector (=
c)
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins