Skip to content

Commit

Permalink
Updates Imperative Slot API spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yu Han committed Apr 29, 2020
1 parent 6075484 commit 4f896a7
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2195,10 +2195,24 @@ 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>",
return the associated <a>slot</a> in shadow where the <var>slottable</var> is
<a href="https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assign"><code>assigned</code></a>,
otherwise 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>

<li><p>If <var>nodeSlotMap[slottable]</var> exists, then return <var>nodeSlotMap[slottable]</var>.</p></li>

<li><p>Return null.</p></li>
</ol>
</li>

<li><p>Return the first <a>slot</a> in <a>tree order</a> in <var>shadow</var>'s
<a for=tree>descendants</a> whose <a for=slot>name</a> is <var>slottable</var>'s
Expand Down Expand Up @@ -5716,9 +5730,9 @@ invoked, must return a new {{DocumentFragment}} <a>node</a> whose <a for=Node>no
[Exposed=Window]
interface ShadowRoot : DocumentFragment {
readonly attribute ShadowRootMode mode;
readonly attribute SlotAssignmentMode slotAssignment;
readonly attribute Element host;
attribute EventHandler onslotchange;
readonly attribute SlotAssignmentMode slotAssignment;
};

enum ShadowRootMode { "open", "closed" };
Expand All @@ -5739,7 +5753,7 @@ It is initially set to false.</p>
consequences for innerHTML. -->

<p><a for=/>Shadow roots</a> have an associated <dfn for=ShadowRoot>slot assignment</dfn>
("<code>manual</code>" or "<code>auto</code>"), whose default value is "<code>auto</code>"</p>
("<code>manual</code>" or "<code>auto</code>"), whose default value is "<code>auto</code>".</p>

<p>A <a for=/>shadow root</a>'s <a>get the parent</a> algorithm, given an <var>event</var>, returns
null if <var>event</var>'s <a>composed flag</a> is unset and <a for=/>shadow root</a> is the
Expand Down

0 comments on commit 4f896a7

Please sign in to comment.