MCPcopy Create free account
hub / github.com/ampproject/amphtml / assignSlot

Method assignSlot

src/core/context/node.js:139–145  ·  view source on GitHub ↗

* Direct slot assignment. Works the same way as shadow slots, but does not * require a shadow root. Automatically starts the discovery phase for the * affected nodes. * * See `Element.assignedSlot` API. * * @param {Node} node The target node. * @param {Node} slot The slot to whi

(node, slot)

Source from the content-addressed store, hash-verified

137 * @param {Node} slot The slot to which the target node is assigned.
138 */
139 static assignSlot(node, slot) {
140 if (node[ASSIGNED_SLOT_PROP] == slot) {
141 return;
142 }
143 node[ASSIGNED_SLOT_PROP] = slot;
144 discoverContained(node);
145 }
146
147 /**
148 * Unassigns the direct slot previously done by the `assignSlot` call.

Callers 2

assignSlotFunction · 0.80

Calls 1

discoverContainedFunction · 0.85

Tested by

no test coverage detected