Compute_flexboxSourceFlexbox layout computation algorithm.
Implements the CSS Flexbox specification (https://www.w3.org/TR/css-flexbox-1/) following the W3C algorithm structure. This is a direct port of taffy's flexbox implementation.
The flexbox algorithm proceeds in stages following the W3C spec numbering:
flex_item.frozen determines whether an item's size is locked during flexible length resolution.flex_item.violation tracks deviation from target size; items are frozen when violations resolve.flex_line.items is a slice into the main flex_items array, avoiding allocations.algo_constants caches resolved style properties and container sizes updated during layout.flex_item, flex_line, and algo_constants avoid allocations during iterative sizing.compute_flexbox_layout when size is fully determined and run mode is ComputeSize.val compute_flexbox_layout :
(module Tree.LAYOUT_PARTIAL_TREE with type t = 't) ->
't ->
Tree.Node_id.t ->
Tree.Layout_input.t ->
Tree.Layout_output.tcompute_flexbox_layout tree node inputs computes flexbox layout for node.
Entry point for flexbox layout. Resolves size constraints, applies box-sizing adjustments, and delegates to internal algorithm stages. Short-circuits when container size is fully determined and inputs.run_mode = ComputeSize.