# so add a <base> tag
@idoc.head.appendChild domify @idoc, base: href: this_url_sans_path()
if @options.css_file
- # TODO test this
- @idoc.head.appendChild domify @idoc, link: rel: 'stylesheet', type: 'text/css', href: @options.css_file
+ istyle = domify @idoc, link: rel: 'stylesheet', type: 'text/css', href: @options.css_file + '?foo=baz'
+ istyle.onload = =>
+ @adjust_iframe_height()
+ @idoc.head.appendChild istyle
@idoc.head.appendChild domify @idoc, style: children: [domify @idoc, text: "body { overflow: hidden; }"]
@load_html @in_el.value
@inited = true
@in_el.value = @pretty_html @tree
@in_el.onchange = =>
@load_html @in_el.value
+ @adjust_iframe_height()
+ adjust_iframe_height: ->
@iframe.style.height = "0"
@iframe.style.height = "#{@idoc.body.scrollHeight}px"
kill_cursor: -> # remove it, forget where it was