cssbox-dom 0.1.0

HTML/CSS parsing and style resolution for cssbox
Documentation
  • Coverage
  • 54.55%
    30 out of 55 items documented1 out of 34 items with examples
  • Size
  • Source code size: 60.08 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.81 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • npow/cssbox
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • npow

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));