⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module layout

Module layout 

Source
Expand description

Layout Engine

Transforms a styled DOM tree into a layout box tree with computed positions and dimensions. Supports block layout, inline layout with line boxes and word wrapping, float layout with exclusion areas, positioned layout (relative, absolute, fixed), and margin collapsing. All measurements use 26.6 fixed-point (i32).

Structs§

Dimensions
Complete dimensions of a layout box
EdgeSizes
Edge sizes (margin, padding, border)
InlineFragment
A fragment within an inline line box
LayoutBox
A layout box in the layout tree
LineBox
A line box containing inline fragments
Rect
A rectangle with position and size in fixed-point units

Enums§

BoxType
Type of layout box

Functions§

build_layout_tree
Build a layout tree from a styled DOM
get_text_for_layout
Generate text content from a DOM node for inline layout
measure_text_height
Measure text height for a given font size
measure_text_width
Measure text width in fixed-point units (8px per char)
word_wrap
Word wrap: split text into lines that fit within a given width