web engine - experimental web browser

Window integration: display rendered HTML page #37

open opened by pierrelf.com

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:

  1. Load HTML — read an HTML string (hardcoded or from a file path argument)
  2. Parse — tokenize and tree-build into a DOM
  3. Layout — run block layout with a system font
  4. Render — paint into a CG bitmap
  5. Display — show the bitmap in the AppKit window via the existing WeView

Browser main loop:

  • Load a system font via FontRegistry or load_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" page
  • cargo run -p we-browser -- file.html — load and render a local HTML file

Acceptance criteria#

  • cargo run -p we-browser opens 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 warnings passes
  • cargo test --workspace passes
  • No new unsafe code outside of platform crate
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:meotu43t6usg4qdwzenk4s2t/sh.tangled.repo.issue/3mfubuknjkr2x