From 88c256923be5e8a4af4b85ce411a3aaf01794555 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sat, 14 Mar 2020 10:42:59 +0100 Subject: [PATCH] =?UTF-8?q?Editorial:=20slotable=20=E2=9E=A1=EF=B8=8F=20sl?= =?UTF-8?q?ottable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While preserving IDs. Corresponding HTML PR: https://github.com/whatwg/html/pull/5355. Closes #844. --- dom.bs | 131 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 68 insertions(+), 63 deletions(-) diff --git a/dom.bs b/dom.bs index 1f7600f7a..afe7880a0 100644 --- a/dom.bs +++ b/dom.bs @@ -5,6 +5,7 @@ Shortname: dom Text Macro: TWITTER thedomstandard Abstract: DOM defines a platform-neutral model for events, aborting activities, and node trees. Translation: ja https://triple-underscore.github.io/DOM4-ja.html +Translate IDs: slottable slotable Ignored Terms: EmptyString, Array, Document Indent: 1 @@ -1304,8 +1305,8 @@ for discussion). activation behavior, then set activationTarget to target. -
  • Let slotable be target, if target is a slotable - and is assigned, and null otherwise. +

  • Let slottable be target, if target is a slottable + and is assigned, and null otherwise.

  • Let slot-in-closed-tree be false. @@ -1317,20 +1318,20 @@ for discussion).

    1. -

      If slotable is non-null: +

      If slottable is non-null:

      1. Assert: parent is a slot. -

      2. Set slotable to null. +

      3. Set slottable to null.

      4. If parent's root is a shadow root whose mode is "closed", then set slot-in-closed-tree to true.

      -
    2. If parent is a slotable and is assigned, then set - slotable to parent. +

    3. If parent is a slottable and is assigned, then + set slottable to parent.

    4. Let relatedTarget be the result of retargeting event's relatedTarget against parent. @@ -2126,7 +2127,7 @@ otherwise it is the empty string.

    5. Otherwise, set element's name to value. -

    6. Run assign slotables for a tree with element's root. +

    7. Run assign slottables for a tree with element's root.

    @@ -2134,19 +2135,19 @@ otherwise it is the empty string.

    name is the empty string, is sometimes known as the "default slot".

    A slot has an associated assigned nodes (a list of -slotables). Unless stated otherwise it is empty.

    +slottables). Unless stated otherwise it is empty.

    -
    Slotables
    +
    Slottables

    {{Element}} and {{Text}} nodes are -slotables.

    +slottables.

    -

    A slot can be a slotable. +

    A slot can be a slottable. -

    A slotable has an associated name (a string). Unless stated -otherwise it is the empty string.

    +

    A slottable has an associated name (a +string). Unless stated otherwise it is the empty string.

    -

    Use these attribute change steps to update a slotable's name: +

    Use these attribute change steps to update a slottable's name:

    1. @@ -2160,31 +2161,33 @@ otherwise it is the empty string.

    2. If value is the empty string and oldValue is null, then return.

    3. If value is null or the empty string, then set element's - name to the empty string. + name to the empty string. -

    4. Otherwise, set element's name to value. +

    5. Otherwise, set element's name to value. -

    6. If element is assigned, then run assign slotables - for element's assigned slot. +

    7. If element is assigned, then run assign slottables + for element's assigned slot.

    8. Run assign a slot for element.

    -

    A slotable has an associated assigned slot (null or a -slot). Unless stated otherwise it is null. A slotable is -assigned if its assigned slot is non-null.

    +

    A slottable has an associated +assigned slot (null or a slot). +Unless stated otherwise it is null. A slottable is +assigned if its assigned slot is +non-null.

    -
    Finding slots and slotables
    +
    Finding slots and slottables
    -

    To find a slot for a given slotable -slotable and an optional open flag (unset unless stated otherwise), run these +

    To find a slot for a given slottable +slottable and an optional open flag (unset unless stated otherwise), run these steps:

      -
    1. If slotable's parent is null, then return null.

    2. +
    3. If slottable's parent is null, then return null.

    4. -
    5. Let shadow be slotable's parent's +

    6. Let shadow be slottable's parent's shadow root.

    7. If shadow is null, then return null.

    8. @@ -2193,12 +2196,12 @@ steps:

      not "open", then return null.

    9. Return the first slot in tree order in shadow's - descendants whose name is slotable's - name, if any, and null otherwise.

    10. + descendants whose name is slottable's + name, if any, and null otherwise.

    -

    To find slotables for a given slot -slot, run these steps:

    +

    To find slottables +for a given slot slot, run these steps:

    1. Let result be an empty list.

    2. @@ -2210,14 +2213,14 @@ steps:

      host.

    3. -

      For each slotable child of host, slotable, in +

      For each slottable child of host, slottable, in tree order:

      1. Let foundSlot be the result of finding a slot given - slotable.

      2. + slottable.

        -
      3. If foundSlot is slot, then append slotable to +

      4. If foundSlot is slot, then append slottable to result.

    4. @@ -2226,7 +2229,7 @@ steps:

    To -find flattened slotables +find flattened slottables for a given slot slot, run these steps:

      @@ -2235,14 +2238,14 @@ for a given slot slot, run these steps:

    1. If slot's root is not a shadow root, then return result.

    2. -
    3. Let slotables be the result of finding slotables given +

    4. Let slottables be the result of finding slottables given slot.

    5. -
    6. If slotables is the empty list, then append each slotable - child of slot, in tree order, to slotables.

    7. +
    8. If slottables is the empty list, then append each slottable + child of slot, in tree order, to slottables.

    9. -

      For each node in slotables: +

      For each node in slottables:

      1. @@ -2250,10 +2253,10 @@ for a given slot slot, run these steps:

        then:
          -
        1. Let temporaryResult be the result of finding flattened slotables given +

        2. Let temporaryResult be the result of finding flattened slottables given node.

        3. -
        4. Append each slotable in temporaryResult, in order, to +

        5. Append each slottable in temporaryResult, in order, to result.

        @@ -2264,33 +2267,34 @@ for a given slot slot, run these steps:

      2. Return result.

      -
      Assigning slotables and slots
      +
      Assigning slottables and slots
      -

      To assign slotables for a slot slot, run these steps: +

      To assign slottables for a slot slot, +run these steps:

        -
      1. Let slotables be the result of finding slotables for slot. +

      2. Let slottables be the result of finding slottables for slot. -

      3. If slotables and slot's assigned nodes are not +

      4. If slottables and slot's assigned nodes are not identical, then run signal a slot change for slot. -

      5. Set slot's assigned nodes to slotables. +

      6. Set slot's assigned nodes to slottables. -

      7. For each slotable in slotables, set slotable's +

      8. For each slottable in slottables, set slottable's assigned slot to slot.

      -

      To assign slotables for a tree, given a node -root, run assign slotables for each slot slot in -root's inclusive descendants, in tree order. +

      To assign slottables for a tree, given a +node root, run assign slottables for each slot slot +in root's inclusive descendants, in tree order. -

      To assign a slot, given a slotable slotable, run these +

      To assign a slot, given a slottable slottable, run these steps:

        -
      1. Let slot be the result of finding a slot with slotable. +

      2. Let slot be the result of finding a slot with slottable. -

      3. If slot is non-null, then run assign slotables for slot. +

      4. If slot is non-null, then run assign slottables for slot.

      Signaling slot change
      @@ -2447,13 +2451,13 @@ before a child, with an optional suppress observers flag, run children before child's index.
    10. If parent is a shadow host and node is a - slotable, then assign a slot for node. + slottable, then assign a slot for node.

    11. If parent's root is a shadow root, and parent is a slot whose assigned nodes is the empty list, then run signal a slot change for parent. -

    12. Run assign slotables for a tree with node's root. +

    13. Run assign slottables for a tree with node's root.

    14. For each shadow-including inclusive descendant inclusiveDescendant of @@ -2663,7 +2667,7 @@ indicated in the remove algorithm below.

    15. Remove node from its parent's children. -

    16. If node is assigned, then run assign slotables for +

    17. If node is assigned, then run assign slottables for node's assigned slot.

    18. If parent's root is a shadow root, and @@ -2674,9 +2678,9 @@ indicated in the remove algorithm below.

      If node has an inclusive descendant that is a slot, then:

        -
      1. Run assign slotables for a tree with parent's root. +

      2. Run assign slottables for a tree with parent's root. -

      3. Run assign slotables for a tree with node. +

      4. Run assign slottables for a tree with node.

    19. Run the removing steps with node and parent. @@ -3043,18 +3047,19 @@ steps:

    -

    Mixin {{Slotable}}

    +

    Mixin {{Slottable}}

    -interface mixin Slotable {
    +interface mixin Slottable {
       readonly attribute HTMLSlotElement? assignedSlot;
     };
    -Element includes Slotable;
    -Text includes Slotable;
    +Element includes Slottable;
    +Text includes Slottable;
     
    -

    The assignedSlot attribute's getter must return -the result of find a slot given this and with the open flag set.

    +

    The assignedSlot +attribute's getter must return the result of find a slot given this and with the +open flag set.

    Old-style collections: {{NodeList}} and {{HTMLCollection}}