Author: ptw
Date: 2007-12-06 10:55:56 -0800 (Thu, 06 Dec 2007)
New Revision: 7471

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs
Log:
Change 20071206-ptw-h by [EMAIL PROTECTED] on 2007-12-06 07:52:27 EST
    in /Users/ptw/OpenLaszlo/ringding-2
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Correct CSS color heuristic

Bugs Fixed:
LPP-5167 'DHTML setResource error tickled by lzmail'

Technical Reviewer: [EMAIL PROTECTED] (pending)
QA Reviewer: [EMAIL PROTECTED] (pending)

Details:
    Heuristic for detecting use of '0xNNNNNN' as a color in CSS was
    incorrectly converting an empty string to `0` (leading to havoc).
    Be much more careful with this heuristic.

Tests:
    smokecheck, lzmail now gets past this error



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs    2007-12-06 17:58:46 UTC 
(rev 7470)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs    2007-12-06 18:55:56 UTC 
(rev 7471)
@@ -540,7 +540,7 @@
         // This is a hack because people want to give color styles as
         // Ox... which is not valid CSS, so they pass it as a string.
         // They really should be using #...
-        if ((typeof v == 'string') && (! isNaN(v))) {
+        if ((typeof v == 'string') && (v.length > 2) && (v.indexOf('0x') == 0) 
&& (! isNaN(v))) {
             if ($debug) {
                 Debug.warn("Invalid CSS value for %w.%s: `%#w`.  Use: 
`#%06x`.", this, k, v, Number(v));
             }


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

Reply via email to