Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Trusted Types integration for "converting nodes into a node"" #1299

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 21 additions & 49 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ spec:html; type:element
<p>This specification depends on the Infra Standard. [[!INFRA]]

<p>Some of the terms used in this specification are defined in <cite>Encoding</cite>,
<cite>Selectors</cite>, <cite>Trusted Types</cite>, <cite>Web IDL</cite>, <cite>XML</cite>, and
<cite>Namespaces in XML</cite>.
<cite>Selectors</cite>, <cite>Web IDL</cite>, <cite>XML</cite>, and <cite>Namespaces in XML</cite>.
[[!ENCODING]]
[[!SELECTORS4]]
[[!TRUSTED-TYPES]]
[[!WEBIDL]]
[[!XML]]
[[!XML-NAMES]]
Expand Down Expand Up @@ -3120,9 +3118,8 @@ standards that want to define APIs shared between <a for=/>documents</a> and

<h4 id=interface-parentnode>Mixin {{ParentNode}}</h4>

<p>To <dfn export lt="converting nodes into a node">convert nodes into a node</dfn>, given a
<a for=/>node</a> <var>parent</var>, <a for=/>list</a> of <a for=/>nodes</a> <var>nodes</var>, and
<a for=/>document</a> <var>document</var>:
<p>To <dfn export lt="converting nodes into a node">convert nodes into a node</dfn>, given
<var>nodes</var> and <var>document</var>, run these steps:

<ol>
<li><p>Let <var>node</var> be null.
Expand All @@ -3131,37 +3128,12 @@ standards that want to define APIs shared between <a for=/>documents</a> and
<a for=CharacterData>data</a> is the string and <a for=Node>node document</a> is
<var>document</var>.

<li><p>Let <var>isScriptElement</var> be true if <var>parent</var> is an {{HTMLScriptElement}}
<a for=/>node</a>; otherwise false.

<li><p>Let <var>newNodes</var> be « ».

<li>
<p><a for=list>For each</a> <var>value</var> of <var>nodes</var>:

<ol>
<li><p>Let <var>newValue</var> be <var>value</var>.

<li><p>If <var>value</var> is a {{Text}} <a for=/>node</a> and <var>isScriptElement</var> is
true, then set <var>newValue</var> to a new {{Text}} <a for=/>node</a> whose
<a for=Node>node document</a> is <var>document</var> and <a for=CharacterData>data</a> is the
result of calling <a abstract-op>Get Trusted Type compliant string</a>, with {{TrustedScript}},
<var>document</var>'s <a>relevant global object</a>, <var>value</var>'s
<a for=CharacterData>data</a>, "<code>HTMLScriptElement text</code>", and "<code>script</code>".

<li><p>If <var>value</var> is a {{TrustedScript}}, then set <var>newValue</var> to a new {{Text}}
<a for=/>node</a> whose <a for=CharacterData>data</a> is <var>value</var>'s
<a for=TrustedScript>data</a> and <a for=Node>node document</a> is <var>document</var>.

<li><p><a for=list>Append</a> <var>newValue</var> to <var>newNodes</var>.
</ol>

<li><p>If <var>newNodes</var> contains one <a for=/>node</a>, then set <var>node</var> to
<var>newNodes</var>[0].
<li><p>If <var>nodes</var> contains one <a for=/>node</a>, then set <var>node</var> to
<var>nodes</var>[0].

<li><p>Otherwise, set <var>node</var> to a new {{DocumentFragment}} <a for=/>node</a> whose
<a for=Node>node document</a> is <var>document</var>, and then <a>append</a> each <a for=/>node</a>
in <var>newNodes</var>, if any, to it.
in <var>nodes</var>, if any, to it.

