wbe.rs
loosely implementing the Web Browser Engineering book in rust
An educational from-scratch web browser written in Rust that follows the Web Browser Engineering book, showing how HTML parsing, CSS styling, and page rendering work.
What This Project Does
This is a from-scratch implementation of a web browser written in Rust. Instead of building a full-featured browser like Chrome or Firefox, the creator is following along with the Web Browser Engineering book and translating its lessons into Rust code. The result is a working browser that can load websites from the internet, parse their HTML, apply CSS styling, and display them on your screen.
How It Works
The browser follows the same basic pipeline that all web browsers use. First, it downloads the raw HTML and CSS files from a web server. Next, it parses that HTML into a structured tree—essentially organizing all the tags and content into a hierarchical format. Then it applies CSS styling rules to decide colors, fonts, sizes, and layout. Finally, it measures and positions everything on the screen and renders it for you to see. The project includes a location bar where you can type a URL, and you can scroll through pages with your mouse wheel.
Who Would Use This and Why
This isn't meant to replace your everyday browser—it's an educational project for people learning how browsers actually work under the hood. If you're a developer curious about browser internals, or someone teaching web fundamentals, this gives you readable, real code that shows each step of the process. The creator has also added some genuine engineering touches like double-buffering in the location bar and asynchronous loading so the interface doesn't freeze while downloading pages.
The README notes several rough edges: the Enter key doesn't work in the address bar yet (you need to click "Go" instead), redirects cause the browser to crash, and keyboard navigation isn't fully implemented. These are intentional gaps—the project is still in progress, following the book's chapters step by step.
Where it fits
- Read the code to understand how a browser parses HTML into a structured tree.
- Study how CSS rules get applied to decide colors, fonts, and layout.
- Learn the full browser rendering pipeline by following along with the Web Browser Engineering book.
- Use it as a teaching reference for explaining how browsers work under the hood.