Integrate computed styles into layout and render pipeline
Replace hardcoded tag-based defaults in the layout crate with CSS
computed styles from the style crate. The layout engine now accepts
a StyledNode tree instead of walking the DOM directly.
Layout crate changes:
- layout() takes &StyledNode + &Document instead of &Document alone
- Remove hardcoded display_type(), default_font_size(), default_margin()
- Read display, margin, padding, border, font-size from ComputedStyle
- Carry color, background-color, text-decoration, border styles/colors
on LayoutBox for the renderer to use
Render crate changes:
- Use CSS color for text (instead of hardcoded black)
- Use CSS background-color for box backgrounds (skip transparent)
- Render borders with correct width, style, and color
- Support text-decoration: underline
- Replace render-local Color type with we_css::values::Color
Browser pipeline:
- Full: HTML → DOM → extract CSS → resolve styles → layout → render
6 new tests across layout (3) and render (3) crates verifying CSS
properties flow through to layout positions and paint commands.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
authored by
pierrelf.com
tangled.org
3218f658
671d128b