processTree(node) {
    var tagName = node.tagName;
    if (!tagName && node.nodeType != Node.TEXT_NODE) {
      // Ignore nodes that don't have tags and are not text.
    } else if (tagName && this.FILTERED_TAGS.has(tagName)) {
      // Filter out nodes that are in filteredTags.
    } else if (node.nodeType == Node.TEXT_NODE) {
      this.processText(node);
    } else {
      this.html.push(`<${tagName.toLowerCase()} `);
      var id;
      if (node.attributes.id) {
        id = node.attributes.id.value;
      } else {
        id = this.generateId(node.ownerDocument);
      }
      this.processAttributes(node, id);
      this.processPseudoElements(node, id);
      this.processBackgroundImageStyle(node, id);
      this.html.push('>');

      if (tagName == 'HEAD') {
        this.fontPlaceHolderIndex = this.html.length;
        this.html.push('');
        this.pseudoElementPlaceHolderIndex = this.html.length;
        this.html.push('');
        this.pseudoElementTestingStyleIndex = this.html.length;
        this.html.push('');
      }

      var children = node.childNodes;
      if (children) {
        for (var i = 0, child; child = children[i]; i++) {
          this.processTree(child);
        }
      }

      if (!this.NO_CLOSING_TAGS.has(tagName)) {
        this.html.push(`</${tagName.toLowerCase()}>`);
      }
    }
  }
/**
   * Takes an html node, and populates this object's fields such that it can
   * eventually be converted into an html text file.
   *
   * @param {Node} node The Node to serialize.
   * @private
   */
Takes an html node, and populates this object's fields such that it can
eventually be converted into an html text file.

@param {Node} node The Node to serialize.
@private
Takes an html node and populates this object ' s fields such that it can eventually be converted into an html text file . @param { Node } node The Node to serialize . @private
processTree(node) {
    var tagName = node.tagName;
    if (!tagName && node.nodeType != Node.TEXT_NODE) {
    } else if (tagName && this.FILTERED_TAGS.has(tagName)) {
    } else if (node.nodeType == Node.TEXT_NODE) {
      this.processText(node);
    } else {
      this.html.push(`<${tagName.toLowerCase()} `);
      var id;
      if (node.attributes.id) {
        id = node.attributes.id.value;
      } else {
        id = this.generateId(node.ownerDocument);
      }
      this.processAttributes(node, id);
      this.processPseudoElements(node, id);
      this.processBackgroundImageStyle(node, id);
      this.html.push('>');
      if (tagName == 'HEAD') {
        this.fontPlaceHolderIndex = this.html.length;
        this.html.push('');
        this.pseudoElementPlaceHolderIndex = this.html.length;
        this.html.push('');
        this.pseudoElementTestingStyleIndex = this.html.length;
        this.html.push('');
      }
      var children = node.childNodes;
      if (children) {
        for (var i = 0, child; child = children[i]; i++) {
          this.processTree(child);
        }
      }
      if (!this.NO_CLOSING_TAGS.has(tagName)) {
        this.html.push(`</${tagName.toLowerCase()}>`);
      }
    }
  }
processTree ( node ) { var tagName = node . tagName ; if ( ! tagName && node . nodeType != Node . TEXT_NODE ) { } else if ( tagName && this . FILTERED_TAGS . has ( tagName ) ) { } else if ( node . nodeType == Node . TEXT_NODE ) { this . processText ( node ) ; } else { this . html . push ( ` ${ tagName . toLowerCase ( ) } ` ) ; var id ; if ( node . attributes . id ) { id = node . attributes . id . value ; } else { id = this . generateId ( node . ownerDocument ) ; } this . processAttributes ( node , id ) ; this . processPseudoElements ( node , id ) ; this . processBackgroundImageStyle ( node , id ) ; this . html . push ( '>' ) ; if ( tagName == 'HEAD' ) { this . fontPlaceHolderIndex = this . html . length ; this . html . push ( '' ) ; this . pseudoElementPlaceHolderIndex = this . html . length ; this . html . push ( '' ) ; this . pseudoElementTestingStyleIndex = this . html . length ; this . html . push ( '' ) ; } var children = node . childNodes ; if ( children ) { for ( var i = 0 , child ; child = children [ i ] ; i ++ ) { this . processTree ( child ) ; } } if ( ! this . NO_CLOSING_TAGS . has ( tagName ) ) { this . html . push ( ` ${ tagName . toLowerCase ( ) } ` ) ; } } }
Takes an html node, and populates this object's fields such that it can
 eventually be converted into an html text file.
Takes an html node and populates this object ' s fields such that it can eventually be converted into an html text file .
// Ignore nodes that don't have tags and are not text. // Filter out nodes that are in filteredTags.