Phase 3, Issue 7: Window Integration#
Connect all Phase 3 components to display a rendered HTML page in the AppKit window.
Requirements#
Update the browser crate (crates/browser) to:
- Load HTML — read an HTML string (hardcoded or from a file path argument)
- Parse — tokenize and tree-build into a DOM
- Layout — run block layout with a system font
- Render — paint into a CG bitmap
- Display — show the bitmap in the AppKit window via the existing WeView
Browser main loop:
- Load a system font via
FontRegistryorload_system_font() - Parse the HTML into a DOM
- Run layout with viewport dimensions from the window
- Render to bitmap
- Display in the window
- Handle window resize (re-layout and re-render)
Command-line:
cargo run -p we-browser— show a default "Hello World" pagecargo run -p we-browser -- file.html— load and render a local HTML file
Acceptance criteria#
-
cargo run -p we-browseropens a window showing rendered HTML with visible text - Text is anti-aliased and readable
- Block elements are visually stacked
- Headings appear larger than body text
- Window resize triggers re-layout and re-render
- Can load an HTML file from command line argument
-
cargo clippy --workspace -- -D warningspasses -
cargo test --workspacepasses - No new unsafe code outside of platform crate