# HG changeset patch # User Adam Chlipala # Date 1327281914 18000 # Node ID e8a84494d2c0062b50e77f6688fa8dcb92964edc # Parent 5b2c7b9f6017be2efc2e45a9548aceca58208f67 Fix runtime system handling of inside inside diff -r 5b2c7b9f6017 -r e8a84494d2c0 lib/js/urweb.js --- a/lib/js/urweb.js Sun Jan 15 14:45:06 2012 -0500 +++ b/lib/js/urweb.js Sun Jan 22 20:25:14 2012 -0500 @@ -699,10 +699,15 @@ for (var tbody = table.firstChild; tbody; tbody = tbody.nextSibling) { if (tbody.tagName == "TBODY") { + var firstChild = tbody.firstChild; + for (script = table.firstChild; script && script != tbody; script = next) { next = script.nextSibling; - tbody.insertBefore(script, tbody.firstChild); + if (firstChild) + tbody.insertBefore(script, firstChild); + else + tbody.appendChild(script); } return; @@ -713,7 +718,7 @@ for (script = table.firstChild; script; script = next) { next = script.nextSibling; - tbody.insertBefore(script, tbody.firstChild); + tbody.appendChild(script); } table.appendChild(tbody); }