@@ -99,15 +99,16 @@ Elm.Native.Utils = function(elm) {
9999 function htmlHeight(width, html) {
100100 var t = document.createElement('div');
101101 t.innerHTML = html;
102− t.style.width = width + "px";
102+ if (width > 0) { t.style.width = width + "px"; }
103103 t.style.visibility = "hidden";
104104 t.style.styleFloat = "left";
105105 t.style.cssFloat = "left";
106106
107− document.body.appendChild(t);
108− var h = t.clientHeight
109− document.body.removeChild(t);
110− return h;
107+ elm.node.appendChild(t);
108+ var w = t.clientWidth;
109+ var h = t.clientHeight;
110+ elm.node.removeChild(t);
111+ return Tuple2(w,h);
111112 }
112113
113114 return elm.Native.Utils = {