зеркало из https://github.com/mozilla/gecko-dev.git
Backout bug 378866, the patch doesn't handle all testcases :(
This commit is contained in:
Родитель
818fac589b
Коммит
262f32eef7
|
@ -3218,12 +3218,8 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
|
|||
if (oldParent) {
|
||||
PRInt32 removeIndex = oldParent->IndexOf(newContent);
|
||||
|
||||
if (removeIndex < 0 ||
|
||||
!nsContentUtils::IsInSameAnonymousTree(container, newContent)) {
|
||||
// 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
|
||||
if (removeIndex < 0) {
|
||||
// newContent is anonymous. We can't deal with this, so just bail
|
||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,6 @@ _TEST_FILES = test_bug5141.html \
|
|||
test_bug372086.html \
|
||||
test_bug373181.xhtml \
|
||||
test_bug375314.html \
|
||||
test_bug378866.xhtml \
|
||||
test_bug382113.html \
|
||||
bug382113_object.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>
|
||||
|
Загрузка…
Ссылка в новой задаче