From 995c9866ae4d3341cefd0871278b42b2e021ddbf Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Mon, 16 Dec 2024 00:59:04 +0000 Subject: [PATCH] Bug 1936153 [wpt PR 49603] - DOM: Enable moveBefore() into Document nodes, a=testonly Automatic update from web-platform-tests DOM: Enable moveBefore() into Document nodes See https://github.com/whatwg/dom/pull/1307#pullrequestreview-2458397857. R=nrosenthalchromium.org Bug: 40150299 Change-Id: I01b148f65c9e9c2545e7287ae38eb0e39f57d3d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6081493 Commit-Queue: Dominic Farolino Reviewed-by: Noam Rosenthal Cr-Commit-Position: refs/heads/main{#1394297} -- wpt-commits: 64e219541d6cf8165e11c2625bba82381044075f wpt-pr: 49603 UltraBlame original commit: d964e73cee7b89a9e21d8d4ccb3ffb0a8b5ac913 --- .../moveBefore/tentative/Node-moveBefore.html | 126 +++++++++++++++++- 1 file changed, 120 insertions(+), 6 deletions(-) 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 a3e504f64341..2aea1a9ebc1f 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 @@ -1008,17 +1008,20 @@ parent is not -an +a +Document +DocumentFragment +or Element node then throw a +/ +/ " HierarchyRequestError " -/ -/ DOMException . " @@ -1131,11 +1134,40 @@ case when moving -a -node -into an Element +directly +under +the +/ +/ +document +. +This +is +not +moveBefore +( +) +- +specific +behavior +; +it +is +consistent +/ +/ +with +traditional +Document +insertion +rules +just +like +insertBefore +( +) . iframe . @@ -1171,6 +1203,88 @@ > { const +iframe += +document +. +body +. +appendChild +( +document +. +createElement +( +' +iframe +' +) +) +; +const +comment += +iframe +. +contentDocument +. +createComment +( +" +comment +" +) +; +iframe +. +contentDocument +. +body +. +append +( +comment +) +; +iframe +. +contentDocument +. +moveBefore +( +comment +null +) +; +assert_equals +( +comment +. +parentNode +iframe +. +contentDocument +) +; +} +" +moveBefore +( +) +CharacterData +into +a +Document +" +) +; +test +( +t += +> +{ +const comment = document