A ground-up, standards-driven web browser engine written entirely in C#.
FenBrowser is an experimental browser engine that implements the web platform from scratch β HTML parsing, CSS cascade & layout, GPU-accelerated rendering, and a custom ECMAScript runtime β all in modern .NET, without wrapping Chromium, WebKit, or Gecko.
Note
This is a research & learning project. FenBrowser is not a daily-driver browser. Many websites won't render correctly (or at all) yet. We're building this to deeply understand the modern web stack, not to replace your current browser.
| Feature | Details | |
|---|---|---|
| π | Standards-Based HTML Parser | WHATWG-compliant HTML5 tree builder with incremental streaming, interleaved tokenize/parse for large documents, and conformance guardrails |
| π¨ | Full CSS Pipeline | Tokenizer β Cascade β Computed Style β Used Values. Supports Selectors Level 4 (:has(), nth-child(... of ...), attribute flags), Media Queries Level 4, CSS Color 4 (oklch, oklab), and modern shorthand parsing |
| π | Multi-Context Layout Engine | Block, Inline, Flex, Grid, Table, and Float formatting contexts with spec-aligned sizing, placement, and baseline synthesis |
| πΌοΈ | Skia-Powered Rendering | GPU-accelerated paint pipeline via SkiaSharp + OpenGL, with compositing stability controls, damage-region tracking, partial rasterization, and z-index resolution |
| β‘ | FenJS β Custom ECMAScript Engine | Lexer β Parser β AST β Bytecode compiler β Interpreter, with a logical heap, native intrinsics, and Test262-first verification |
| π¬ | Built-In DevTools | Native element inspector, style panel, debugging overlays, and remote debugging protocol |
| π€ | WebDriver Protocol | W3C WebDriver support for automated testing and CI integration |
| π | Security-First Design | Centralized navigation/network security policy, process isolation interfaces (in-process + brokered modes), POSIX sandbox launcher support |
| π | Cross-Platform Foundation | Windows primary, with Linux/macOS PAL support (POSIX shared memory, sandbox helpers) |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FenBrowser.Host β
β Windowing Β· Input Β· Event Loop Β· OS Shell β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ€
β FenBrowser.DevTools β FenBrowser.WebDriver β
β Inspector Β· Debug β W3C Automation β
ββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββ€
β FenBrowser.FenEngine β
β HTML Parser Β· CSS Cascade Β· Layout Β· Paint Β· Scripting β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β FenBrowser.Core β
β DOM Β· CSS Types Β· Networking Β· Security Β· Logging β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Project | Responsibility |
|---|---|---|
| Core | FenBrowser.Core |
DOM nodes, CSS value types, HTTP stack, security policy, logging |
| Engine | FenBrowser.FenEngine |
HTML/CSS parsing, style resolution, layout computation, Skia rendering, JS execution |
| Host | FenBrowser.Host |
OS window, input capture, frame timer, navigation lifecycle |
| DevTools | FenBrowser.DevTools |
Native inspector UI, remote debug protocol |
| WebDriver | FenBrowser.WebDriver |
W3C WebDriver endpoint for automation |
| JS Engine | FenBrowser.Js |
Standalone ECMAScript engine (lexer, parser, bytecode, VM) |
FenBrowser/
βββ FenBrowser.Core/ # DOM, networking, CSS types, security primitives
βββ FenBrowser.FenEngine/ # Layout engine, CSS cascade, Skia renderer, scripting
βββ FenBrowser.Host/ # Desktop shell (entry point, windowing, input)
βββ FenBrowser.DevTools/ # Built-in developer tools
βββ FenBrowser.WebDriver/ # W3C WebDriver implementation
βββ FenBrowser.Js/ # Standalone ECMAScript engine
βββ FenBrowser.Js.Shell/ # JS engine CLI (--eval, --dump-ast, --dump-bytecode)
βββ FenBrowser.Js.Test262/ # Test262 conformance runner
βββ FenBrowser.Tests/ # Unit & integration tests
βββ FenBrowser.Conformance/ # Web platform conformance tests
βββ FenBrowser.Tooling/ # Harness tooling (Acid2, WPT, debug captures)
βββ docs/ # Canonical technical documentation
βββ scripts/ # Build, test, and CI scripts
βββ FenBrowser.sln # Solution file
- .NET 10 SDK (pinned via
global.json) - Visual Studio 2022+ or any editor with .NET support
- Windows 10/11 (primary), Linux or macOS (experimental)
# Clone the repository
git clone https://github.com/user/FenBrowser.git
cd FenBrowser
# Build the solution
dotnet build FenBrowser.sln
# Run the browser
dotnet run --project FenBrowser.Host/FenBrowser.Host.csproj# Run the full test suite
dotnet test FenBrowser.Tests/FenBrowser.Tests.csproj
# Run a specific test slice
dotnet test FenBrowser.Tests/FenBrowser.Tests.csproj --filter "FullyQualifiedName~Layout"# Evaluate an expression
dotnet run --project FenBrowser.Js.Shell/FenBrowser.Js.Shell.csproj -- --eval "1 + 2"
# Dump the AST
dotnet run --project FenBrowser.Js.Shell/FenBrowser.Js.Shell.csproj -- --dump-ast "function hello() { return 42; }"
# Run Test262 subset
dotnet run --project FenBrowser.Js.Test262/FenBrowser.Js.Test262.csproj -- \
--runtime-subset --root external/test262 --test262 built-ins/Object --max 10When running, FenBrowser writes rich diagnostic artifacts to logs/:
| File | What It Shows |
|---|---|
debug_screenshot.png |
Raw frame capture of the current render |
dom_dump.txt |
Full DOM tree and layout box state |
fenbrowser_*.log |
Module-specific traces (CSS, Layout, Performance) |
| Component | Technology | Purpose |
|---|---|---|
| Language | C# / .NET 10 | Core implementation language |
| 2D Graphics | SkiaSharp 2.88 | GPU-accelerated rendering (same engine as Chrome/Android) |
| Text Shaping | HarfBuzz (via SkiaSharp.HarfBuzz) | Complex script rendering for 100+ writing systems |
| Text Layout | RichTextKit | Paragraph layout, word wrapping, hit testing |
| Windowing | Silk.NET | Cross-platform window creation, input, OpenGL context |
| SVG | Svg.Skia | SVG parsing and rendering |
| Testing | xUnit | Unit and integration test framework |
All runtime dependencies are MIT or Apache 2.0 licensed. Zero telemetry. Zero analytics.
FenBrowser targets conformance with core web standards:
- HTML: WHATWG HTML Living Standard (HTML5 tree builder)
- CSS: Selectors Level 4, CSS Color 4, Media Queries Level 4, Flexbox, Grid, Table
- DOM: Core DOM interfaces,
querySelector/querySelectorAll, element state management - ECMAScript: Test262-driven development β see
docs/test262_results.mdfor current pass rates - WebDriver: W3C WebDriver protocol
- Rendering: Acid2 conformance testing (currently ~98% pixel similarity)
Compliance is tracked honestly. See
docs/COMPLIANCE.mdfor the full status breakdown.
FenBrowser maintains a canonical documentation set:
| Volume | Scope |
|---|---|
| Volume I β System Manifest | Architecture overview, build notes, roadmap |
| Volume II β Core | DOM, networking, CSS types |
| Volume III β FenEngine | Layout, CSS cascade, rendering pipeline |
| Volume IV β Host | Windowing, input, OS integration |
| Volume V β DevTools | Inspector, debugging, profiling |
| Volume VI β Extensions & Verification | WebDriver, testing, conformance |
We welcome contributions! Please read CONTRIBUTING_ENGINE.md for our working contract:
- Fix one behavior per change β keep scope minimal and local
- Reproduce first β identify the broken pipeline stage before coding
- Test everything β add or update focused tests for every behavior change
- No site-specific hacks β fixes belong in the engine, not per-domain branches
- Document honestly β partial support is fine; false claims are not
# Minimum verification per change
dotnet build <touched-project>.csproj -v minimal
dotnet test FenBrowser.Tests/FenBrowser.Tests.csproj --filter "FullyQualifiedName~<affected-slice>" -v minimalFenBrowser is released under the MIT License. See LICENSE for details.
Built with curiosity, caffeine, and a mass of web specifications.
