Written in Rust · No borrowed engine

A web browser, built from scratch.

Project AB parses URLs, speaks HTTP/1.1, builds the DOM, cascades CSS, lays out boxes and paints them on the GPU with code that lives in one repository. No Chromium, no WebKit, no Gecko, no WebView.

Working browser build reached · JavaScript engine: in progress (usable)

Project status at a glance

Milestones complete
10 of 11
Roadmap items verified
116 of 116
Workspace crates
12
Third-party engine crates
3 winit, wgpu, native-tls

Figures are generated from docs/ROADMAP.md each time this site is built.

The pipeline

Every layer is our own code

A page travels through seven stages before it reaches the screen. Each one is a separate, independently tested Rust crate.

  1. Parse the URL

    Schemes, hosts, IPv6, percent-encoding and RFC 3986 relative resolution.

    ab-url

  2. Fetch it

    DNS, TCP, HTTP/1.1 with chunked bodies, redirects, cookies, gzip and a cache. TLS comes from the operating system.

    ab-net

  3. Build the DOM

    An HTML tokenizer and tree builder with error recovery, character references and an arena DOM.

    ab-html

  4. Parse the CSS

    A CSS Syntax 3 tokenizer, selectors, media queries, colours and units.

    ab-css

  5. Compute styles

    Selector matching, the cascade, inheritance, custom properties and calc().

    ab-style

  6. Lay it out

    Block, inline, tables, floats, positioning, flexbox and grid.

    ab-layout

  7. Paint it

    A display list, a TrueType rasteriser written from scratch and a wgpu painter.

    ab-render

Today

What already works

The first working browser build is reached: Project AB opens a window, loads https://example.com/ with its own stack, and you can scroll, click links, open tabs and go back and forward.

  • Networking

    HTTP/1.1 with keep-alive, redirects, chunked transfer, gzip and deflate, cookies and a revalidating cache.

    Networking details
  • HTML and CSS

    A forgiving HTML parser, selectors up to :is() and :not(), media queries, custom properties and calc().

    Parsing details
  • Layout

    Block and inline flow, margin collapsing, tables, floats, absolute and fixed positioning, flexbox and grid.

    Layout details
  • Rendering and images

    Own font rasteriser, gradients, rounded corners, shadows, and from-scratch PNG, JPEG, GIF, BMP, WebP and SVG decoders.

    Rendering details
  • Browser UI

    Tabs, address bar, back, forward, reload and stop, history, bookmarks, downloads and keyboard shortcuts, all drawn by Project AB itself.

    UI details
  • JavaScript (in progress)

    A tree-walking interpreter for a large ES2020 subset with DOM bindings, events, timers and promises.

    JavaScript details

Ground rules

How the project is built

  • No browser engine, WebView, HTML parser, CSS engine or layout library is used.
  • HTTP, HTML, CSS, layout, fonts, images and compression are implemented in the repository.
  • Cryptography is never written by hand: HTTPS uses the operating system's TLS stack through native-tls.
  • Only three outside crates power the engine: winit for windows, wgpu for the GPU and native-tls.
  • A milestone is only marked done when it compiles, passes its tests and shows the behaviour.
  • Known limitations are written down in the roadmap instead of hidden.

Try it on your machine

There are no prebuilt binaries yet. With a Rust toolchain, two commands build Project AB and open example.com.