From 6e106035e60810b5a18c38d930ea71c8ff439f20 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 17 Oct 2005 02:53:51 +0000 Subject: [PATCH] Make sure to notify for frameset like we do for body. Bug 312097, r=sicking, sr=jst, a=asa git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@182360 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/document/src/nsHTMLContentSink.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index f6795dbf058..cfc77d4eef2 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -2780,6 +2780,26 @@ HTMLContentSink::OpenFrameset(const nsIParserNode& aNode) MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenFrameset()\n")); MOZ_TIMER_STOP(mWatch); + if (mFrameset && mCurrentContext->mStackPos > 1) { + // Have to notify for the frameset now, since we never actually + // close out , so won't notify for it then. + PRInt32 parentIndex = mCurrentContext->mStackPos - 2; + nsGenericHTMLElement *parent = mCurrentContext->mStack[parentIndex].mContent; + PRInt32 numFlushed = mCurrentContext->mStack[parentIndex].mNumFlushed; + PRInt32 insertionPoint = + mCurrentContext->mStack[parentIndex].mInsertionPoint; + + // XXX: I have yet to see a case where numFlushed is non-zero and + // insertionPoint is not -1, but this code will try to handle + // those cases too. + + if (insertionPoint != -1) { + NotifyInsert(parent, mFrameset, insertionPoint - 1); + } else { + NotifyAppend(parent, numFlushed); + } + } + return rv; }