<li><p>Return <var>node</var>.
</ol>
Expand All @@ -3173,9 +3145,9 @@ interface mixin ParentNode {
readonly attribute Element? lastElementChild;
readonly attribute unsigned long childElementCount;

[CEReactions, Unscopable] undefined prepend((Node or TrustedScript or DOMString)... nodes);
[CEReactions, Unscopable] undefined append((Node or TrustedScript or DOMString)... nodes);
[CEReactions, Unscopable] undefined replaceChildren((Node or TrustedScript or DOMString)... nodes);
[CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined append((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes);

Element? querySelector(DOMString selectors);
[NewObject] NodeList querySelectorAll(DOMString selectors);
Expand Down Expand Up @@ -3249,8 +3221,8 @@ the number of <a for=tree>children</a> of <a>this</a> that are <a for=/>elements
<p>The <dfn method for=ParentNode><code>prepend(<var>nodes</var>)</code></dfn> method steps are:

<ol>
<li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a> given <a>this</a>,
<var>nodes</var>, and <a>this</a>'s <a for=Node>node document</a>.
<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><p><a>Pre-insert</a> <var>node</var> into <a>this</a> before <a>this</a>'s
<a for=tree>first child</a>.
Expand All @@ -3259,8 +3231,8 @@ the number of <a for=tree>children</a> of <a>this</a> that are <a for=/>elements
<p>The <dfn method for=ParentNode><code>append(<var>nodes</var>)</code></dfn> method steps are:

<ol>
<li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a> given <a>this</a>,
<var>nodes</var>, and <a>this</a>'s <a for=Node>node document</a>.
<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><p><a>Append</a> <var>node</var> to <a>this</a>.
</ol>
Expand All @@ -3269,8 +3241,8 @@ the number of <a for=tree>children</a> of <a>this</a> that are <a for=/>elements
are:

<ol>
<li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a> given <a>this</a>,
<var>nodes</var>, and <a>this</a>'s <a for=Node>node document</a>.
<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><p><a>Ensure pre-insertion validity</a> of <var>node</var> into <a>this</a> before
null.
Expand Down Expand Up @@ -3325,9 +3297,9 @@ steps are to return the first <a>following</a> <a for=tree>sibling</a> that is a

<pre class=idl>
interface mixin ChildNode {
[CEReactions, Unscopable] undefined before((Node or TrustedScript or DOMString)... nodes);
[CEReactions, Unscopable] undefined after((Node or TrustedScript or DOMString)... nodes);
[CEReactions, Unscopable] undefined replaceWith((Node or TrustedScript or DOMString)... nodes);
[CEReactions, Unscopable] undefined before((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined after((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined replaceWith((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined remove();
};
DocumentType includes ChildNode;
Expand Down Expand Up @@ -3375,7 +3347,7 @@ CharacterData includes ChildNode;
<a for=tree>sibling</a> not in <var>nodes</var>; otherwise null.

<li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a>, given
<var>parent</var>, <var>nodes</var>, and <a>this</a>'s <a for=Node>node document</a>.
<var>nodes</var> and <a>this</a>'s <a for=Node>node document</a>.

<li><p>If <var>viablePreviousSibling</var> is null, then set it to <var>parent</var>'s
<a for=tree>first child</a>; otherwise to <var>viablePreviousSibling</var>'s
Expand All @@ -3396,7 +3368,7 @@ CharacterData includes ChildNode;
<a for=tree>sibling</a> not in <var>nodes</var>; otherwise null.

<li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a>, given
<var>parent</var>, <var>nodes</var>, and <a>this</a>'s <a for=Node>node document</a>.
<var>nodes</var> and <a>this</a>'s <a for=Node>node document</a>.

<li><p><a>Pre-insert</a> <var>node</var> into <var>parent</var> before
<var>viableNextSibling</var>.
Expand All @@ -3413,7 +3385,7 @@ CharacterData includes ChildNode;
<a for=tree>sibling</a> not in <var>nodes</var>; otherwise null.

<li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a>, given
<var>parent</var>, <var>nodes</var>, and <a>this</a>'s <a for=Node>node document</a>.
<var>nodes</var> and <a>this</a>'s <a for=Node>node document</a>.

<li>
<p>If <a>this</a>'s <a for=tree>parent</a> is <var>parent</var>, <a>replace</a> <a>this</a> with
Expand Down
Loading