code: function(url) {
        if (!url) return this
  
        var self = this
          , img  = document.createElement('img')
  
        // preload image
        img.onload = function() {
          var p = self.parent(SVG.Pattern)
  
          if(p === null) return
  
          // ensure image size
          if (self.width() == 0 && self.height() == 0)
            self.size(img.width, img.height)
  
          // ensure pattern size if not set
          if (p && p.width() == 0 && p.height() == 0)
            p.size(self.width(), self.height())
  
          // callback
          if (typeof self._loaded === 'function')
            self._loaded.call(self, {
              width:  img.width
            , height: img.height
            , ratio:  img.width / img.height
            , url:    url
            })
        }
  
        return this.attr('href', (img.src = this.src = url), SVG.xlink)
      }
docs: (re)load image