Implemented DOM document's createTextNode() function, and changed insertBefore()

handler to allow refChild to be null


git-svn-id: svn://10.0.0.236/trunk@1103 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy
1998-05-04 20:34:37 +00:00
parent ea789f09b3
commit c94f8a9104
11 changed files with 91 additions and 52 deletions

View File

@@ -28,9 +28,11 @@
#include "nsIImageMap.h"
#include "nsIHTMLContent.h"
#include "nsIDOMElement.h"
#include "nsIDOMText.h"
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
static NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID);
static NS_DEFINE_IID(kIDOMTextIID, NS_IDOMTEXT_IID);
static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
NS_LAYOUT nsresult
@@ -208,6 +210,18 @@ nsresult nsHTMLDocument::CreateElement(nsString &aTagName,
return rv;
}
nsresult nsHTMLDocument::CreateTextNode(nsString &aData, nsIDOMText** aTextNode)
{
nsIHTMLContent* text = nsnull;
nsresult rv = NS_NewHTMLText(&text, aData, aData.Length());
if (NS_OK == rv) {
rv = text->QueryInterface(kIDOMTextIID, (void**)aTextNode);
}
return rv;
}
//----------------------------------------------------------------------
// Aggregation class to give nsHTMLDocument the nsIHTMLDocument interface