name->ToUTF8String(atomStr); printf("%s=\"%s\"]", atomStr.get(), NS_ConvertUTF16toUTF8(val).get());
GetSCCRootFor(nsIDOMNode *aDOMNode){  nsCOMPtr<nsIDOMNode> cur(aDOMNode), next;#ifdef DEBUG_NOISY_PRESERVE_WRAPPERS  nsCOMArray<nsIDOMNode> stack;#endif  for (;;) {#ifdef DEBUG_NOISY_PRESERVE_WRAPPERS    stack.AppendObject(cur);#endif    cur->GetParentNode(getter_AddRefs(next));    if (!next) {#ifdef DEBUG_NOISY_PRESERVE_WRAPPERS      PRUint16 nodeType;      cur->GetNodeType(&nodeType);      if (nodeType != nsIDOMNode::DOCUMENT_NODE) {        printf("    non-document root:");        nsAutoString nodeName;        for (PRInt32 i = stack.Count() - 1; i >= 0; --i) {          stack[i]->GetNodeName(nodeName);          printf(" > %s", NS_ConvertUTF16toUTF8(nodeName).get());          stack[i]->GetNodeType(&nodeType);          if (nodeType == nsIDOMNode::ELEMENT_NODE) {            nsCOMPtr<nsIContent> content = do_QueryInterface(stack[i]);            for (PRInt32 j = 0, j_end = content->GetAttrCount(); j < j_end; ++j) {              PRInt32 namespaceID;              nsCOMPtr<nsIAtom> name, prefix;              content->GetAttrNameAt(j, &namespaceID, getter_AddRefs(name),                                     getter_AddRefs(prefix));              nsAutoString val;              nsCAutoString atomStr;              content->GetAttr(namespaceID, name, val);              printf("[");              if (prefix) {                prefix->ToUTF8String(atomStr);                printf("%s:", atomStr.get());              }              name->ToUTF8String(atomStr);              printf("%s=\"%s\"]", atomStr.get(), NS_ConvertUTF16toUTF8(val).get());            }          }        }        printf("\n");      }#endif      return cur;    }    next.swap(cur);  }}