layoutWalk
disposition: bound, direction: spec-to-code, basis: implementation
An anatomy rule of the Web Components binding. The element types named below resolve jointly here — which type a node becomes, or what tag and semantics an element takes, is decided by this rule rather than per type.
Keys. container, text, glyph, instance, slot
Operands
Every fact the rule reads. Nothing outside this set participates.
| Operand | From |
|---|---|
layout | spec document — ordered LayoutNodes: a leaf is an element name, a branch is one name over ordered children |
variants[].layout | spec document — a variant’s layout is a WHOLE structure layered over the default |
element.instanceOf | spec document |
element.type | spec document |
Derived predicates
| Name | Expression | Source |
|---|---|---|
derived.conditions | node.conditions = the variant configurations that place this element here, state-classified props stripped; entries OR'd, each entry a conjunction | shared layout-tree analysis |
Cases
Ordered — first match wins.
| # | When | Emits | Why |
|---|---|---|---|
| 1 | node.excludeConditions present | the element, guarded to NOT render here under the configurations where a variant re-parents it | A re-parented element renders in the variant’s position when it matches and in its default position otherwise — never both |
| 2 | derived.conditions present | the element wrapped in its render condition in the lit template | An element only some variants place exists in the shadow tree exactly when a placing configuration matches |
| 3 | node.key present | the element at its tree position, children recursed in authored order — slots project, instances compose, everything else a shadow-tree node whose tag the semanticsAndTags rule decides | The walk is the structure; order is the spec’s |
Otherwise
Nothing is emitted. — An element absent from every layout renders nowhere
The tree operations are the same shared module React walks, so the two emitters cannot diverge on structure — only on what each node becomes.