comparison 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
comparison
equal deleted inserted replaced
902:4b9f1de2c647 903:63114a2e5075
300 300
301 if (pnode == "table") { 301 if (pnode == "table") {
302 var dummy = document.createElement("body"); 302 var dummy = document.createElement("body");
303 dummy.innerHTML = "<table>" + html + "</table>"; 303 dummy.innerHTML = "<table>" + html + "</table>";
304 runScripts(dummy); 304 runScripts(dummy);
305 var rows = dummy.firstChild.rows;
306 var nRows = rows.length;
307 var table = x.parentNode; 305 var table = x.parentNode;
308 306
309 var arr = dummy.getElementsByTagName("tbody"); 307 var arr = dummy.getElementsByTagName("tbody");
308 firstChild = null;
309 if (arr.length > 0) {
310 var tbody = arr[0], next;
311 firstChild = document.createElement("script");
312 table.insertBefore(firstChild, x);
313 for (var node = tbody.firstChild; node; node = next) {
314 next = node.nextSibling;
315 table.insertBefore(node, x);
316 }
317 }
318 } else if (pnode == "tr") {
319 var dummy = document.createElement("body");
320 dummy.innerHTML = "<table><tr>" + html + "</tr></table>";
321 runScripts(dummy);
322 var table = x.parentNode;
323
324 var arr = dummy.getElementsByTagName("tr");
310 firstChild = null; 325 firstChild = null;
311 if (arr.length > 0) { 326 if (arr.length > 0) {
312 var tbody = arr[0], next; 327 var tbody = arr[0], next;
313 firstChild = document.createElement("script"); 328 firstChild = document.createElement("script");
314 table.insertBefore(firstChild, x); 329 table.insertBefore(firstChild, x);