diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-01 14:01:18 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-01 14:01:18 +0530 |
commit | f7db68eff7ff670183911871d2d562eb8d98c19e (patch) | |
tree | d4c4439afdd3fc255fe2b5908a418e6db1b2cb3a | |
parent | 00628704ca5f3318a4b97b7586cd17b31eabf5f6 (diff) | |
parent | 186218b2653e8aebfeb5ab06f0f58b9a7e32f09c (diff) | |
download | servo-f7db68eff7ff670183911871d2d562eb8d98c19e.tar.gz servo-f7db68eff7ff670183911871d2d562eb8d98c19e.zip |
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 -->
-rw-r--r-- | tests/wpt/metadata/dom/nodes/Node-replaceChild.html.ini | 5 | ||||
-rw-r--r-- | tests/wpt/web-platform-tests/dom/nodes/Node-replaceChild.html | 11 |
2 files changed, 5 insertions, 11 deletions
diff --git a/tests/wpt/metadata/dom/nodes/Node-replaceChild.html.ini b/tests/wpt/metadata/dom/nodes/Node-replaceChild.html.ini deleted file mode 100644 index e2474e34165..00000000000 --- a/tests/wpt/metadata/dom/nodes/Node-replaceChild.html.ini +++ /dev/null @@ -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 - diff --git a/tests/wpt/web-platform-tests/dom/nodes/Node-replaceChild.html b/tests/wpt/web-platform-tests/dom/nodes/Node-replaceChild.html index 11e2764872d..e8ba496cd01 100644 --- a/tests/wpt/web-platform-tests/dom/nodes/Node-replaceChild.html +++ b/tests/wpt/web-platform-tests/dom/nodes/Node-replaceChild.html @@ -37,14 +37,8 @@ test(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); |