зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1345301 - elt.firstChild.remove() doesn't trigger a DOMSubtreeModified event, r=ms2ger
--HG-- extra : rebase_source : 884289e9471d7886661843cb45fe32e9a3514a18
This commit is contained in:
Родитель
0cb7468d61
Коммит
626c1780d1
|
@ -1833,12 +1833,9 @@ nsINode::Remove()
|
|||
if (!parent) {
|
||||
return;
|
||||
}
|
||||
int32_t index = parent->IndexOf(this);
|
||||
if (index < 0) {
|
||||
NS_WARNING("Ignoring call to nsINode::Remove on anonymous child.");
|
||||
return;
|
||||
}
|
||||
parent->RemoveChildAt(uint32_t(index), true);
|
||||
|
||||
IgnoredErrorResult err;
|
||||
parent->RemoveChild(*this, err);
|
||||
}
|
||||
|
||||
Element*
|
||||
|
|
|
@ -62,6 +62,12 @@ function doTest() {
|
|||
is(subtreeModifiedCount, 1,
|
||||
"Removing a child node should have dispatched a DOMSubtreeModified event");
|
||||
|
||||
subtree.innerHTML = s;
|
||||
subtreeModifiedCount = 0;
|
||||
subtree.firstChild.firstChild.remove();
|
||||
is(subtreeModifiedCount, 1,
|
||||
"Removing a child node should have dispatched a DOMSubtreeModified event");
|
||||
|
||||
subtreeModifiedCount = 0;
|
||||
subtree.firstChild.setAttribute("foo", "bar");
|
||||
is(subtreeModifiedCount, 1,
|
||||
|
|
Загрузка…
Ссылка в новой задаче