Author: bargull
Date: 2007-11-07 15:20:21 -0800 (Wed, 07 Nov 2007)
New Revision: 7189

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs
Log:
Change 20071103-bargull-2 by [EMAIL PROTECTED] on 2007-11-03 17:05:49
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Test nodeType in various datapointer-methods

New Features:

Bugs Fixed:
LPP-5034 - LzDatapointer: add tests for "nodeType"

Technical Reviewer: hminsky
QA Reviewer: pbr
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
This avoids browser-warnings in DHTML and gives consistent behaviour across 
runtimes. 


Tests:



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs     2007-11-07 
23:06:39 UTC (rev 7188)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs     2007-11-07 
23:20:21 UTC (rev 7189)
@@ -909,8 +909,10 @@
         }
         return;
     }
+    if (this.p.nodeType != LzDataNode.TEXT_NODE) {
     this.p.setNodeName( name );
 }
+}
 
 /**
   * Returns the attributes of the node pointed to by the datapointer in an
@@ -941,8 +943,10 @@
         }
         return;
     }
+    if (this.p.nodeType != LzDataNode.TEXT_NODE) {
     return this.p.attributes[ name ];
 }
+}
 
 /**
   * Set the <param>name</param> attribute of the current node to the
@@ -957,8 +961,10 @@
         }
         return;
     }
+    if (this.p.nodeType != LzDataNode.TEXT_NODE) {
     this.p.setAttr( name, val );
 }
+}
 
 /**
   * Removes the <param>name</param> attribute from the current node.
@@ -971,8 +977,10 @@
         }
         return;
     }
+    if (this.p.nodeType != LzDataNode.TEXT_NODE) {
     this.p.removeAttr( name );
 }
+}
 
 /**
   * Returns a string that represents a concatenation of the text nodes
@@ -988,8 +996,10 @@
         }
         return;
     }
+    if (this.p.nodeType != LzDataNode.TEXT_NODE) {
     return this.p.__LZgetText();
 }
+}
 
 /**
   * Returns a string that represents a concatenation of the text nodes
@@ -1035,6 +1045,7 @@
         return;
     }
 
+    if (this.p.nodeType != LzDataNode.TEXT_NODE) {
     // set the first text node you find; otherwise add one
     var foundit = false;
     for (var i = 0; i < this.p.childNodes.length; i++) {
@@ -1049,6 +1060,7 @@
         this.p.appendChild( new LzDataText( val ) );
     }
 }
+}
 
 /**
   * Counts the number of element nodes that are children of the node that the
@@ -1056,7 +1068,7 @@
   * @return Integer: The number of child nodes for the current node
   */
 function getNodeCount (){ 
-    if (! this.p) return 0;
+    if (! this.p || this.p.nodeType == LzDataNode.TEXT_NODE) return 0;
     return this.p.childNodes.length || 0;
 }
 
@@ -1083,7 +1095,10 @@
         nn.appendChild( new LzDataText( text ) );
     }
 
+    if (this.p.nodeType != LzDataNode.TEXT_NODE) {
     this.p.appendChild( nn );
+    }
+    
     return nn;
 }
 
@@ -1158,7 +1173,11 @@
     }
 
     var n = dp.p.cloneNode( true );
+    
+    if (this.p.nodeType != LzDataNode.TEXT_NODE) {
     this.p.appendChild( n );
+    }
+    
     return new LzDatapointer( null , { pointer : n } );
 }
 


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

Reply via email to