diff --git a/mozilla/content/base/public/nsITextContent.h b/mozilla/content/base/public/nsITextContent.h index 8db2ba59533..d698ae08453 100644 --- a/mozilla/content/base/public/nsITextContent.h +++ b/mozilla/content/base/public/nsITextContent.h @@ -21,6 +21,7 @@ #include "nslayout.h" class nsString; class nsTextFragment; +class nsIContent; // IID for the nsITextContent interface #define NS_ITEXT_CONTENT_IID \ @@ -55,4 +56,12 @@ public: PRBool aNotify) = 0; }; +// XXX These belong elsewhere +extern nsresult +NS_NewTextNode(nsIContent** aResult); + +extern nsresult +NS_NewCommentNode(nsIContent** aResult); + + #endif /* nsITextContent_h___ */ diff --git a/mozilla/layout/html/content/src/nsCommentNode.cpp b/mozilla/content/base/src/nsCommentNode.cpp similarity index 84% rename from mozilla/layout/html/content/src/nsCommentNode.cpp rename to mozilla/content/base/src/nsCommentNode.cpp index bc3ce1ed1d9..cdc525ff2e8 100644 --- a/mozilla/layout/html/content/src/nsCommentNode.cpp +++ b/mozilla/content/base/src/nsCommentNode.cpp @@ -20,7 +20,7 @@ #include "nsGenericDOMDataNode.h" #include "nsIScriptObjectOwner.h" #include "nsIDOMEventReceiver.h" -#include "nsIHTMLContent.h" +#include "nsIContent.h" #include "nsFrame.h" static NS_DEFINE_IID(kIDOMCommentIID, NS_IDOMCOMMENT_IID); @@ -28,7 +28,7 @@ static NS_DEFINE_IID(kIDOMCommentIID, NS_IDOMCOMMENT_IID); class nsCommentNode : public nsIDOMComment, public nsIScriptObjectOwner, public nsIDOMEventReceiver, - public nsIHTMLContent + public nsIContent { public: nsCommentNode(); @@ -54,26 +54,23 @@ public: // nsIContent NS_IMPL_ICONTENT_USING_GENERIC_DOM_DATA(mInner) - // nsIHTMLContent - NS_IMPL_IHTMLCONTENT_USING_GENERIC_DOM_DATA(mInner) - protected: nsGenericDOMDataNode mInner; }; -nsresult NS_NewCommentNode(nsIHTMLContent** aInstancePtrResult); +nsresult NS_NewCommentNode(nsIContent** aInstancePtrResult); nsresult -NS_NewCommentNode(nsIHTMLContent** aInstancePtrResult) +NS_NewCommentNode(nsIContent** aInstancePtrResult) { NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); if (nsnull == aInstancePtrResult) { return NS_ERROR_NULL_POINTER; } - nsIHTMLContent* it = new nsCommentNode(); + nsIContent* it = new nsCommentNode(); if (nsnull == it) { return NS_ERROR_OUT_OF_MEMORY; } - return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult); + return it->QueryInterface(kIContentIID, (void **) aInstancePtrResult); } nsCommentNode::nsCommentNode() @@ -147,27 +144,6 @@ nsCommentNode::List(FILE* out, PRInt32 aIndent) const return NS_OK; } -NS_IMETHODIMP -nsCommentNode::ToHTML(FILE* out) const -{ - nsAutoString tmp; - tmp.Append("