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

Add Imperative Slot API #6561

Merged
merged 6 commits into from
Apr 14, 2021
Merged
Changes from 1 commit
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
20 changes: 9 additions & 11 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x-href="https://infra.spec.whatwg.org/#list">list</dfn> data structure and the associated definitions for
<dfn data-x="list append" data-x-href="https://infra.spec.whatwg.org/#list-append">append</dfn>,
<dfn data-x="list extend" data-x-href="https://infra.spec.whatwg.org/#list-extend">extend</dfn>,
<dfn data-x="list replace" data-x-href="https://infra.spec.whatwg.org/#list-remove">replace</dfn>,
<dfn data-x="list replace" data-x-href="https://infra.spec.whatwg.org/#list-replace">replace</dfn>,
<dfn data-x="list remove" data-x-href="https://infra.spec.whatwg.org/#list-remove">remove</dfn>,
<dfn data-x="list empty" data-x-href="https://infra.spec.whatwg.org/#list-empty">empty</dfn>,
<dfn data-x="list contains" data-x-href="https://infra.spec.whatwg.org/#list-contain">contains</dfn>,
Expand Down Expand Up @@ -59530,6 +59530,11 @@ dictionary <dfn dictionary>AssignedNodesOptions</dfn> {
<p>The <dfn data-x="dom-slot-name"><code>name</code></dfn> IDL attribute must <span>reflect</span>
the content attribute of the same name.</p>

<p>The <code>slot</code> element has <dfn export for="HTMLSlotElement">manually assigned
nodes</dfn>, which is an <span data-x="set">ordered set</span> of <span
data-x="slottable">slottables</span> set by <code data-x="dom-slot-assign">assign()</code>. It is
initially empty.</p>

<p>The <dfn data-x="dom-slot-assignedNodes"><code>assignedNodes(<var>options</var>)</code></dfn>
method steps are:</p>

Expand All @@ -59554,11 +59559,6 @@ dictionary <dfn dictionary>AssignedNodesOptions</dfn> {
filtered to contain only <code>Element</code> nodes.</p></li>
</ol>

<p>The <code>slot</code> element has <dfn export for="HTMLSlotElement">manually assigned
nodes</dfn>, which is an <span data-x="set">ordered set</span> of <span
data-x="slottable">slottables</span> set by <code data-x="dom-slot-assign">assign()</code>. It is
initially empty.</p>

<p>The <dfn method for="HTMLSlotElement"
data-x="dom-slot-assign"><code>assign(...<var>nodes</var>)</code></dfn> method steps are:</p>

Expand All @@ -59567,11 +59567,6 @@ dictionary <dfn dictionary>AssignedNodesOptions</dfn> {
<span>slot assignment</span> is not "<code data-x="">manual</code>", then throw a
<span>"<code>NotAllowedError</code>"</span> <code>DOMException</code>.</p></li>

<li><p><span data-x="list iterate">For each</span> <var>node</var> of <var>nodes</var>: if
<var>node</var> is not a <span data-x="concept-tree-child">child</span> of <span>this</span>'s
<span>root</span>'s <span>shadow host</span>, then throw a
<span>"<code>NotAllowedError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>Let <var>nodesSet</var> be a new <span data-x="set">ordered set</span>.</p></li>

<li>
Expand All @@ -59584,6 +59579,9 @@ dictionary <dfn dictionary>AssignedNodesOptions</dfn> {
then <span data-x="list remove">remove</span> <var>node</var> from <var>descendant</var>'s
<span>manually assigned nodes</span>.</p></li>

<li><p>If <var>nodesSet</var> contains <var>node</var>, then <span
data-x="list remove">remove</span> <var>node</var> from <var>nodesSet</var>.</p></li>

<li><p><span data-x="set append">Append</span> <var>node</var> to <var>nodesSet</var>.</p></li>
</ol>
</li>
Expand Down