Create head part and insert it into the model

git-svn-id: svn://10.0.0.236/trunk@3263 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp
1998-06-04 21:33:44 +00:00
parent 5beabd3a5c
commit 5669e4858d
2 changed files with 28 additions and 2 deletions

View File

@@ -206,6 +206,7 @@ protected:
nsIHTMLContent* mRoot;
nsIHTMLContent* mBody;
nsIHTMLContent* mHead;
PRTime mLastUpdateTime;
PRTime mUpdateDelta;
@@ -228,6 +229,7 @@ HTMLContentSink::HTMLContentSink()
HTMLContentSink::~HTMLContentSink()
{
NS_IF_RELEASE(mHead);
NS_IF_RELEASE(mBody);
NS_IF_RELEASE(mRoot);
NS_IF_RELEASE(mDocument);
@@ -291,7 +293,18 @@ PRInt32 HTMLContentSink::OpenHead(const nsIParserNode& aNode)
{
NOISY_SINK_TRACE("OpenHead", aNode)
mNodeStack[mStackPos++] = (eHTMLTags)aNode.GetNodeType();
if (nsnull == mHead) {
nsIAtom* atom = NS_NewAtom("HEAD");
nsresult rv = NS_NewHTMLHead(&mHead, atom);
if (NS_OK == rv) {
mRoot->InsertChildAt(mHead, 0, PR_FALSE);
}
NS_RELEASE(atom);
}
mNodeStack[mStackPos] = (eHTMLTags)aNode.GetNodeType();
mContainerStack[mStackPos] = mHead;
mStackPos++;
return 0;
}

View File

@@ -206,6 +206,7 @@ protected:
nsIHTMLContent* mRoot;
nsIHTMLContent* mBody;
nsIHTMLContent* mHead;
PRTime mLastUpdateTime;
PRTime mUpdateDelta;
@@ -228,6 +229,7 @@ HTMLContentSink::HTMLContentSink()
HTMLContentSink::~HTMLContentSink()
{
NS_IF_RELEASE(mHead);
NS_IF_RELEASE(mBody);
NS_IF_RELEASE(mRoot);
NS_IF_RELEASE(mDocument);
@@ -291,7 +293,18 @@ PRInt32 HTMLContentSink::OpenHead(const nsIParserNode& aNode)
{
NOISY_SINK_TRACE("OpenHead", aNode)
mNodeStack[mStackPos++] = (eHTMLTags)aNode.GetNodeType();
if (nsnull == mHead) {
nsIAtom* atom = NS_NewAtom("HEAD");
nsresult rv = NS_NewHTMLHead(&mHead, atom);
if (NS_OK == rv) {
mRoot->InsertChildAt(mHead, 0, PR_FALSE);
}
NS_RELEASE(atom);
}
mNodeStack[mStackPos] = (eHTMLTags)aNode.GetNodeType();
mContainerStack[mStackPos] = mHead;
mStackPos++;
return 0;
}