diff lib/js/urweb.js @ 903:63114a2e5075

<dyn> inside <tr>
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Aug 2009 14:57:44 -0400
parents 4b9f1de2c647
children 7a4b026e45dd
line wrap: on
line diff
--- a/lib/js/urweb.js	Thu Aug 06 14:39:03 2009 -0400
+++ b/lib/js/urweb.js	Thu Aug 06 14:57:44 2009 -0400
@@ -302,8 +302,6 @@
       var dummy = document.createElement("body");
       dummy.innerHTML = "<table>" + html + "</table>";
       runScripts(dummy);
-      var rows = dummy.firstChild.rows;
-      var nRows = rows.length;
       var table = x.parentNode;
 
       var arr = dummy.getElementsByTagName("tbody");
@@ -317,6 +315,23 @@
           table.insertBefore(node, x);
         }
       }
+    } else if (pnode == "tr") {
+      var dummy = document.createElement("body");
+      dummy.innerHTML = "<table><tr>" + html + "</tr></table>";
+      runScripts(dummy);
+      var table = x.parentNode;
+
+      var arr = dummy.getElementsByTagName("tr");
+      firstChild = null;
+      if (arr.length > 0) {
+        var tbody = arr[0], next;
+        firstChild = document.createElement("script");
+        table.insertBefore(firstChild, x);
+        for (var node = tbody.firstChild; node; node = next) {
+          next = node.nextSibling;
+          table.insertBefore(node, x);
+        }
+      }
     } else {
       firstChild = document.createElement("span");
       firstChild.innerHTML = html;