docs.rs failed to build layout-cat-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
layout-cat
Box-model layout engine: cascade CSS rules over a DOM tree and compute a LayoutBox tree with positions and dimensions.
layout-cat is the fourth sub-crate of a comp-cat-rs Servo-replacement webview runtime targeting Tauri integration. It consumes a dom-cat document and a css-cat stylesheet, applies a simple cascade, and lays out block-level boxes. Same framework constraints: no mut, no Rc/Arc, no interior mutability, no panics.
Example
use ;
v0 scope
- Cascade: match
css-catrules todom-catelements (via dom-cat's matcher) and resolve declarations to aComputedStyle. - Length resolution: px, em (multiplier on
font-size), percentage (against containing-block width). - Box model: margin / border / padding / content per element.
- Block layout: vertical stacking with width/height/margin/padding arithmetic.
LayoutTreeofLayoutBoxwith positions, dimensions, and a back-reference to the originatingdom_cat::NodeId.
Deferred to v0.2+
- Inline layout, text shaping.
- Flex / grid / floats / positioning (other than
static). - Real font metrics; v0 uses
16pxas the default font size. - Tables, transforms, logical properties.
License
MIT OR Apache-2.0