-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the Grob Browser documentation. This is your central hub for understanding the architecture, components, and operation of the Grob web browser engine.
Grob is a modular, high-performance web browser engine written in Rust. It's designed from the ground up to be fast, safe, and easy to understand. The architecture separates concerns into specialized modules that work together to transform HTML and CSS into rendered web pages.
Current Status: Active Development (Alpha)
Key Features:
- Written in Rust for memory safety and performance
- Modular architecture with clear separation of concerns
- Cross-platform support (Windows, macOS, Linux planned)
- Standards-compliant HTML/CSS processing
- Extensible design for future enhancements
The heart of the browser - how content transforms into pixels:
-
Parser - HTML and CSS parsing
- Converts text into structured data
- Handles malformed input gracefully
- Generates DOM and Stylesheet objects
-
DOM - Document Object Model
- In-memory representation of page structure
- Element hierarchy and tree navigation
- Foundation for styling and layout
-
Style - CSS Processing
- CSS cascade and specificity rules
- Style matching and inheritance
- Computed values for layout
-
Layout - Box Model & Positioning
- CSS box model implementation
- Element dimension and position calculation
- Support for block, inline, and flex layouts
-
Paint - Rendering Engine
- Converts layout to visual output
- Drawing elements, text, and decorations
- Stacking context and z-index handling
Specialized modules that enable core functionality:
-
Font - Typography System
- Font loading and caching
- Font metrics and glyph rendering
- System and web font support
-
Network - HTTP & Resources
- HTTP request/response handling
- Resource fetching and caching
- URL loading and redirect support
-
JavaScript - Scripting Engine
- JavaScript execution integration
- DOM API exposure to scripts
- Event handling and callbacks
-
Platform - OS Abstraction
- Cross-platform compatibility layer
- File system and system information access
- Platform-specific implementations
-
Browser - Application Layer
- Window management and user interface
- Event loop and rendering coordination
- User interaction handling
-
Architecture - System Design
- High-level component relationships
- Data flow and processing pipeline
- Module dependencies and interfaces
New to Grob? Start here:
- Read this index overview
- Review Architecture for the big picture
- Pick a component that interests you based on your needs
Want to know...
- How HTML becomes a page? → See the Core Pipeline section above
- How styles are applied? → Read Style
- How text is rendered? → Check Font
- How pages load? → Look at Network
# Build the project
cargo build
# Run in debug mode
cargo build --debug
cargo run -p grob_browser
# Run in release mode (optimized)
cargo build --release
cargo run --release -p grob_browserSee the main README.md for detailed build instructions.
HTML Input
↓
[Network] → Fetch resources
↓
[Parser] → Build DOM & Stylesheets
↓
[Style] → Apply CSS rules
↓
[Layout] → Calculate positions/sizes
↓
[Paint] → Generate rendering instructions
↓
[Browser] → Display in window
Browser (Application)
↓
Engine (Core)
├─ Parser ─────────────────┐
├─ DOM │
├─ Style ─────────────────┐│
├─ Layout ────────────────┐││
├─ Paint ─────────────────┐│││
├─ Font ──────────────────┐│││
├─ Network ────────────────┐│││
├─ JavaScript ────────────┐│││
└─ Platform ──────────────┐│││
| Component | Purpose | Status | Key Features |
|---|---|---|---|
| Parser | HTML/CSS parsing | ✅ Core | Tree building, error recovery |
| DOM | Document structure | ✅ Core | Tree navigation, attributes |
| Style | CSS processing | ✅ Core | Cascade, inheritance, specificity |
| Layout | Positioning & sizing | ✅ Core | Box model, block/inline layout |
| Paint | Rendering | ✅ Core | Drawing, text, stacking contexts |
| Font | Typography | ✅ Working | Font loading, metrics, glyphs |
| Network | HTTP requests | ✅ Working | Caching, timeouts, redirects |
| JavaScript | Scripting | 🚧 Planned | Engine integration, DOM APIs |
| Browser | Application UI | ✅ Working | Window, events, rendering loop |
| Platform | OS abstraction | ✅ Working | Windows support, macOS/Linux planned |
Q: What is Grob? A: Grob is an open-source web browser engine written in Rust, focusing on modularity, safety, and performance. See Architecture.
Q: How does it work? A: HTML is parsed into a DOM, CSS styles are applied, layout is calculated, and finally everything is painted to pixels. See the Core Pipeline above.
Q: Why Rust? A: Rust provides memory safety without garbage collection, preventing entire classes of bugs while maintaining high performance.
Q: Where is HTML parsing handled? A: Parser module - specifically the HTML parser sub-module.
Q: How are fonts loaded? A: Font module - loads from system directories and web sources, with caching.
Q: How does styling work? A: Style module - implements CSS cascade, specificity, and inheritance rules.
Q: How are elements positioned? A: Layout module - calculates positions using the CSS box model.
Q: How is content drawn? A: Paint module - converts layout into rendering instructions, handles stacking.
Q: How are web pages fetched? A: Network module - handles HTTP requests, caching, and resource loading.
Q: How does JavaScript work? A: JavaScript module - integrates a JS engine and provides DOM APIs (in development).
Q: How do I add a new CSS property? A: Modify the Style module to recognize and handle the property in the cascade and inheritance logic.
Q: How do I add support for a new HTML element? A: The parser already handles HTML generically - style and layout handle elements via attributes/types.
Q: How do I port to a new platform? A: Implement the Platform module abstraction for the target OS.
Q: Where should I look to fix a rendering bug? A: Start with Paint module for visual issues, Layout module for positioning problems.
Before starting:
- Review Architecture to understand where your feature belongs
- Check the relevant component's documentation
- Understand the module's current limitations
Common tasks:
- New CSS property: Modify Style
- New layout mode: Extend Layout
- New rendering feature: Update Paint
- Font handling improvement: Enhance Font
- Network enhancement: Extend Network
grob/
├── browser/ # Browser application
│ └── src/main.rs # Entry point, event loop
│
├── engine/ # Core rendering engine
│ └── src/
│ ├── parser/ # HTML and CSS parsing
│ ├── dom/ # Document structure
│ ├── style/ # CSS processing
│ ├── layout/ # Positioning engine
│ ├── paint/ # Rendering
│ ├── font/ # Typography
│ ├── network/ # HTTP requests
│ ├── js/ # JavaScript integration
│ └── platform/ # OS abstraction
│
└── documentation/ # This documentation
- Unit tests in individual modules
- Integration tests for component interactions
- Property-based tests for algorithms
- Complete JavaScript engine integration
- Add Flexbox layout support
- Implement Grid layout
- Add more CSS selector support
- Improve error messages
- Grid layout system
- CSS animations and transitions
- Improved image support
- Better performance optimizations
- HTTPS/TLS support
- macOS port
- WebAssembly support
- Service Workers
- Hardware acceleration (GPU rendering)
- Multi-tab support
- Developer tools
- Plugin system
See individual component docs for specific roadmaps:
| Module | Purpose | Key Classes | See Also |
|---|---|---|---|
| Parser | Parse HTML/CSS | HtmlParser, CssParser | Full Docs |
| DOM | Document structure | Dom, Node | Full Docs |
| Style | CSS processing | Style, Stylesheet | Full Docs |
| Layout | Positioning | LayoutBox, LayoutEngine | Full Docs |
| Paint | Rendering | PaintInstruction, DisplayList | Full Docs |
| Font | Typography | FontManager, Font | Full Docs |
| Network | HTTP | NetworkManager, Request | Full Docs |
| JavaScript | Scripting | JavaScriptEngine | Full Docs |
| Platform | OS abstraction | FileSystem, SystemInfo | Full Docs |
| Browser | Application | Browser, EventLoop | Full Docs |
- Check Frequently Asked Questions above
- Review the specific component documentation
- See Architecture.md for system-level understanding
- Check the main project README.md
- Understand what Grob does
- Learn how to build and run it
- Try loading a simple HTML page
- Read Architecture.md for overview
- Pick one component and read its full documentation
- Explore the corresponding source code
- Try adding a small test case
- Understand the complete rendering pipeline
- Study 2-3 interconnected modules
- Trace code through a real scenario (e.g., "loading a page")
- Try implementing a simple feature
- Review Architecture.md and all component docs
- Understand performance characteristics and trade-offs
- Plan architectural improvements
- Implement significant features or optimizations
All documentation in this folder follows these conventions:
- Markdown format for easy reading and version control
- Code examples where helpful
- ASCII diagrams for architecture visualization
- Consistent structure: Overview → Concepts → Usage → Integration → Limitations
- Links between related docs
- Practical examples in component docs
Last Updated: January 22, 2026
For the latest information, see the individual component documentation files above.