These are the new definitions. For all other definitions, consult current spec.
- slot -- a defined location in a shadow tree. Represented by the
slot
element. - slot name -- the name of a slot.
- default slot -- a slot for assigning nodes without a slot name.
The slotting algorithm assigns nodes of a shadow tree host into slots of that tree.
Input HOST -- a shadow tree host Output All child nodes of HOST are slotted
- Let TREE be HOST's shadow tree
- Let DEFAULT be an empty list of nodes
- For each child node NODE of HOST, in tree order:
- Let NAME be NODE's slot name
- If NAME is missing, add NODE to DEFAULT
- Let SLOT be the slot with slot name NAME for TREE
- If SLOT does not exist, discard node
- Otherwise, assign NODE to SLOT
- Let DEFAULT-SLOT be the the default slot for TREE
- If DEFAULT-SLOT does not exist, stop
- Otherwise, assign all nodes in DEFAULT to DEFAULT-SLOT.
When each node is assigned to a slot, this slot is also added to the node's destination insertion points list.
The get distributed nodes algorithm recursively collects all nodes that are currently distributed into a given slot
Input SLOT -- a slot in a shadow tree Output LIST - a list of distributed nodes
- For each node NODE that is assigned to SLOT:
- If NODE is a slot: 1. Let SUB-LIST be the result of (recursively) running the get distributed nodes algorithm with NODE as argument 2. Append all nodes in SUB-LIST to LIST
- Otherwise, append NODE to LIST.
This algorithm replaces the distribution resolution algorithm from the current spec.
Input NODE-TREE -- a node tree Output The distribution result is updated.
- For each shadow host HOST, which participates in NODE-TREE, in tree order:
- Run slotting algorithm with HOST as argument
- Let SHADOW-TREE be HOST's shadow tree
- Run *distribution resolution algorithm (recursively) with SHADOW-TREE as input
slot
element represents a slot in the shadow tree. Has same rendering behavior as the content
element.
Attributes:
name
-- the name of the slot.
interface HTMLSlotElement : HTMLElement {
attribute DOMString name;
NodeList getDistributedNodes();
}
name
-- reflects thename
attribute.getDistributedNodes
--- returns result of running the get distributed nodes algorithm.
partial interface Element {
attribute DOMString slot;
}
slot
-- reflects theslot
attribute. Theslot
attribute represents the slot name.