From ec0b3d579caed77de50549986e0bfcb94bc7db1d Mon Sep 17 00:00:00 2001 From: "peterv%propagandism.org" Date: Sun, 18 Jan 2004 10:22:22 +0000 Subject: [PATCH] Fix for bug 230439 (Remove anonymous nodeinfomanager and other cleanup). r=caillon, sr=jst. git-svn-id: svn://10.0.0.236/trunk@151491 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/html/document/src/nsHTMLContentSink.cpp | 6 +++--- mozilla/layout/generic/nsGfxScrollFrame.cpp | 5 ++--- mozilla/layout/html/base/src/nsGfxScrollFrame.cpp | 5 ++--- mozilla/layout/xul/base/src/nsDocElementBoxFrame.cpp | 12 ++++++++---- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index ccb39ab6d01..b40ae68dcc8 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -2260,7 +2260,7 @@ HTMLContentSink::Init(nsIDocument* aDoc, } // Make head part - rv = mNodeInfoManager->GetNodeInfo(NS_LITERAL_CSTRING("head"), + rv = mNodeInfoManager->GetNodeInfo(nsHTMLAtoms::head, nsnull, kNameSpaceID_None, getter_AddRefs(nodeInfo)); NS_ENSURE_SUCCESS(rv, rv); @@ -4022,7 +4022,7 @@ HTMLContentSink::ProcessBASETag(const nsIParserNode& aNode) // Create content object nsCOMPtr element; nsCOMPtr nodeInfo; - mNodeInfoManager->GetNodeInfo(NS_LITERAL_CSTRING("base"), nsnull, + mNodeInfoManager->GetNodeInfo(nsHTMLAtoms::base, nsnull, kNameSpaceID_None, getter_AddRefs(nodeInfo)); @@ -4174,7 +4174,7 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode) // Create content object nsCOMPtr nodeInfo; - rv = mNodeInfoManager->GetNodeInfo(NS_LITERAL_CSTRING("meta"), nsnull, + rv = mNodeInfoManager->GetNodeInfo(nsHTMLAtoms::meta, nsnull, kNameSpaceID_None, getter_AddRefs(nodeInfo)); NS_ENSURE_SUCCESS(rv, rv); diff --git a/mozilla/layout/generic/nsGfxScrollFrame.cpp b/mozilla/layout/generic/nsGfxScrollFrame.cpp index 7363b724e27..9288b363fcc 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.cpp +++ b/mozilla/layout/generic/nsGfxScrollFrame.cpp @@ -49,7 +49,6 @@ #include "nsWidgetsCID.h" #include "nsGfxScrollFrame.h" #include "nsLayoutAtoms.h" -#include "nsIXMLContent.h" #include "nsXULAtoms.h" #include "nsHTMLAtoms.h" #include "nsINameSpaceManager.h" @@ -384,7 +383,7 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext, NS_ENSURE_TRUE(nodeInfoManager, NS_ERROR_FAILURE); nsCOMPtr nodeInfo; - nodeInfoManager->GetNodeInfo(NS_LITERAL_CSTRING("scrollbar"), nsnull, + nodeInfoManager->GetNodeInfo(nsXULAtoms::scrollbar, nsnull, kNameSpaceID_XUL, getter_AddRefs(nodeInfo)); ScrollbarStyles styles = GetScrollbarStyles(); @@ -409,7 +408,7 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext, } if (canHaveHorizontal && canHaveVertical) { - nodeInfoManager->GetNodeInfo(NS_LITERAL_CSTRING("scrollcorner"), nsnull, + nodeInfoManager->GetNodeInfo(nsXULAtoms::scrollcorner, nsnull, kNameSpaceID_XUL, getter_AddRefs(nodeInfo)); nsCOMPtr content; elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content)); diff --git a/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp b/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp index 7363b724e27..9288b363fcc 100644 --- a/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp +++ b/mozilla/layout/html/base/src/nsGfxScrollFrame.cpp @@ -49,7 +49,6 @@ #include "nsWidgetsCID.h" #include "nsGfxScrollFrame.h" #include "nsLayoutAtoms.h" -#include "nsIXMLContent.h" #include "nsXULAtoms.h" #include "nsHTMLAtoms.h" #include "nsINameSpaceManager.h" @@ -384,7 +383,7 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext, NS_ENSURE_TRUE(nodeInfoManager, NS_ERROR_FAILURE); nsCOMPtr nodeInfo; - nodeInfoManager->GetNodeInfo(NS_LITERAL_CSTRING("scrollbar"), nsnull, + nodeInfoManager->GetNodeInfo(nsXULAtoms::scrollbar, nsnull, kNameSpaceID_XUL, getter_AddRefs(nodeInfo)); ScrollbarStyles styles = GetScrollbarStyles(); @@ -409,7 +408,7 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext, } if (canHaveHorizontal && canHaveVertical) { - nodeInfoManager->GetNodeInfo(NS_LITERAL_CSTRING("scrollcorner"), nsnull, + nodeInfoManager->GetNodeInfo(nsXULAtoms::scrollcorner, nsnull, kNameSpaceID_XUL, getter_AddRefs(nodeInfo)); nsCOMPtr content; elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content)); diff --git a/mozilla/layout/xul/base/src/nsDocElementBoxFrame.cpp b/mozilla/layout/xul/base/src/nsDocElementBoxFrame.cpp index f1146439f9b..efd55df1623 100644 --- a/mozilla/layout/xul/base/src/nsDocElementBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsDocElementBoxFrame.cpp @@ -132,16 +132,20 @@ nsDocElementBoxFrame::CreateAnonymousContent(nsIPresContext* aPresContext, // create the top-secret popupgroup node. shhhhh! nsCOMPtr nodeInfo; - nodeInfoManager->GetNodeInfo(NS_LITERAL_CSTRING("popupgroup"), nsnull, - kNameSpaceID_XUL, getter_AddRefs(nodeInfo)); + rv = nodeInfoManager->GetNodeInfo(nsXULAtoms::popupgroup, + nsnull, kNameSpaceID_XUL, + getter_AddRefs(nodeInfo)); + NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr content; elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content)); aAnonymousItems.AppendElement(content); // create the top-secret default tooltip node. shhhhh! - nodeInfoManager->GetNodeInfo(NS_LITERAL_CSTRING("tooltip"), nsnull, - kNameSpaceID_XUL, getter_AddRefs(nodeInfo)); + rv = nodeInfoManager->GetNodeInfo(nsXULAtoms::tooltip, nsnull, + kNameSpaceID_XUL, getter_AddRefs(nodeInfo)); + NS_ENSURE_SUCCESS(rv, rv); + elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content)); content->SetAttr(nsnull, nsXULAtoms::defaultz, NS_LITERAL_STRING("true"), PR_FALSE); aAnonymousItems.AppendElement(content);