Fix XBL error-handling to not close tags that shouldn't be closed yet (and thus

crash when a PR_Assert in the XML content sink is hit).  Bug 265184, r=bryner,
sr=jst
This commit is contained in:
bzbarsky@mit.edu
2004-12-02 02:15:37 +00:00
parent d45ea7d0b4
commit 687a8c49c9
2 changed files with 20 additions and 1 deletions

View File

@@ -1105,6 +1105,15 @@ nsXMLContentSink::HandleEndElement(const PRUnichar *aName)
nsCOMPtr<nsIContent> content = PopContent();
NS_ASSERTION(content, "failed to pop content");
#ifdef DEBUG
// Check that we're closing the right thing
nsCOMPtr<nsIAtom> debugNameSpacePrefix, debugTagAtom;
SplitXMLName(nsDependentString(aName), getter_AddRefs(debugNameSpacePrefix),
getter_AddRefs(debugTagAtom));
PRInt32 debugNameSpaceID = GetNameSpaceId(debugNameSpacePrefix);
NS_ASSERTION(content->GetNodeInfo()->Equals(debugTagAtom, debugNameSpaceID),
"Wrong element being closed");
#endif
result = CloseElement(content, &appendContent);