Backed out changeset 409285b3f69c (bug 862092) for mochitest-2 failures on a CLOSED TREE.

This commit is contained in:
Ryan VanderMeulen 2013-04-17 11:48:34 -04:00
Родитель 9f4b6ef454
Коммит 78dad25bc3
5 изменённых файлов: 9 добавлений и 90 удалений

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

@ -1492,8 +1492,6 @@ ReparentWrapper(JSContext* aCx, JS::HandleObject aObjArg)
js::SetReservedSlot(newobj, DOM_OBJECT_SLOT,
js::GetReservedSlot(aObj, DOM_OBJECT_SLOT));
bool isProxy = js::IsProxy(aObj);
// At this point, both |aObj| and |newobj| point to the same native
// which is bad, because one of them will end up being finalized with a
// native it does not own. |cloneGuard| ensures that if we exit before
@ -1504,26 +1502,15 @@ ReparentWrapper(JSContext* aCx, JS::HandleObject aObjArg)
{
AutoCloneDOMObjectSlotGuard cloneGuard(aObj, newobj);
JSObject* copyFrom;
if (isProxy) {
copyFrom = DOMProxyHandler::GetExpandoObject(aObj);
} else {
copyFrom = aObj;
}
if (copyFrom) {
propertyHolder = JS_NewObjectWithGivenProto(aCx, nullptr, nullptr,
newParent);
if (!propertyHolder) {
return NS_ERROR_OUT_OF_MEMORY;
}
if (!JS_CopyPropertiesFrom(aCx, propertyHolder, copyFrom)) {
if (!JS_CopyPropertiesFrom(aCx, propertyHolder, aObj)) {
return NS_ERROR_FAILURE;
}
} else {
propertyHolder = nullptr;
}
// Expandos from other compartments are attached to the target JS object.
// Copy them over, and let the old ones die a natural death.
@ -1571,19 +1558,9 @@ ReparentWrapper(JSContext* aCx, JS::HandleObject aObjArg)
cache->SetPreservingWrapper(false);
cache->SetWrapper(aObj);
cache->SetPreservingWrapper(preserving);
if (propertyHolder) {
JSObject* copyTo;
if (isProxy) {
copyTo = DOMProxyHandler::EnsureExpandoObject(aCx, aObj);
} else {
copyTo = aObj;
}
if (!copyTo || !JS_CopyPropertiesFrom(aCx, copyTo, propertyHolder)) {
if (!JS_CopyPropertiesFrom(aCx, aObj, propertyHolder)) {
MOZ_CRASH();
}
}
nsObjectLoadingContent* htmlobject;
nsresult rv = UnwrapObject<HTMLObjectElement>(aCx, aObj, htmlobject);

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

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script>
function boom()
{
var frameDoc = document.getElementById("f").contentDocument;
frameDoc.adoptNode(document.createElement("select"));
}
</script>
</head>
<body onload="boom();">
<iframe id="f"></iframe>
</body>
</html>

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

@ -4,4 +4,3 @@ load 822340-2.html
load 832899.html
load 860591.html
load 860551.html
load 862092.html

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

@ -72,7 +72,6 @@ MOCHITEST_FILES := \
test_queryInterface.html \
test_exceptionThrowing.html \
test_bug852846.html \
test_bug862092.html \
$(NULL)
MOCHITEST_CHROME_FILES = \

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

@ -1,37 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=862092
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 862092</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 862092 **/
SimpleTest.waitForExplicitFinish();
function runTest()
{
var frameDoc = document.getElementById("f").contentDocument;
var a = document.createElement("select");
a.expando = "test";
a = frameDoc.adoptNode(a)
is(a.expando, "test", "adoptNode needs to preserve expandos");
SimpleTest.finish();
}
</script>
</head>
<body onload="runTest();">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=862092">Mozilla Bug 862092</a>
<p id="display"></p>
<div id="content" style="display: none">
<iframe id="f"></iframe>
</div>
<pre id="test">
</pre>
</body>
</html>