docs: private void emitOpenAndVisitAttributes(HtmlOpenTagNode node, Expression tagName) {
      IncrementalDomCodeBuilder jsCodeBuilder = getJsCodeBuilder();
  
      TemplateNode template = node.getNearestAncestor(TemplateNode.class);
      List<Expression> args = new ArrayList<>();
      args.add(tagName);
      Map<String, Expression> staticAttributes = getStaticAttributes(node);
      ImmutableList.Builder<Expression> staticsBuilder = ImmutableList.builder();
      for (Map.Entry<String, Expression> entry : staticAttributes.entrySet()) {
        staticsBuilder.add(Expression.stringLiteral(entry.getKey()));
        staticsBuilder.add(entry.getValue());
      }
  
      KeyNode keyNode = node.getKeyNode();
      Expression key = Expression.LITERAL_UNDEFINED;
      if (keyNode == null) {
        key = incrementKeyForTemplate(template);
      } else {
        keyCounterStack.push(new Holder<>(0));
      }
      args.add(key);
  
      // Instead of inlining the array, place the variable declaration in the global scope
      // and lazily initialize it in the template.
      if (!staticAttributes.isEmpty()) {
        String id = "_statics_" + staticsCounter++;
        Expression idExpr = id(alias + id);
        Expression lazyAssignment =
            // Generator can be null because we know this evaluates to an or
            // ie alias_statics_1 || alias_statics_1 = []
            idExpr.or(
                idExpr.assign(Expression.arrayLiteral(staticsBuilder.build())),
                /* codeGenerator= */ null);
        staticVarDeclarations.add(VariableDeclaration.builder(alias + id).build());
        args.add(lazyAssignment);
      }
  
      // If attributes are all static, we can remove the elementOpenStart and just use elementOpen.
      // TODO(b/111717673): In practice this never seems to happen because we have
      // data-debug-soy.
      Expression openTagExpr;
      if (node.numChildren() == 1) {
        openTagExpr = INCREMENTAL_DOM_ELEMENT_OPEN.call(args);
      } else {
        jsCodeBuilder.append(INCREMENTAL_DOM_ELEMENT_OPEN_START.call(args));
  
        jsCodeBuilder.increaseIndentTwice();
        // child-0 is the tag name
        for (int i = 1; i < node.numChildren(); i++) {
          visit(node.getChild(i));
        }
        jsCodeBuilder.decreaseIndentTwice();
  
        openTagExpr = INCREMENTAL_DOM_ELEMENT_OPEN_END.call();
      }
  
      VeLogNode velogNode =
          (VeLogNode) template.firstChildThatMatches(n -> n.getKind() == Kind.VE_LOG_NODE);
      boolean isFirstHtmlOpenTagNode =
          velogNode != null
              ? node.equals(
                  velogNode.firstChildThatMatches(n -> n.getKind() == Kind.HTML_OPEN_TAG_NODE))
              : node.equals(
                  template.firstChildThatMatches(n -> n.getKind() == Kind.HTML_OPEN_TAG_NODE));
  
      if (template instanceof TemplateElementNode && isFirstHtmlOpenTagNode) {
        // Append code to stash the template object in this node.
        getJsCodeBuilder().append(id("this").dotAccess("setNodeInternal").call(openTagExpr));
      } else {
        getJsCodeBuilder().append(openTagExpr);
      }
    }