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

bargull@openlaszlo.org bargull at openlaszlo.org
Sun Apr 19 11:47:26 PDT 2009


Author: bargull
Date: 2009-04-19 11:47:23 -0700 (Sun, 19 Apr 2009)
New Revision: 13711

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzXMLParser.js
Log:
Change 20090419-bargull-bKz by bargull at dell--p4--2-53 on 2009-04-19 18:59:49
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: fix failure in alldata (DHTML-Safari)

New Features:

Bugs Fixed: LPP-8069 (DHTML: TypeError in alldata in Safari (Win))

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

Documentation:

Release Notes:

Details:
Handle xhtml-documents properly when checking for a parser-error in Safari.
    

Tests:
alldata



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzXMLParser.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzXMLParser.js	2009-04-19 18:44:23 UTC (rev 13710)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzXMLParser.js	2009-04-19 18:47:23 UTC (rev 13711)
@@ -57,18 +57,20 @@
         var c = doc.firstChild;
         if (c instanceof HTMLElement) {
             // Safari returns a HTMLElement for a plain string
-            // html > body > parsererror > div (with error information)
-            var msg = c.firstChild.firstChild.childNodes[1].textContent;
+            // NOTE: but also returns a HTMLElement if the xml-string defines
+            // a xhtml-document (LPP-8069)
+            // <html><body><parsererror>[...]</parsererror></body></html>
+            (c = c.firstChild) && (c = c.firstChild);
+        } else {
+            // <*><parsererror>[...]</parsererror></*>
+            (c = c.firstChild);
+        }
+        // <parsererror><h3/><div>[info]</div></parsererror>
+        if (c && c.nodeName == "parsererror") {
+            // second childNode provides error information
+            var msg = c.childNodes[1].textContent;
             // remove file and line information (does not provide useful info here)
             return (msg.match("[^:]*: (.*)")[1]);
-        } else {
-            c = c.firstChild;
-            if (c && c.nodeName == "parsererror") {
-                // second childNodes provides error information
-                var msg = c.childNodes[1].textContent;
-                // remove file and line information (does not provide useful info here)
-                return (msg.match("[^:]*: (.*)")[1]);
-            }
         }
     }
 } // end of LzXMLParser



More information about the Laszlo-checkins mailing list