Fix problem in the formrewrite changes, the new code ends up doing a flush on the document from within DemoteContainer() in the sink which ends up notifying the document about some peices of content more than once. This causes duplicated content on some pages. r=jkeiser@iname.com. sr=myself.

This commit is contained in:
jst%netscape.com 2001-11-02 11:28:20 +00:00
Родитель b5ef014320
Коммит 0b2465e811
1 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -1709,8 +1709,6 @@ SetDocumentInChildrenOf(nsIContent* aContent,
nsresult
SinkContext::DemoteContainer(const nsIParserNode& aNode)
{
mSink->mIsDemotingContainer = PR_TRUE;
nsresult result = NS_OK;
nsHTMLTag nodeType = nsHTMLTag(aNode.GetNodeType());
@ -1748,7 +1746,11 @@ SinkContext::DemoteContainer(const nsIParserNode& aNode)
parent->AppendChildTo(container, PR_FALSE, PR_FALSE);
mSink->mInNotification--;
}
// Set mIsDemotingContainer here so that the above FlushTags()
// calls really flushes the tags.
mSink->mIsDemotingContainer = PR_TRUE;
// Create a temp layoutHistoryState to store the childrens' state
nsCOMPtr<nsIPresShell> presShell;
nsCOMPtr<nsIPresContext> presContext;
@ -2132,6 +2134,11 @@ SinkContext::AddText(const nsAReadableString& aText)
nsresult
SinkContext::FlushTags(PRBool aNotify)
{
// If we're demoting containers right now, don't flush.
if (mSink->mIsDemotingContainer) {
return NS_OK;
}
nsresult result = NS_OK;
// Don't release last text node in case we need to add to it again