Re: [whatwg/dom] Add Imperative Slot API (#860)

@annevk commented on this pull request.



> @@ -2195,6 +2195,25 @@ steps:</p>
  <li><p>If the <i>open flag</i> is set and <var>shadow</var>'s <a for=ShadowRoot>mode</a> is
  <em>not</em> "<code>open</code>", then return null.</p></li>
 
+ <li><p>If the shadow's <a for=ShadowRoot>slot assignment</a> is set to "<code>manual</code>", then:</p>

This should be `<var>shadow</var>`.

> @@ -2195,6 +2195,25 @@ steps:</p>
  <li><p>If the <i>open flag</i> is set and <var>shadow</var>'s <a for=ShadowRoot>mode</a> is
  <em>not</em> "<code>open</code>", then return null.</p></li>
 
+ <li><p>If the shadow's <a for=ShadowRoot>slot assignment</a> is set to "<code>manual</code>", then:</p>
+  <ol>
+   <li><p>Let <var>manuallyAssignedNodes</var> be nodes that are
+   <a href="https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assign"><code>assigned</code></a>

This is a method, it should reference an internal/associated concept, no?

> @@ -2195,6 +2195,25 @@ steps:</p>
  <li><p>If the <i>open flag</i> is set and <var>shadow</var>'s <a for=ShadowRoot>mode</a> is
  <em>not</em> "<code>open</code>", then return null.</p></li>
 
+ <li><p>If the shadow's <a for=ShadowRoot>slot assignment</a> is set to "<code>manual</code>", then:</p>
+  <ol>
+   <li><p>Let <var>manuallyAssignedNodes</var> be nodes that are
+   <a href="https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assign"><code>assigned</code></a>
+   to a <a>slot</a> in <var>shadow</var>'s <a for=tree>descendants</a>.</p></li>
+
+   <li><p>If <var>nodeSlotMap</var> doesn't exists, let <var>nodeSlotMap</var> be an empty <a for=/>map</a>.</p></li>

How could it exist here?

> @@ -2195,6 +2195,25 @@ steps:</p>
  <li><p>If the <i>open flag</i> is set and <var>shadow</var>'s <a for=ShadowRoot>mode</a> is
  <em>not</em> "<code>open</code>", then return null.</p></li>
 
+ <li><p>If the shadow's <a for=ShadowRoot>slot assignment</a> is set to "<code>manual</code>", then:</p>
+  <ol>
+   <li><p>Let <var>manuallyAssignedNodes</var> be nodes that are
+   <a href="https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assign"><code>assigned</code></a>
+   to a <a>slot</a> in <var>shadow</var>'s <a for=tree>descendants</a>.</p></li>
+
+   <li><p>If <var>nodeSlotMap</var> doesn't exists, let <var>nodeSlotMap</var> be an empty <a for=/>map</a>.</p></li>
+
+   <li><p>For each <var>node</var> in <var>manuallyAssignedNodes</var>, set <var>nodeSlotMap[node]</var>

You want `<var>nodeSlotMap</var>[<var>node</var>]` here.

> @@ -2195,6 +2195,25 @@ steps:</p>
  <li><p>If the <i>open flag</i> is set and <var>shadow</var>'s <a for=ShadowRoot>mode</a> is
  <em>not</em> "<code>open</code>", then return null.</p></li>
 
+ <li><p>If the shadow's <a for=ShadowRoot>slot assignment</a> is set to "<code>manual</code>", then:</p>
+  <ol>
+   <li><p>Let <var>manuallyAssignedNodes</var> be nodes that are
+   <a href="https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assign"><code>assigned</code></a>
+   to a <a>slot</a> in <var>shadow</var>'s <a for=tree>descendants</a>.</p></li>
+
+   <li><p>If <var>nodeSlotMap</var> doesn't exists, let <var>nodeSlotMap</var> be an empty <a for=/>map</a>.</p></li>
+
+   <li><p>For each <var>node</var> in <var>manuallyAssignedNodes</var>, set <var>nodeSlotMap[node]</var>
+   to <a>slot</a>.</p></li>

Which slot?

> @@ -2195,6 +2195,25 @@ steps:</p>
  <li><p>If the <i>open flag</i> is set and <var>shadow</var>'s <a for=ShadowRoot>mode</a> is
  <em>not</em> "<code>open</code>", then return null.</p></li>
 
+ <li><p>If the shadow's <a for=ShadowRoot>slot assignment</a> is set to "<code>manual</code>", then:</p>
+  <ol>
+   <li><p>Let <var>manuallyAssignedNodes</var> be nodes that are
+   <a href="https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assign"><code>assigned</code></a>
+   to a <a>slot</a> in <var>shadow</var>'s <a for=tree>descendants</a>.</p></li>
+
+   <li><p>If <var>nodeSlotMap</var> doesn't exists, let <var>nodeSlotMap</var> be an empty <a for=/>map</a>.</p></li>
+
+   <li><p>For each <var>node</var> in <var>manuallyAssignedNodes</var>, set <var>nodeSlotMap[node]</var>
+   to <a>slot</a>.</p></li>
+
+   <li><p>Set <var>manuallyAssignedNodes</var> to empty list.</p></li>

an empty list*

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/860#pullrequestreview-403284518

Received on Thursday, 30 April 2020 07:58:57 UTC