diff --git a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/Node-moveBefore.html b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/Node-moveBefore.html index a23678082669..64a76602d264 100644 --- a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/Node-moveBefore.html +++ b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/Node-moveBefore.html @@ -221,11 +221,22 @@ a.append(b); a.append(c); assert_array_equals(a.childNodes, [b, c]); - assert_equals(a.moveBefore(b, b), b); + assert_equals(a.moveBefore(c, b), undefined, "moveBefore() returns undefined"); + assert_array_equals(a.childNodes, [c, b]); +}, "moveBefore() returns undefined"); + +test(() => { + const a = document.body.appendChild(document.createElement("div")); + const b = document.createElement("div"); + const c = document.createElement("div"); + a.append(b); + a.append(c); + assert_array_equals(a.childNodes, [b, c]); + a.moveBefore(b, b); assert_array_equals(a.childNodes, [b, c]); - assert_equals(a.moveBefore(c, c), c); + a.moveBefore(c, c); assert_array_equals(a.childNodes, [b, c]); -}, "Inserting a node before itself should not move the node"); +}, "Moving a node before itself should not move the node"); test(() => { const disconnectedOrigin = document.createElement('div');