From 948658b3d8a80a72e4ab008aad0ec57b27535eee Mon Sep 17 00:00:00 2001 From: Snuggs <rashaunstovall@gmail.com> Date: Fri, 14 Feb 2020 18:23:05 -0500 Subject: [PATCH 1/2] Editorial: Specify `ParentNode.replaceChildren` implementation. References: - https://github.com/whatwg/dom/issues/478 --- dom.bs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dom.bs b/dom.bs index 327614291..66f619d08 100644 --- a/dom.bs +++ b/dom.bs @@ -2793,6 +2793,7 @@ interface mixin ParentNode { [CEReactions, Unscopable] void prepend((Node or DOMString)... nodes); [CEReactions, Unscopable] void append((Node or DOMString)... nodes); + [CEReactions, Unscopable] void replaceChildren((Node or DOMString)... nodes); Element? querySelector(DOMString selectors); [NewObject] NodeList querySelectorAll(DOMString selectors); @@ -2832,6 +2833,15 @@ Element includes ParentNode; the <a>node tree</a> are violated. <!-- "NotFoundError" is impossible --> + <dt><code><var>node</var> . <a method for=ParentNode lt="replaceChildren()">replaceChildren</a>(<var>nodes</var>)</code> + <dd> + <p><a for=Node>Replace all</a> <a>children</a> of <var>node</var> with <var>nodes</var>, + while replacing strings in <var>nodes</var> with equivalent {{Text}} <a for=/>nodes</a>. + + <p><a>Throws</a> a "{{HierarchyRequestError!!exception}}" {{DOMException}} if the constraints of + the <a>node tree</a> are violated. + <!-- "NotFoundError" is impossible --> + <dt><code><var>node</var> . <a method for=ParentNode lt="querySelector()">querySelector</a>(<var>selectors</var>)</code> <dd> Returns the first <a for="/">element</a> that is a @@ -2879,6 +2889,16 @@ must run these steps: <li><p><a>Append</a> <var>node</var> to <a>this</a>. </ol> +<p>The <dfn method for=ParentNode><code>replaceChildren(<var>nodes</var>)</code></dfn> method, when invoked, +must run these steps: + +<ol> + <li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a> given + <var>nodes</var> and <a>this</a>'s <a for=Node>node document</a>. + + <li><a for=Node>Replace all</a> <a>children</a> of <a>this</a> with <var>node</var>. +</ol> + <p>The <dfn method for=ParentNode><code>querySelector(<var>selectors</var>)</code></dfn> method, when invoked, must return the first result of running <a>scope-match a selectors string</a> <var>selectors</var> against <a>this</a>, if the result is not an empty list, and null otherwise. From 51fa48f107360840492845292e23cfdb50b0f2c1 Mon Sep 17 00:00:00 2001 From: Ahmid <rashaunstovall@gmail.com> Date: Mon, 17 Feb 2020 21:12:02 -0500 Subject: [PATCH 2/2] Add missing `<p>` within list item. Co-Authored-By: Anne van Kesteren <annevk@annevk.nl> --- dom.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom.bs b/dom.bs index 66f619d08..fd0d7d384 100644 --- a/dom.bs +++ b/dom.bs @@ -2896,7 +2896,7 @@ must run these steps: <li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a> given <var>nodes</var> and <a>this</a>'s <a for=Node>node document</a>. - <li><a for=Node>Replace all</a> <a>children</a> of <a>this</a> with <var>node</var>. + <li><p><a for=Node>Replace all</a> <a>children</a> of <a>this</a> with <var>node</var>. </ol> <p>The <dfn method for=ParentNode><code>querySelector(<var>selectors</var>)</code></dfn> method,