bubble_layout_dirty

Function bubble_layout_dirty 

Source
pub fn bubble_layout_dirty(applier: &mut dyn Applier, node_id: NodeId)
Expand description

Unified API for bubbling layout dirty flags from a node to the root (Applier context).

This is the canonical function for dirty bubbling during the apply phase (structural changes). Call this after mutations like insert/remove/move that happen during apply.

§Behavior

  1. Marks the starting node as needing layout
  2. Walks up the parent chain, marking each ancestor
  3. Stops when it reaches a node that’s already dirty (O(1) optimization)
  4. Stops at the root (node with no parent)

§Performance

This function is O(height) in the worst case, but typically O(1) due to early exit when encountering an already-dirty ancestor.

§Usage

  • Call from composer mutations (insert/remove/move) during apply phase
  • Call from applier-level operations that modify the tree structure