From 61cce0f44731926cea25f9ab9567336e8e712f11 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 12 Dec 2024 14:57:14 +0100 Subject: [PATCH] Editorial: clarify document argument of "clone a node" This argument is only passed recursively or from importNode(). And importNode() does not work for documents, so whenever the node argument is a document, the document argument has to be the node argument. --- dom.bs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dom.bs b/dom.bs index 50c4403c2..798eb0a8b 100644 --- a/dom.bs +++ b/dom.bs @@ -4551,9 +4551,12 @@ steps: dom-Range-extractContents, dom-Range-cloneContents -->
    -
  1. If document is not given, let document be node's +

  2. If document is not given, then set document to node's node document. +

  3. Assert: node is not a document or node is + document. +
  4. If node is an element, then: @@ -4608,9 +4611,7 @@ dom-Range-extractContents, dom-Range-cloneContents -->

    Do nothing. -

  5. Set copy's node document and document to - copy, if copy is a document, and set copy's - node document to document otherwise. +

  6. Set copy's node document to document.

  7. Run any cloning steps defined for node in other applicable specifications and pass copy, node,