Skip to main content

Crate cssbox_dom

Crate cssbox_dom 

Source
Expand description

cssbox-dom — HTML/CSS parsing and style resolution for cssbox.

This crate provides the bridge between HTML/CSS input and the cssbox-core layout engine. It parses HTML documents, resolves CSS styles through the cascade, and builds the box tree that the layout engine requires.

§Usage

use cssbox_dom::computed::html_to_box_tree;
use cssbox_core::geometry::Size;
use cssbox_core::layout::{compute_layout, FixedWidthTextMeasure};

let html = r#"<div style="width: 200px; height: 100px"></div>"#;
let tree = html_to_box_tree(html);
let result = compute_layout(&tree, &FixedWidthTextMeasure, Size::new(800.0, 600.0));

Modules§

cascade
CSS cascade: selector matching, specificity, and style resolution.
computed
Specified → computed value resolution.
css
CSS parsing and property resolution.
dom
DOM tree types for the layout engine.
html
HTML parsing for the layout engine.