         true
 
     ## Compute viewBox attribute if absent.
-    @viewBox = svgBBox @xml
+    @viewBox = svgBBox @dom
 
     ## Overflow behavior
-    overflow = attributeOrStyle @xml.documentElement, 'overflow'
+    overflow = attributeOrStyle @dom.documentElement, 'overflow'
     if not overflow? and (overflowDefault = @getSetting 'overflowDefault')?
-      @xml.documentElement.setAttribute 'overflow',
+      @dom.documentElement.setAttribute 'overflow',
         overflow = overflowDefault
     @overflowVisible = (overflow? and /^\s*(visible|scroll)\b/.test overflow)
     @width = @height = null

    @svg = removeSVGComments @svg

  setId: (@id) ->
    @xml.documentElement.setAttribute 'id', @id if @xml?
  makeXML: ->
    return @xml if @xml?
    @makeSVG()
    ## Force SVG namespace when parsing, so nodes have correct namespaceURI.
    ## (This is especially important on the browser, so the results can be

    else
      viewBox

isAuto = (dom, prop) ->
  dom.documentElement.hasAttribute(prop) and
  /^\s*auto\s*$/i.test dom.documentElement.getAttribute prop

attributeOrStyle = (node, attr, styleKey = attr) ->
  if value = node.getAttribute attr
