code: function getDomTreeWalker(html) {
    var iteratorParent;
    var safeHtml =
        uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(
            Const.from('Never attached to DOM.'), html);
    // Use a <template> element if possible.
    var templateElement = document.createElement('template');
    if ('content' in templateElement) {
      safe.unsafeSetInnerHtmlDoNotUseOrElse(templateElement, safeHtml);
      iteratorParent = templateElement.content;
    } else {
      // In browsers where <template> is not implemented, use an inert
      // HTMLDocument.
      var doc = document.implementation.createHTMLDocument('x');
      iteratorParent = doc.body;
      safe.unsafeSetInnerHtmlDoNotUseOrElse(doc.body, safeHtml);
    }
    return document.createTreeWalker(
        iteratorParent, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,
        null /* filter */, false /* entityReferenceExpansion */);
  }
docs: Parses a string of unsanitized HTML and provides an iterator over the
  resulting DOM tree nodes. The parsing operation is inert (that is,
  it does not cause execution of any active content or cause the browser to
  issue any requests). The returned iterator is guaranteed to iterate over a
  parent element before iterating over any of its children.
  @param {string} html
  @return {!TreeWalker}