Changing the way content elements store their name information, previously the elements generally stored a name atom and a namespace ID, now they store a pointer to a shared structure containing the name atom, the prefix atom and the namespace ID. This structure is shared between nodes with unique names (ie same name, prefix and ns ID) within a document. Documents now hold a hash table of the names in the document. The changes to mozilla/rdf are not reviewed but they are approved by waterson@netscape.com and the changes to mozilla/layout are reviewed by buster@netscape.com.

This commit is contained in:
jst@netscape.com
2000-05-10 13:13:39 +00:00
parent 772b8e3001
commit fa72f71714
196 changed files with 3126 additions and 2421 deletions

View File

@@ -1184,8 +1184,18 @@ NS_IMETHODIMP
nsHTMLDocument::CreateElement(const nsString& aTagName,
nsIDOMElement** aReturn)
{
NS_ENSURE_ARG_POINTER(aReturn);
NS_ENSURE_TRUE(aTagName.Length(), NS_ERROR_DOM_INVALID_CHARACTER_ERR);
nsCOMPtr<nsINodeInfo> nodeInfo;
nsAutoString tmp(aTagName);
tmp.ToLowerCase();
mNodeInfoManager->GetNodeInfo(aTagName, nsnull, kNameSpaceID_None,
*getter_AddRefs(nodeInfo));
nsCOMPtr<nsIHTMLContent> content;
nsresult rv = NS_CreateHTMLElement(getter_AddRefs(content), aTagName);
nsresult rv = NS_CreateHTMLElement(getter_AddRefs(content), nodeInfo);
if (NS_SUCCEEDED(rv)) {
content->SetContentID(mNextContentID++);
rv = content->QueryInterface(kIDOMElementIID, (void**)aReturn);