Expand description
Layout tree node definition and top-level formatting context dispatcher.
Structs§
- Image
Resource - An encoded raster image carried on a layout node.
- Intrinsic
Cache Cell - Lock-free, 2-slot persistent intrinsic
crate::intrinsic::MinMaxSizescache stored inline on everyLayoutNode. - Layout
Cache Entry - Compact layout result cache for O(1) subtree re-entry during multi-pass formatting.
- Layout
Depth Guard - Lightweight Copy-context passed through layout formatting contexts to track recursion budget.
- Layout
Node - A node participating in the layout tree.
- Measure
Cache Entry - Cached flexbox/grid measurement probe result (
(available_w, available_h, style_pin_hash) -> (result_w, result_h, baseline_offset)), allowing clean subtrees to skip Pass-1 / Pass-2 measurement traversals in O(1) without disturbing their final Pass-4 child geometry. - Portal
Anchor Spec - Configuration attaching a top-layer portal or CSS anchor-positioned box to a trigger element.
- SvgItem
- An individual SVG vector or text item within a layout node.
- SvgText
Data - An SVG
<text>or<tspan>text span positioned within an<svg>coordinate system. - Viewport
Scene Handle - Thread-safe type-erased handle to an embedded 3D scene (
Arc<Scene3D>) carried on a layout node so the 2D CSS compositor can emitDrawViewport3Dat the exact stacking-context paint order.
Enums§
- Anchor
Placement - Placement of an anchored top-layer portal or floating element relative to its anchor box.
- Fill
Rule - SVG fill rule.
- Stroke
Line Cap - SVG stroke line cap.
- Stroke
Line Join - SVG stroke line join.
Constants§
- MAX_
LAYOUT_ DEPTH - Maximum allowable call-stack recursion depth for layout tree formatting. Bounded to 512 frames to guarantee that total call-stack consumption stays safely bounded within default OS and test-runner stack budgets (2 MB) across all platforms and unoptimized debug builds while supporting deep enterprise DOM trees.
- SUBTREE_
HAS_ HEIGHT_ DEP_ DESCENDANT - Cached summary bit indicating whether any descendant (up to an explicit pixel-height boundary)
depends on parent height (
has_height_dependent_descendant). - SUBTREE_
HAS_ HOISTED - SUBTREE_
HAS_ TOP_ LAYER - Subtree hit-testing bitflags stored on
LayoutNode::subtree_hit_flags. - SUBTREE_
HAS_ TRANSFORM - SUBTREE_
META_ VALID
Functions§
- clear_
layout_ overflow - Clears any recorded layout depth overflow.
- last_
layout_ overflow - Returns the last recorded layout depth overflow as (depth, max_depth), if any.
- record_
layout_ overflow - Records a layout depth overflow occurrence, updates diagnostics, and fires the registered callback.
- set_
on_ layout_ overflow - Registers an event callback triggered when layout depth exceeds MAX_LAYOUT_DEPTH.
- solve_
anchored_ position - Computes the viewport-aware anchored
(x, y, resolved_placement)for a floating/top-layer element, performing automatic primary-axis collision flipping (bottom-end <-> top-end,left <-> right) and cross-axis viewport shift clamping.