From 88c256923be5e8a4af4b85ce411a3aaf01794555 Mon Sep 17 00:00:00 2001
From: Anne van Kesteren 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).
If slotable is non-null:
+ If slottable is non-null:
Assert: parent is a slot.
- Set slotable to null.
+ Set slottable to null.
If parent's root is a shadow root whose
mode is " If parent is a slotable and is assigned, then set
- slotable to parent.
+ If parent is a slottable and is assigned, then
+ set slottable to parent.
Let relatedTarget be the result of retargeting event's
relatedTarget against parent.
@@ -2126,7 +2127,7 @@ otherwise it is the empty string. Otherwise, set element's name to value.
- Run assign slotables for a tree with element's root.
+ Run assign slottables for a tree with element's root.
@@ -2134,19 +2135,19 @@ otherwise it is the empty string.
- closed
", then set slot-in-closed-tree
to true.
A slot has an associated assigned nodes (a list of -slotables). Unless stated otherwise it is empty.
+slottables). Unless stated otherwise it is empty. -{{Element}} and {{Text}} nodes are -slotables.
+slottables. -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:
If value is the empty string and oldValue is null, then return.
If value is null or the empty string, then set element's - name to the empty string. + name to the empty string. -
Otherwise, set element's name to value. +
Otherwise, set element's name to value. -
If element is assigned, then run assign slotables - for element's assigned slot. +
If element is assigned, then run assign slottables + for element's assigned slot.
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.
-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:
If slotable's parent is null, then return null.
If slottable's parent is null, then return null.
Let shadow be slotable's parent's +
Let shadow be slottable's parent's shadow root.
If shadow is null, then return null.
open
", then return null.
Return the first slot in tree order in shadow's - descendants whose name is slotable'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:
Let result be an empty list.
For each slotable child of host, slotable, in +
For each slottable child of host, slottable, in tree order:
Let foundSlot be the result of finding a slot given - slotable.
If foundSlot is slot, then append slotable to +
If foundSlot is slot, then append slottable to result.
To -find flattened slotables +find flattened slottables for a given slot slot, run these steps:
If slot's root is not a shadow root, then return result.
Let slotables be the result of finding slotables given +
Let slottables be the result of finding slottables given slot.
If slotables is the empty list, then append each slotable - child of slot, in tree order, to slotables.
If slottables is the empty list, then append each slottable + child of slot, in tree order, to slottables.
For each node in slotables: +
For each node in slottables:
Let temporaryResult be the result of finding flattened slotables given +
Let temporaryResult be the result of finding flattened slottables given node.
Append each slotable in temporaryResult, in order, to +
Append each slottable in temporaryResult, in order, to result.
Return result.
To assign slotables for a slot slot, run these steps: +
To assign slottables for a slot slot, +run these steps:
Let slotables be the result of finding slotables for slot. +
Let slottables be the result of finding slottables for slot. -
If slotables and slot's assigned nodes are not +
If slottables and slot's assigned nodes are not identical, then run signal a slot change for slot. -
Set slot's assigned nodes to slotables. +
Set slot's assigned nodes to slottables. -
For each slotable in slotables, set slotable's +
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:
Let slot be the result of finding a slot with slotable. +
Let slot be the result of finding a slot with slottable. -
If slot is non-null, then run assign slotables for slot. +
If slot is non-null, then run assign slottables for slot.
If parent is a shadow host and node is a - slotable, then assign a slot for node. + slottable, then assign a slot for node.
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. -
Run assign slotables for a tree with node's root. +
Run assign slottables for a tree with node's root.
For each shadow-including inclusive descendant inclusiveDescendant of @@ -2663,7 +2667,7 @@ indicated in the remove algorithm below.
If node is assigned, then run assign slotables for +
If node is assigned, then run assign slottables for node's assigned slot.
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:
Run assign slotables for a tree with parent's root. +
Run assign slottables for a tree with parent's root. -
Run assign slotables for a tree with node. +
Run assign slottables for a tree with node.
Run the removing steps with node and parent. @@ -3043,18 +3047,19 @@ steps:
-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.