зеркало из https://github.com/mozilla/gecko-dev.git
Bug 467123 - Document.cloneNode() failed in a JS component, r+sr=bz
This commit is contained in:
Родитель
88b6c463de
Коммит
65516d2348
|
@ -7347,8 +7347,7 @@ nsDocument::CloneDocHelper(nsDocument* clone) const
|
|||
clone->nsDocument::SetDocumentURI(nsIDocument::GetDocumentURI());
|
||||
// Must set the principal first, since SetBaseURI checks it.
|
||||
clone->SetPrincipal(NodePrincipal());
|
||||
rv = clone->SetBaseURI(nsIDocument::GetBaseURI());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
clone->mDocumentBaseURI = mDocumentBaseURI;
|
||||
|
||||
// Set scripting object
|
||||
PRBool hasHadScriptObject = PR_TRUE;
|
||||
|
|
|
@ -51,6 +51,7 @@ _CHROME_FILES = \
|
|||
test_bug421622.xul \
|
||||
test_bug429785.xul \
|
||||
test_bug430050.xul \
|
||||
test_bug467123.xul \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=467123
|
||||
-->
|
||||
<window title="Mozilla Bug 467123"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<!-- test results are displayed in the html:body -->
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=467123"
|
||||
target="_blank">Mozilla Bug 467123</a>
|
||||
</body>
|
||||
|
||||
<!-- test code goes here -->
|
||||
<script type="application/javascript"><![CDATA[
|
||||
|
||||
/** Test for Bug 467123 **/
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "chrome://global/content/bindings/button.xml", false);
|
||||
xhr.send();
|
||||
ok(xhr.responseXML, "We should have response document!");
|
||||
var e = null;
|
||||
try {
|
||||
var clone = xhr.responseXML.cloneNode(true);
|
||||
} catch (ex) {
|
||||
e = ex;
|
||||
}
|
||||
ok(!e, e);
|
||||
]]></script>
|
||||
</window>
|
Загрузка…
Ссылка в новой задаче