Author: ben
Date: 2007-08-03 14:00:47 -0700 (Fri, 03 Aug 2007)
New Revision: 5924

Modified:
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzCSSStyle.js
   openlaszlo/branches/wafflecone/test/style/resource/resource-not-found.lzx
Log:
Change 20070803-ben-e by [EMAIL PROTECTED] on 2007-08-03 12:56:12 PDT
    in /Users/ben/src/svn/openlaszlo/branches/wafflecone
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Issue a runtime warning if the result of a $style lookup is null or 
undefined

New Features:

Bugs Fixed: LPP-3024 If a css'd resource is not found, an error or warning 
should be issued

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

Documentation:
If the developer creates a style constraint, and that constraint evaluates to 
null, they've probably made an error. Therefore, in debug mode,
we give runtime warnings. For speed, we don't do this check when running
in non-debug mode. 

Release Notes:

Details:
    

Tests:
http://localhost:8080/wafflecone/test/style/resource/main.lzx
We get this warning: 
WARNING: got null for CSS property lookup for  nostyledefined 
which is the warning requested by the bug reporter. 
(Note that this test file sets itself to run in debug mode.)
 


Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzCSSStyle.js
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzCSSStyle.js       
2007-08-03 20:59:36 UTC (rev 5923)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/LzCSSStyle.js       
2007-08-03 21:00:47 UTC (rev 5924)
@@ -161,7 +161,16 @@
     ////this.time1 += getTimer() - t;
     if ( node == canvas ) return null;
     else {
-        return this.getPropertyValueFor(node.immediateparent, pname );
+        if ($debug) {
+            // Fix for LPP-3024: if we're in debug mode, warn when CSS lookup
+            // results in a null or undefined value. [bshine 08.03.2007]
+            var answer = this.getPropertyValueFor(node.immediateparent, pname 
);
+            if (answer == null) 
+                Debug.warn("There is no CSS property %s for node %s", pname, 
node);
+            return answer;
+        } else {
+            return this.getPropertyValueFor(node.immediateparent, pname );
+        }
     }
 
 }

Modified: 
openlaszlo/branches/wafflecone/test/style/resource/resource-not-found.lzx
===================================================================
--- openlaszlo/branches/wafflecone/test/style/resource/resource-not-found.lzx   
2007-08-03 20:59:36 UTC (rev 5923)
+++ openlaszlo/branches/wafflecone/test/style/resource/resource-not-found.lzx   
2007-08-03 21:00:47 UTC (rev 5924)
@@ -6,7 +6,7 @@
 
         [name="monkresource"] {
             cssimage: "monk.jpg"; 
-        }
+        }  
 
     </stylesheet>
 
@@ -20,7 +20,8 @@
 
     <view id="gBonk" source="$style{'styledresource'}" />
 
-    <!-- this should give a warning -->
+    <!-- BUG LPP-3024 this should give a warning, but does not  
+         [bshine 08.03.2007] -->     
     <view id="gMissing" source="$style{'nostyledefined'}" />
 
     <resource name="niceresource" src="test.png" />


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

Reply via email to