Implemented the correct content model for the TITLE element and allowed for dynamic change.

git-svn-id: svn://10.0.0.236/trunk@21050 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
vidur%netscape.com
1999-02-17 23:56:55 +00:00
parent d44ee154e4
commit 0556407675
4 changed files with 140 additions and 14 deletions

View File

@@ -1603,11 +1603,18 @@ HTMLContentSink::SetTitle(const nsString& aValue)
nsIHTMLContent* it = nsnull;
nsresult rv = NS_NewHTMLTitleElement(&it, atom);
if (NS_OK == rv) {
nsIDOMHTMLTitleElement* domtitle = nsnull;
it->QueryInterface(kIDOMHTMLTitleElementIID, (void**) &domtitle);
if (nsnull != domtitle) {
domtitle->SetText(aValue);
NS_RELEASE(domtitle);
nsIContent* text;
rv = NS_NewTextNode(&text);
if (NS_OK == rv) {
nsIDOMText* tc;
rv = text->QueryInterface(kIDOMTextIID, (void**)&tc);
if (NS_OK == rv) {
tc->SetData(aValue);
NS_RELEASE(tc);
}
it->AppendChildTo(text, PR_FALSE);
text->SetDocument(mDocument, PR_FALSE);
NS_RELEASE(text);
}
mHead->AppendChildTo(it, PR_FALSE);
NS_RELEASE(it);