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

@annevk commented on this pull request.



> @@ -2195,6 +2195,10 @@ 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 <var>shadow</var>'s <a for=ShadowRoot>slot assignment</a> is set to "<code>manual</code>",
+ return the <a>slot</a> in <var>shadow</var>'s <a for=tree>descendants</a> whose <a>manually assigned nodes</a>

then return*

> @@ -2195,6 +2195,10 @@ 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 <var>shadow</var>'s <a for=ShadowRoot>slot assignment</a> is set to "<code>manual</code>",
+ return the <a>slot</a> in <var>shadow</var>'s <a for=tree>descendants</a> whose <a>manually assigned nodes</a>
+ includes <var>slottable</var>, if any, and null otherwise.</p></li>

you want `<a for=set>contains</a>` instead of includes here I think. It's a set right?

And I guess we're not bothering with tree order and such since there can only be one such slot.

> @@ -2450,7 +2454,8 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
    <li><p>Otherwise, <a for=set>insert</a> <var>node</var> into <var>parent</var>'s
    <a for=tree>children</a> before <var>child</var>'s <a for=tree>index</a>.
 
-   <li><p>If <var>parent</var> is a <a for=Element>shadow host</a> and <var>node</var> is a
+   <li><p>If <var>parent</var> is a <a for=Element>shadow host</a> with its <a for=tree>root</a>'s
+   <a for=ShadowRoot>slot assignment</a> set to "<code>auto</code>" and <var>node</var> is a
    <a>slottable</a>, then <a>assign a slot</a> for <var>node</var>.
 
    <li><p>If <var>parent</var>'s <a for=tree>root</a> is a <a for=/>shadow root</a>, and

Why should this step not be skipped?

> @@ -2667,8 +2672,16 @@ indicated in the <a for=/>remove</a> algorithm below.
 
  <li><p><a for=set>Remove</a> <var>node</var> from its <var>parent</var>'s <a for=tree>children</a>.
 
- <li><p>If <var>node</var> is <a for=slottable>assigned</a>, then run <a>assign slottables</a> for
- <var>node</var>'s <a>assigned slot</a>.
+ <li>
+  <p>If <var>node</var> is <a for=slottable>assigned</a>, then:
+
+  <ol>
+   <li><p><p>If <var>parent</var>'s <a for=tree>root</a> is a <a for=/>shadow root</a> with its
+   <a for=tree>root</a>'s <a for=ShadowRoot>slot assignment</a> set to "<code>auto</code>",
+   then <a for=set>remove</a> <var>node</var> from its <a>assigned slot</a>'s <a>manually assigned nodes</a>.
+
+   <li><p>Run <a>assign slottables</a> for <var>node</var>'s <a>assigned slot</a>.

Here too I have the feeling we're not skipping enough for the manual case. Same below.

> @@ -2667,8 +2672,16 @@ indicated in the <a for=/>remove</a> algorithm below.
 
  <li><p><a for=set>Remove</a> <var>node</var> from its <var>parent</var>'s <a for=tree>children</a>.
 
- <li><p>If <var>node</var> is <a for=slottable>assigned</a>, then run <a>assign slottables</a> for
- <var>node</var>'s <a>assigned slot</a>.
+ <li>
+  <p>If <var>node</var> is <a for=slottable>assigned</a>, then:
+
+  <ol>
+   <li><p><p>If <var>parent</var>'s <a for=tree>root</a> is a <a for=/>shadow root</a> with its

Drop one `<p>`.

-- 
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-471646344

Received on Thursday, 20 August 2020 14:06:56 UTC