Phase 8 — Resource Loading + Character Encoding + Real Page Loading#
Implement the full end-to-end pipeline from URL navigation to rendered page.
Requirements#
Wire together all Phase 8 components into the browser crate's navigation flow:
- URL input → parse URL (url crate)
- Fetch → ResourceLoader fetches HTML (net + encoding crates)
- Parse HTML → tokenize and build DOM (html crate)
- Load subresources → fetch
<link>stylesheets and<img>images in parallel where possible - Style → parse CSS, match selectors, compute styles (css + style crates)
- Layout → generate layout tree (layout crate)
- Render → paint to display list, rasterize to bitmap (render + text + image crates)
- Display → present bitmap in window (platform crate)
Specific Integration Work#
- Modify browser main loop to accept a URL argument:
cargo run -p we-browser -- https://example.com - Connect ResourceLoader to the HTML/CSS/image loading pipeline
- Ensure encoding detection flows through the pipeline (HTTP charset → BOM → meta prescan)
- Handle the case where subresources fail to load (graceful degradation)
- Basic error page for network failures
Acceptance Criteria#
-
cargo run -p we-browser -- https://example.comloads and renders the page - External CSS stylesheets are applied
- Images are displayed
- Text is rendered with correct fonts and styles
- Encoding is detected and text is decoded correctly
-
cargo run -p we-browser(no URL) opens about:blank - Failed loads show appropriate error messages
- No external dependencies, no
unsafe(except in allowed crates)
Dependencies#
Depends on: All other Phase 8 issues (this is the integration issue)