From 87c48ba870a1fcb28b340f53910572dd8d6c8c0b Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Sun, 15 Jun 2003 00:49:57 +0000 Subject: [PATCH] Make

actually close out the form, since

has an optional end tag. Bug 22480, r=harishd, sr=heikki. git-svn-id: svn://10.0.0.236/trunk@143719 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/html/document/src/nsHTMLContentSink.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 92b3e2788f5..ec12230d829 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -3353,9 +3353,14 @@ HTMLContentSink::CloseForm() this); if (mCurrentForm) { + // If there is a

tag on the container stack, close it + if (mCurrentContext->IsCurrentContainer(eHTMLTag_p)) { + result = mCurrentContext->CloseContainer(eHTMLTag_p); + } + // if this is a well-formed form, close it too - if (mCurrentContext->IsCurrentContainer(eHTMLTag_form)) { - mCurrentContext->FlushTextAndRelease(); + if (NS_SUCCEEDED(result) && + mCurrentContext->IsCurrentContainer(eHTMLTag_form)) { result = mCurrentContext->CloseContainer(eHTMLTag_form); mFlags &= ~NS_SINK_FLAG_FORM_ON_STACK; }