Backout bug 378866, the patch doesn't handle all testcases :(

This commit is contained in:
Olli.Pettay@helsinki.fi 2007-08-03 06:06:05 -07:00
Родитель 818fac589b
Коммит 262f32eef7
3 изменённых файлов: 2 добавлений и 86 удалений

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

@ -3218,12 +3218,8 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
if (oldParent) { if (oldParent) {
PRInt32 removeIndex = oldParent->IndexOf(newContent); PRInt32 removeIndex = oldParent->IndexOf(newContent);
if (removeIndex < 0 || if (removeIndex < 0) {
!nsContentUtils::IsInSameAnonymousTree(container, newContent)) { // newContent is anonymous. We can't deal with this, so just bail
// newContent is an anonymous child or it is in the anonymous content
// and someone is trying to move it out from the anonymous content or
// to the anonymous content of some other binding.
// We can't deal with this, so just bail
return NS_ERROR_DOM_NOT_SUPPORTED_ERR; return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
} }

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

@ -85,7 +85,6 @@ _TEST_FILES = test_bug5141.html \
test_bug372086.html \ test_bug372086.html \
test_bug373181.xhtml \ test_bug373181.xhtml \
test_bug375314.html \ test_bug375314.html \
test_bug378866.xhtml \
test_bug382113.html \ test_bug382113.html \
bug382113_object.html \ bug382113_object.html \
test_CrossSiteXHR.html \ test_CrossSiteXHR.html \

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

@ -1,79 +0,0 @@
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=378866
-->
<head>
<title>Test for Bug 378866</title>
<bindings xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml">
<binding id="b1">
<content><html:span><html:span>
<children/>
</html:span><html:span></html:span></html:span></content>
</binding>
</bindings>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/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=378866">Mozilla Bug 378866</a>
<p id="display"></p>
<div id="content">
<span id="grandparent" style="-moz-binding: url(#b1);">
<span id="parent">
<span id="child"/>
</span>
</span>
<span id="grandparent2" style="-moz-binding: url(#b1);">
<span id="parent2">
<span id="child2"/>
</span>
</span>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
<![CDATA[
/** Test for Bug 378866 **/
function test() {
var anon = document.getAnonymousNodes(document.getElementById('grandparent'));
var child = document.getElementById('child');
var appendedAnonymousContent = true;
try {
child.appendChild(anon[0].childNodes[0]);
} catch (e) {
appendedAnonymousContent = false;
}
ok(!appendedAnonymousContent,
"Appending anonymous content to normal content is not supported.");
var anon2 = document.getAnonymousNodes(document.getElementById('grandparent2'));
var anonElementInBinding1 = anon[0].childNodes[1];
var anonElementInBinding2 = anon2[0].childNodes[1];
appendedAnonymousContent = true;
try {
anonElementInBinding1.appendChild(anonElementInBinding2);
} catch (e) {
appendedAnonymousContent = false;
}
ok(!appendedAnonymousContent,
"Moving anonymous content from one binding to another is not supported.");
SimpleTest.finish();
}
function startTest() {
setTimeout(test, 100);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(startTest);
]]>
</script>
</pre>
</body>
</html>