function hasAncestorWithNodeName(element, nodeName) {
      while (element && (element = element.parentNode)) {
        if (nodeName.test(element.nodeName)) {
          return true;
        }
      }
      return false;
    }
Parses an SVG document, converts it to an array of corresponding fabric.* instances and passes them to a callback
@static
@function
@memberOf fabric
@method parseSVGDocument
@param {SVGDocument} doc SVG document to parse
@param {Function} callback Callback to call when parsing is finished; It's being passed an array of elements (parsed from a document).
@param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created.