Back out bug 592829 due to crash. a=backout

This commit is contained in:
Jonas Sicking 2010-09-22 16:38:39 -07:00
Родитель a0165b6e74
Коммит bceef1f7f3
4 изменённых файлов: 8 добавлений и 53 удалений

Просмотреть файл

@ -260,7 +260,6 @@ _TEST_FILES1 = test_bug5141.html \
test_bug505783.html \ test_bug505783.html \
test_bug457746.html \ test_bug457746.html \
test_bug587931.html \ test_bug587931.html \
test_bug592829.html \
test_bug518104.html \ test_bug518104.html \
bug457746.sjs \ bug457746.sjs \
test_CrossSiteXHR.html \ test_CrossSiteXHR.html \

Просмотреть файл

@ -1,42 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=592829
-->
<head>
<title>Test for Bug 592829</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=592829">Mozilla Bug 592829</a>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 592829 **/
// NOTE! It's imperative that we don't call .init() here. Otherwise we're not
// testing what happens if parsing fails.
// If we ever change how DOMParser initilization works, just update this code
// to create a DOMParser which is not allowed to parse XUL.
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var isXUL = true;
try {
var x =
Components.classes["@mozilla.org/xmlextras/domparser;1"]
.getService(Components.interfaces.nsIDOMParser)
.parseFromString('<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>', "text/xml");
isXUL = x.documentElement.namespaceURI ==
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
}
catch (ex) {
isXUL = false;
}
is(isXUL, false, "We didn't create XUL and we didn't crash!");
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -871,14 +871,15 @@ nsXMLContentSink::GetCurrentContent()
if (mContentStack.Length() == 0) { if (mContentStack.Length() == 0) {
return nsnull; return nsnull;
} }
return GetCurrentStackNode()->mContent; return GetCurrentStackNode().mContent;
} }
StackNode* StackNode &
nsXMLContentSink::GetCurrentStackNode() nsXMLContentSink::GetCurrentStackNode()
{ {
PRInt32 count = mContentStack.Length(); 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(); FlushText();
StackNode* sn = GetCurrentStackNode(); StackNode & sn = GetCurrentStackNode();
if (!sn) {
return NS_ERROR_UNEXPECTED;
}
nsCOMPtr<nsIContent> content; nsCOMPtr<nsIContent> content;
sn->mContent.swap(content); sn.mContent.swap(content);
PRUint32 numFlushed = sn->mNumFlushed; PRUint32 numFlushed = sn.mNumFlushed;
PopContent(); PopContent();
NS_ASSERTION(content, "failed to pop content"); NS_ASSERTION(content, "failed to pop content");

Просмотреть файл

@ -148,7 +148,7 @@ protected:
nsresult AddContentAsLeaf(nsIContent *aContent); nsresult AddContentAsLeaf(nsIContent *aContent);
nsIContent* GetCurrentContent(); nsIContent* GetCurrentContent();
StackNode* GetCurrentStackNode(); StackNode & GetCurrentStackNode();
nsresult PushContent(nsIContent *aContent); nsresult PushContent(nsIContent *aContent);
void PopContent(); void PopContent();
PRBool HaveNotifiedForCurrentContent() const; PRBool HaveNotifiedForCurrentContent() const;