diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp
index 707b1975484..d1ecdad73e5 100644
--- a/content/html/document/src/nsHTMLContentSink.cpp
+++ b/content/html/document/src/nsHTMLContentSink.cpp
@@ -1193,7 +1193,7 @@ SinkContext::CloseContainer(const nsHTMLTag aTag, PRBool aMalformed)
--mStackPos;
nsHTMLTag nodeType = mStack[mStackPos].mType;
- NS_ASSERTION(nodeType == aTag,
+ NS_ASSERTION(nodeType == eHTMLTag_form || nodeType == aTag,
"Tag mismatch. Closing tag on wrong context or something?");
nsGenericHTMLElement* content = mStack[mStackPos].mContent;