mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #9816 - nox:node-replacechild, r=Ms2ger
Fix the Node.replaceChild tests That method first does "if node is a host-including inclusive ancestor of parent, throw a HierarchyRequestError" and only then "if child’s parent is not parent, throw a NotFoundError exception". <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9816) <!-- Reviewable:end -->
This commit is contained in:
commit
f7db68eff7
2 changed files with 5 additions and 11 deletions
|
@ -1,5 +0,0 @@
|
|||
[Node-replaceChild.html]
|
||||
type: testharness
|
||||
[If child's parent is not the context node, a NotFoundError exception should be thrown]
|
||||
expected: FAIL
|
||||
|
|
@ -36,15 +36,9 @@ test(function() {
|
|||
assert_throws("NotFoundError", function() {
|
||||
a.replaceChild(b, c);
|
||||
});
|
||||
assert_throws("NotFoundError", function() {
|
||||
a.replaceChild(a, c);
|
||||
});
|
||||
assert_throws("NotFoundError", function() {
|
||||
a.replaceChild(b, a);
|
||||
});
|
||||
assert_throws("NotFoundError", function() {
|
||||
a.replaceChild(a, a);
|
||||
});
|
||||
}, "If child's parent is not the context node, a NotFoundError exception should be thrown")
|
||||
test(function() {
|
||||
var nodes = [
|
||||
|
@ -67,6 +61,11 @@ test(function() {
|
|||
test(function() {
|
||||
var a = document.createElement("div");
|
||||
var b = document.createElement("div");
|
||||
|
||||
assert_throws("HierarchyRequestError", function() {
|
||||
a.replaceChild(a, a);
|
||||
});
|
||||
|
||||
a.appendChild(b);
|
||||
assert_throws("HierarchyRequestError", function() {
|
||||
a.replaceChild(a, b);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue