From 186218b2653e8aebfeb5ab06f0f58b9a7e32f09c Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 1 Mar 2016 03:12:44 +0100 Subject: [PATCH] Fix the Node.replaceChild tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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". --- .../wpt/metadata/dom/nodes/Node-replaceChild.html.ini | 5 ----- .../dom/nodes/Node-replaceChild.html | 11 +++++------ 2 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 tests/wpt/metadata/dom/nodes/Node-replaceChild.html.ini 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 @@ -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);