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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user