[Laszlo-checkins] r13839 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml

ptw@openlaszlo.org ptw at openlaszlo.org
Fri May 8 13:29:40 PDT 2009


Author: ptw
Date: 2009-05-08 13:29:38 -0700 (Fri, 08 May 2009)
New Revision: 13839

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
Log:
Change 20090508-ptw-N by ptw at dueling-banjos.home on 2009-05-08 16:15:18 EDT
    in /Users/ptw/OpenLaszlo/trunk-2
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Turn off CSSDimension warning

Bugs Fixed: LPP-8088  DHTML: many warnings from applyConstraintMethod()

Technical Reviewer: max (Message-ID: <4A0494B7.7010800 at laszlosystems.com>)
QA Reviewer: hminsky (pending)

Details:
    Just comment out the warning.  It is triggered too often by the
    random order constraints are evaluated in.

Tests:
    text case from the bug no longer warns



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js	2009-05-08 20:21:59 UTC (rev 13838)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js	2009-05-08 20:29:38 UTC (rev 13839)
@@ -879,20 +879,26 @@
 }
 
 LzSprite.prototype.CSSDimension = function (value, units) {
-    // Coerce +/- infinity, NaN
-    var result = value; 
-    if (isNaN(value)) { 
-        result = 0; 
-    } else if (value === Infinity) { 
-        result = (~0>>>1); 
-    } else if (value === -Infinity) { 
-        result = ~(~0>>>1); 
-    } 
-    if ($debug) { 
-        if (value !== result) { 
-            Debug.warn("%w: coerced %w to %w", arguments.callee, value, result); 
-        }
+    // Coerce +/- infinity, NaN.  For compatibility with swf runtimes,
+    // NaN is treated as 0.  For compatibility with DHTML runtimes,
+    // Infinity is treated as the largest possible integer value (as
+    // implied by the bit operators).
+    var result = value;
+    if (isNaN(value)) {
+        result = 0;
+    } else if (value === Infinity) {
+        result = (~0>>>1);
+    } else if (value === -Infinity) {
+        result = ~(~0>>>1);
     }
+    // NOTE: [2009-05-08 ptw] Triggers too many warnings due to
+    // contraints running in random order and picking up `undefined`
+    // as a value in a numeric expression, which casts to NaN
+//     if ($debug) {
+//         if (value !== result) {
+//             Debug.warn("%w: coerced %w to %w", arguments.callee, value, result);
+//         }
+//     }
 
     return Math.round(result) + (units ? units : 'px');
 }



More information about the Laszlo-checkins mailing list