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
- Edge
Sizes - Edge sizes (margin, padding, border)
- Inline
Fragment - A fragment within an inline line box
- Layout
Box - 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