Added nsDocumentFragment to build. Fixed bug 1256 - the content sink is flushed as soon as it encounters a script tag.

git-svn-id: svn://10.0.0.236/trunk@15407 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
vidur%netscape.com
1998-11-28 23:51:06 +00:00
parent e7ca2be12c
commit bf493acab1
9 changed files with 450 additions and 49 deletions

View File

@@ -247,6 +247,7 @@ public:
nsresult GrowStack();
nsresult AddText(const nsString& aText);
nsresult FlushText(PRBool* aDidFlush = nsnull);
nsresult FlushTags();
void MaybeMarkSinkDirty();
@@ -1150,6 +1151,29 @@ SinkContext::AddText(const nsString& aText)
return NS_OK;
}
/**
* Flush all elements that have been seen so far such that
* they are visible in the tree. Specifically, make sure
* that they are all added to their respective parents.
*/
nsresult
SinkContext::FlushTags()
{
FlushText();
PRInt32 stackPos = mStackPos-1;
while ((stackPos > 0) && (0 == (mStack[stackPos].mFlags & APPENDED))) {
nsIHTMLContent* content = mStack[stackPos].mContent;
nsIHTMLContent* parent = mStack[stackPos-1].mContent;
parent->AppendChildTo(content, PR_FALSE);
mStack[stackPos].mFlags |= APPENDED;
stackPos--;
}
return NS_OK;
}
/**
* Flush any buffered text out by creating a text content object and
* adding it to the content.
@@ -2280,7 +2304,9 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
// Otherwise, get the text content of the script tag
script = aNode.GetSkippedContent();
}
mCurrentContext->FlushTags();
if (script != "") {
nsIScriptContextOwner *owner;
nsIScriptContext *context;