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 8a1db6f93bcf8..b85d312c9e9c5 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 @@ -8,7 +8,6 @@ - diff --git a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/css-transition-to-disconnected-document.html b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/css-transition-to-disconnected-document.html index 537edfe9b6170..f5f8e1ccc8d46 100644 --- a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/css-transition-to-disconnected-document.html +++ b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/css-transition-to-disconnected-document.html @@ -35,9 +35,15 @@ item.style.left = "400px"; await new Promise(resolve => item.addEventListener("transitionstart", resolve)); const doc = document.implementation.createHTMLDocument(); - doc.body.moveBefore(item, null); + + // Calling `moveBefore()` on a cross-document element undergoing a + // transition does not move the element, nor alter the transition. + assert_throws_dom("HIERARCHY_REQUEST_ERR", () => { + doc.body.moveBefore(item, null); + }); + await new Promise(resolve => requestAnimationFrame(() => resolve())); - assert_equals(item.getBoundingClientRect().x, 0); + assert_between_inclusive(item.getBoundingClientRect().x, 0, 20); }, "Moving an element with a transition to a disconnected document should reset the transitionm state"); diff --git a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/relevant-mutations.html b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/relevant-mutations.html index 95b770dbef8af..8cf4ba668c776 100644 --- a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/relevant-mutations.html +++ b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/relevant-mutations.html @@ -42,7 +42,7 @@ const picture = document.querySelector('picture'); const source = document.querySelector('source'); - const img = document.createElement('img'); + const img = document.body.appendChild(document.createElement('img')); img.src = '/images/red.png'; t.add_cleanup(() => { diff --git a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/throws-exception.html b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/throws-exception.html new file mode 100644 index 0000000000000..34123c72dfd1b --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/throws-exception.html @@ -0,0 +1,20 @@ + +moveBefore exception conditions + + + + +
+ +