diff --git a/mozilla/content/html/document/public/MANIFEST b/mozilla/content/html/document/public/MANIFEST
index 96630fd8881..f24dbe43025 100644
--- a/mozilla/content/html/document/public/MANIFEST
+++ b/mozilla/content/html/document/public/MANIFEST
@@ -1,4 +1,3 @@
#
# This is a list of local files which get copied to the mozilla:dist:layout directory
#
-nsIHTMLElementFactory.h
diff --git a/mozilla/content/html/document/public/Makefile.in b/mozilla/content/html/document/public/Makefile.in
index 27f750ed39d..a90b1d8c5e0 100644
--- a/mozilla/content/html/document/public/Makefile.in
+++ b/mozilla/content/html/document/public/Makefile.in
@@ -28,8 +28,5 @@ include $(DEPTH)/config/autoconf.mk
MODULE = layout
-EXPORTS = nsIHTMLElementFactory.h
-EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
-
include $(topsrcdir)/config/rules.mk
diff --git a/mozilla/content/html/document/public/makefile.win b/mozilla/content/html/document/public/makefile.win
index 9b414313d12..aa266a181f9 100644
--- a/mozilla/content/html/document/public/makefile.win
+++ b/mozilla/content/html/document/public/makefile.win
@@ -22,7 +22,6 @@
DEPTH=..\..\..\..
EXPORTS = \
- nsIHTMLElementFactory.h \
$(NULL)
MODULE=raptor
diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp
index 3006c839edd..d7d55c7f697 100644
--- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp
+++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp
@@ -43,7 +43,7 @@
#include "prlog.h"
#include "nsHTMLParts.h"
-#include "nsIHTMLElementFactory.h"
+#include "nsIElementFactory.h"
#include "nsITextContent.h"
#include "nsIDOMText.h"
@@ -958,9 +958,7 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult, PRInt32 aID)
//----------------------------------------------------------------------
-static NS_DEFINE_IID(kIHTMLElementFactoryIID, NS_IHTML_ELEMENT_FACTORY_IID);
-
-class nsHTMLElementFactory : public nsIHTMLElementFactory {
+class nsHTMLElementFactory : public nsIElementFactory {
public:
nsHTMLElementFactory();
virtual ~nsHTMLElementFactory();
@@ -968,11 +966,11 @@ public:
NS_DECL_ISUPPORTS
NS_IMETHOD CreateInstanceByTag(const nsString& aTag,
- nsIHTMLContent** aResult);
+ nsIContent** aResult);
};
nsresult
-NS_NewHTMLElementFactory(nsIHTMLElementFactory** aInstancePtrResult)
+NS_NewHTMLElementFactory(nsIElementFactory** aInstancePtrResult)
{
NS_PRECONDITION(aInstancePtrResult, "null OUT ptr");
if (!aInstancePtrResult) {
@@ -982,7 +980,7 @@ NS_NewHTMLElementFactory(nsIHTMLElementFactory** aInstancePtrResult)
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
- return it->QueryInterface(kIHTMLElementFactoryIID,
+ return it->QueryInterface(nsIElementFactory::GetIID(),
(void**)aInstancePtrResult);
}
@@ -995,14 +993,18 @@ nsHTMLElementFactory::~nsHTMLElementFactory()
{
}
-NS_IMPL_ISUPPORTS(nsHTMLElementFactory, kIHTMLElementFactoryIID);
+NS_IMPL_ISUPPORTS1(nsHTMLElementFactory, nsIElementFactory);
NS_IMETHODIMP
nsHTMLElementFactory::CreateInstanceByTag(const nsString& aTag,
- nsIHTMLContent** aResult)
+ nsIContent** aResult)
{
nsresult rv;
- rv = NS_CreateHTMLElement(aResult, aTag);
+ nsCOMPtr htmlContent;
+ rv = NS_CreateHTMLElement(getter_AddRefs(htmlContent), aTag);
+ nsCOMPtr content = do_QueryInterface(htmlContent);
+ *aResult = content;
+ NS_IF_ADDREF(*aResult);
return rv;
}
diff --git a/mozilla/layout/html/document/public/MANIFEST b/mozilla/layout/html/document/public/MANIFEST
index 96630fd8881..f24dbe43025 100644
--- a/mozilla/layout/html/document/public/MANIFEST
+++ b/mozilla/layout/html/document/public/MANIFEST
@@ -1,4 +1,3 @@
#
# This is a list of local files which get copied to the mozilla:dist:layout directory
#
-nsIHTMLElementFactory.h
diff --git a/mozilla/layout/html/document/public/Makefile.in b/mozilla/layout/html/document/public/Makefile.in
index 27f750ed39d..a90b1d8c5e0 100644
--- a/mozilla/layout/html/document/public/Makefile.in
+++ b/mozilla/layout/html/document/public/Makefile.in
@@ -28,8 +28,5 @@ include $(DEPTH)/config/autoconf.mk
MODULE = layout
-EXPORTS = nsIHTMLElementFactory.h
-EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
-
include $(topsrcdir)/config/rules.mk
diff --git a/mozilla/layout/html/document/public/makefile.win b/mozilla/layout/html/document/public/makefile.win
index 9b414313d12..aa266a181f9 100644
--- a/mozilla/layout/html/document/public/makefile.win
+++ b/mozilla/layout/html/document/public/makefile.win
@@ -22,7 +22,6 @@
DEPTH=..\..\..\..
EXPORTS = \
- nsIHTMLElementFactory.h \
$(NULL)
MODULE=raptor
diff --git a/mozilla/layout/html/document/public/nsIHTMLElementFactory.h b/mozilla/layout/html/document/public/nsIHTMLElementFactory.h
deleted file mode 100644
index 3f7e1cb33e5..00000000000
--- a/mozilla/layout/html/document/public/nsIHTMLElementFactory.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * The contents of this file are subject to the Netscape Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/NPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is Mozilla Communicator client code.
- *
- * The Initial Developer of the Original Code is Netscape Communications
- * Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):
- */
-#ifndef nsIHTMLElementFactory_h___
-#define nsIHTMLElementFactory_h___
-
-#include "nslayout.h"
-#include "nsISupports.h"
-
-class nsIHTMLContent;
-class nsString;
-
-/* a6cf90fb-15b3-11d2-932e-00805f8add32 */
-#define NS_IHTML_ELEMENT_FACTORY_IID \
- { 0xa6cf90fb, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
-
-/**
- * An API for creating html content objects
- */
-class nsIHTMLElementFactory : public nsISupports {
-public:
- static const nsIID& GetIID() { static nsIID iid = NS_IHTML_ELEMENT_FACTORY_IID; return iid; }
-
- NS_IMETHOD CreateInstanceByTag(const nsString& aTag,
- nsIHTMLContent** aResult) = 0;
-};
-
-#endif /* nsIHTMLElementFactory_h___ */
diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
index 3006c839edd..d7d55c7f697 100644
--- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
+++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
@@ -43,7 +43,7 @@
#include "prlog.h"
#include "nsHTMLParts.h"
-#include "nsIHTMLElementFactory.h"
+#include "nsIElementFactory.h"
#include "nsITextContent.h"
#include "nsIDOMText.h"
@@ -958,9 +958,7 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult, PRInt32 aID)
//----------------------------------------------------------------------
-static NS_DEFINE_IID(kIHTMLElementFactoryIID, NS_IHTML_ELEMENT_FACTORY_IID);
-
-class nsHTMLElementFactory : public nsIHTMLElementFactory {
+class nsHTMLElementFactory : public nsIElementFactory {
public:
nsHTMLElementFactory();
virtual ~nsHTMLElementFactory();
@@ -968,11 +966,11 @@ public:
NS_DECL_ISUPPORTS
NS_IMETHOD CreateInstanceByTag(const nsString& aTag,
- nsIHTMLContent** aResult);
+ nsIContent** aResult);
};
nsresult
-NS_NewHTMLElementFactory(nsIHTMLElementFactory** aInstancePtrResult)
+NS_NewHTMLElementFactory(nsIElementFactory** aInstancePtrResult)
{
NS_PRECONDITION(aInstancePtrResult, "null OUT ptr");
if (!aInstancePtrResult) {
@@ -982,7 +980,7 @@ NS_NewHTMLElementFactory(nsIHTMLElementFactory** aInstancePtrResult)
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
- return it->QueryInterface(kIHTMLElementFactoryIID,
+ return it->QueryInterface(nsIElementFactory::GetIID(),
(void**)aInstancePtrResult);
}
@@ -995,14 +993,18 @@ nsHTMLElementFactory::~nsHTMLElementFactory()
{
}
-NS_IMPL_ISUPPORTS(nsHTMLElementFactory, kIHTMLElementFactoryIID);
+NS_IMPL_ISUPPORTS1(nsHTMLElementFactory, nsIElementFactory);
NS_IMETHODIMP
nsHTMLElementFactory::CreateInstanceByTag(const nsString& aTag,
- nsIHTMLContent** aResult)
+ nsIContent** aResult)
{
nsresult rv;
- rv = NS_CreateHTMLElement(aResult, aTag);
+ nsCOMPtr htmlContent;
+ rv = NS_CreateHTMLElement(getter_AddRefs(htmlContent), aTag);
+ nsCOMPtr content = do_QueryInterface(htmlContent);
+ *aResult = content;
+ NS_IF_ADDREF(*aResult);
return rv;
}