From 4f896a70b254c3d485ba8e546a5f38673dcb70bd Mon Sep 17 00:00:00 2001 From: Yu Han Date: Wed, 29 Apr 2020 09:26:43 -0700 Subject: [PATCH] Updates Imperative Slot API spec. --- dom.bs | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/dom.bs b/dom.bs index 1ee775f58..ebb511dd8 100644 --- a/dom.bs +++ b/dom.bs @@ -2195,10 +2195,24 @@ steps:

  • If the open flag is set and shadow's mode is not "open", then return null.

  • -
  • If the shadow's slot assignment is set to "manual", - return the associated slot in shadow where the slottable is - assigned, - otherwise return null.

  • +
  • If the shadow's slot assignment is set to "manual", then:

    +
      +
    1. Let manuallyAssignedNodes be nodes that are + assigned + to a slot in shadow's descendants.

    2. + +
    3. If nodeSlotMap doesn't exists, let nodeSlotMap be an empty map.

    4. + +
    5. For each node in manuallyAssignedNodes, set nodeSlotMap[node] + to slot.

    6. + +
    7. Set manuallyAssignedNodes to empty list.

    8. + +
    9. If nodeSlotMap[slottable] exists, then return nodeSlotMap[slottable].

    10. + +
    11. Return null.

    12. +
    +
  • Return the first slot in tree order in shadow's descendants whose name is slottable's @@ -5716,9 +5730,9 @@ invoked, must return a new {{DocumentFragment}} node whose 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" }; @@ -5739,7 +5753,7 @@ It is initially set to false.

    consequences for innerHTML. -->

    Shadow roots have an associated slot assignment -("manual" or "auto"), whose default value is "auto"

    +("manual" or "auto"), whose default value is "auto".

    A shadow root's get the parent algorithm, given an event, returns null if event's composed flag is unset and shadow root is the