From bceef1f7f3e8ad46c70252c0e3ded42a897d3eba Mon Sep 17 00:00:00 2001 From: Jonas Sicking Date: Wed, 22 Sep 2010 16:38:39 -0700 Subject: [PATCH] Back out bug 592829 due to crash. a=backout --- content/base/test/Makefile.in | 1 - content/base/test/test_bug592829.html | 42 ------------------- content/xml/document/src/nsXMLContentSink.cpp | 16 ++++--- content/xml/document/src/nsXMLContentSink.h | 2 +- 4 files changed, 8 insertions(+), 53 deletions(-) delete mode 100644 content/base/test/test_bug592829.html diff --git a/content/base/test/Makefile.in b/content/base/test/Makefile.in index 52440578b256..23ad6dea33c7 100644 --- a/content/base/test/Makefile.in +++ b/content/base/test/Makefile.in @@ -260,7 +260,6 @@ _TEST_FILES1 = test_bug5141.html \ test_bug505783.html \ test_bug457746.html \ test_bug587931.html \ - test_bug592829.html \ test_bug518104.html \ bug457746.sjs \ test_CrossSiteXHR.html \ diff --git a/content/base/test/test_bug592829.html b/content/base/test/test_bug592829.html deleted file mode 100644 index 2d573f5a0970..000000000000 --- a/content/base/test/test_bug592829.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Test for Bug 592829 - - - - - -Mozilla Bug 592829 -
-
-
- - diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index 12ded7c2c30d..39faef537e85 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -871,14 +871,15 @@ nsXMLContentSink::GetCurrentContent() if (mContentStack.Length() == 0) { return nsnull; } - return GetCurrentStackNode()->mContent; + return GetCurrentStackNode().mContent; } -StackNode* +StackNode & nsXMLContentSink::GetCurrentStackNode() { PRInt32 count = mContentStack.Length(); - return count != 0 ? &mContentStack[count-1] : nsnull; + NS_ASSERTION(count > 0, "Bogus Length()"); + return mContentStack[count-1]; } @@ -1115,14 +1116,11 @@ nsXMLContentSink::HandleEndElement(const PRUnichar *aName, FlushText(); - StackNode* sn = GetCurrentStackNode(); - if (!sn) { - return NS_ERROR_UNEXPECTED; - } + StackNode & sn = GetCurrentStackNode(); nsCOMPtr content; - sn->mContent.swap(content); - PRUint32 numFlushed = sn->mNumFlushed; + sn.mContent.swap(content); + PRUint32 numFlushed = sn.mNumFlushed; PopContent(); NS_ASSERTION(content, "failed to pop content"); diff --git a/content/xml/document/src/nsXMLContentSink.h b/content/xml/document/src/nsXMLContentSink.h index 8c455801712f..814d7bd7ccab 100644 --- a/content/xml/document/src/nsXMLContentSink.h +++ b/content/xml/document/src/nsXMLContentSink.h @@ -148,7 +148,7 @@ protected: nsresult AddContentAsLeaf(nsIContent *aContent); nsIContent* GetCurrentContent(); - StackNode* GetCurrentStackNode(); + StackNode & GetCurrentStackNode(); nsresult PushContent(nsIContent *aContent); void PopContent(); PRBool HaveNotifiedForCurrentContent() const;