MCPcopy Create free account
hub / github.com/codeaashu/claude-code / collectLayoutChildren

Function collectLayoutChildren

src/native-ts/yoga-layout/index.ts:2406–2433  ·  view source on GitHub ↗
(node: Node, flow: Node[], abs: Node[])

Source from the content-addressed store, hash-verified

2404}
2405
2406function collectLayoutChildren(node: Node, flow: Node[], abs: Node[]): void {
2407 // Partition a node's children into flow and absolute lists, flattening
2408 // display:contents subtrees so their children are laid out as direct
2409 // children of this node (per CSS display:contents spec — the box is removed
2410 // from the layout tree but its children remain, lifted to the grandparent).
2411 for (const c of node.children) {
2412 const disp = c.style.display
2413 if (disp === Display.None) {
2414 c.layout.left = 0
2415 c.layout.top = 0
2416 c.layout.width = 0
2417 c.layout.height = 0
2418 zeroLayoutRecursive(c)
2419 } else if (disp === Display.Contents) {
2420 c.layout.left = 0
2421 c.layout.top = 0
2422 c.layout.width = 0
2423 c.layout.height = 0
2424 // Recurse — nested display:contents lifts all the way up. The contents
2425 // node's own margin/padding/position/dimensions are ignored.
2426 collectLayoutChildren(c, flow, abs)
2427 } else if (c.style.positionType === PositionType.Absolute) {
2428 abs.push(c)
2429 } else {
2430 flow.push(c)
2431 }
2432 }
2433}
2434
2435function roundLayout(
2436 node: Node,

Callers 1

layoutNodeFunction · 0.85

Calls 2

zeroLayoutRecursiveFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected