           @readFile file, @enqueue(element, loaded, file)
 
 
+# Support for iframes that load content when you set the src attribute.
 HTML.Document.prototype._elementBuilders["iframe"] = (doc, s)->
   parent = doc.parentWindow
 

  click: (event)->
    anchor = event.target
    anchor.ownerDocument.parentWindow.location = anchor.href if anchor.href

# Fix resource loading to keep track of in-progress requests. Need this to wait
# for all resources (mainly JavaScript) to complete loading before terminating

  return iframe


# If JSDOM encounters a JS error, it fires on the element.  We expect it to be
# fires on the Window.  We also want better stack traces.
HTML.languageProcessors.javascript = (element, code, filename)->
