Another attempt at logging for bug 474537
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 02 Feb 2009 16:27:56 -0500
changeset 24534 92e9ab0b78aec997d19ee69300db79f89d3aea3f
parent 24533 02315e999627a6e03547bc92f030f6cedc2bb66d
child 24535 dd13c5a63a75d338d8a5315cc34371ba0f888f32
push id5097
push userbzbarsky@mozilla.com
push dateMon, 02 Feb 2009 21:28:09 +0000
treeherdermozilla-central@92e9ab0b78ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs474537
milestone1.9.2a1pre
Another attempt at logging for bug 474537
content/html/document/src/nsHTMLContentSink.cpp
--- a/content/html/document/src/nsHTMLContentSink.cpp
+++ b/content/html/document/src/nsHTMLContentSink.cpp
@@ -562,16 +562,32 @@ HTMLContentSink::CreateContentObject(con
     NS_ASSERTION(name, "What? Reverse mapping of id to string broken!!!");
 
     nodeInfo = mNodeInfoManager->GetNodeInfo(name, nsnull, kNameSpaceID_None);
     NS_IF_ADDREF(mNodeInfoCache[aNodeType] = nodeInfo);
   }
 
   NS_ENSURE_TRUE(nodeInfo, nsnull);
 
+  if (nodeInfo->NameAtom() == nsGkAtoms::input && aNodeType != eHTMLTag_input) {
+    printf("BOGUS INPUT IN CreateContentObject\n");
+
+    printf("aNodeType is userdefined: %d\n", aNodeType == eHTMLTag_userdefined);
+
+    if (aNodeType == eHTMLTag_userdefined) {
+      printf("aNode.GetText().Length(): %d\n", aNode.GetText().Length());
+      printf("aNode.GetText: '%s'\n", NS_ConvertUTF16toUTF8(aNode.GetText()).get());
+      printf("PRUnichars: ");
+      for (unsigned i = 0; i < aNode.GetText().Length(); ++i) {
+        printf("0x%u ", (unsigned)aNode.GetText().CharAt(i));
+      }
+      printf("\n");
+    }
+  }
+
   // Make the content object
   return CreateHTMLElement(aNodeType, nodeInfo, PR_TRUE);
 }
 
 nsresult
 NS_NewHTMLElement(nsIContent** aResult, nsINodeInfo *aNodeInfo,
                   PRBool aFromParser)
 {
@@ -598,16 +614,20 @@ NS_NewHTMLElement(nsIContent** aResult, 
                                aNodeInfo, aFromParser).get();
   return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 already_AddRefed<nsGenericHTMLElement>
 CreateHTMLElement(PRUint32 aNodeType, nsINodeInfo *aNodeInfo,
                   PRBool aFromParser)
 {
+  if (aNodeInfo->NameAtom() == nsGkAtoms::input &&
+      aNodeType != eHTMLTag_input) {
+    printf("GOT INTO CreateHTMLElement WITH BOGUS INPUT\n");
+  }
   NS_ASSERTION(aNodeType <= NS_HTML_TAG_MAX ||
                aNodeType == eHTMLTag_userdefined,
                "aNodeType is out of bounds");
 
   contentCreatorCallback cb = sContentCreatorCallbacks[aNodeType];
 
   NS_ASSERTION(cb != NS_NewHTMLNOTUSEDElement,
                "Don't know how to construct tag element!");