static void invokeLayoutCallback(struct Node* node) {
    if (node->onLayout) {
        node->onLayout(node);
    }

    struct Node* child = node->firstChild;
    while (child) {
        invokeLayoutCallback(child);
        child = child->next;
    }
}
		void nodeLayout(struct Node* root)
		{
			if (!root->firstChild) {
				return;
			}

			// Pass 1 - Measure any invalidated child nodes.
			measureNodes(root->element.layoutType, root->firstChild);

			// Pass 2 - Layout out children.
			layoutNode(&root->element,
			           root->element.measuredWidth,
			           root->element.measuredHeight,
			           false,
			           false);

			// Pass 3 - Invoke post layout callbacks.
			invokeLayoutCallback(root);
		}
void nodeLayout(struct Node* root) {
    // TODO(josh): remove once layout clears this flag.
    root->flags &= ~FLAG_REQ_LAYOUT;

    if (!root->firstChild) {
        return;
    }

    // Pass 1 - Measure any invalidated child nodes.
    measureNodes(root->element._layoutType, root->firstChild);

    // Pass 2 - Layout out children.
    layoutNode(&root->element,
               root->element._measuredWidth,
               root->element._measuredHeight,
               false,
               false);

    // Pass 3 - Invoke post layout callbacks.
    invokeLayoutCallback(root);
}