From 3748fdc618862a801467b6852792ac4cc66ab658 Mon Sep 17 00:00:00 2001 From: "kin%netscape.com" Date: Fri, 2 Feb 2001 16:32:27 +0000 Subject: [PATCH] Backing out part of fix for bug #67007 that cause bug #67408. (Can't type newlines in textareas) a=leaf --- content/html/document/src/nsHTMLContentSink.cpp | 13 ++++++++++--- layout/html/document/src/nsHTMLContentSink.cpp | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index 388154ac8d1..a23af3ad1fc 100644 --- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -826,15 +826,22 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo) &rv); if (NS_SUCCEEDED(rv)) { - nsAutoString tag; - aNodeInfo->GetName(tag); + nsAutoString tmpName; + aNodeInfo->GetName(tmpName); // Find tag in tag table PRInt32 id; + rv = parserService->HTMLStringTagToId(tmpName, &id); + if (eHTMLTag_userdefined == nsHTMLTag(id)) { + return NS_ERROR_NOT_AVAILABLE; + } - rv = parserService->HTMLStringTagToId(tag, &id); + // Create atom for tag and then create content object + nsAutoString tag; + rv = parserService->HTMLIdToStringTag(id, tag); nsCOMPtr atom(dont_AddRef(NS_NewAtom(tag.GetUnicode()))); nsCOMPtr newName; aNodeInfo->NameChanged(atom, *getter_AddRefs(newName)); + rv = MakeContentObject(nsHTMLTag(id), newName, nsnull, nsnull, aResult); } diff --git a/layout/html/document/src/nsHTMLContentSink.cpp b/layout/html/document/src/nsHTMLContentSink.cpp index 388154ac8d1..a23af3ad1fc 100644 --- a/layout/html/document/src/nsHTMLContentSink.cpp +++ b/layout/html/document/src/nsHTMLContentSink.cpp @@ -826,15 +826,22 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo) &rv); if (NS_SUCCEEDED(rv)) { - nsAutoString tag; - aNodeInfo->GetName(tag); + nsAutoString tmpName; + aNodeInfo->GetName(tmpName); // Find tag in tag table PRInt32 id; + rv = parserService->HTMLStringTagToId(tmpName, &id); + if (eHTMLTag_userdefined == nsHTMLTag(id)) { + return NS_ERROR_NOT_AVAILABLE; + } - rv = parserService->HTMLStringTagToId(tag, &id); + // Create atom for tag and then create content object + nsAutoString tag; + rv = parserService->HTMLIdToStringTag(id, tag); nsCOMPtr atom(dont_AddRef(NS_NewAtom(tag.GetUnicode()))); nsCOMPtr newName; aNodeInfo->NameChanged(atom, *getter_AddRefs(newName)); + rv = MakeContentObject(nsHTMLTag(id), newName, nsnull, nsnull, aResult); }