Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3,598 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FenBrowser logo

Discord Community .NET 10 C# SkiaSharp MIT License Platform

🦊 FenBrowser

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.


✨ Highlights

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)

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    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)

πŸ“‚ Repository Structure

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

πŸš€ Getting Started

Prerequisites

  • .NET 10 SDK (pinned via global.json)
  • Visual Studio 2022+ or any editor with .NET support
  • Windows 10/11 (primary), Linux or macOS (experimental)

Build & Run

# 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 Tests

# 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"

Try the JS Engine

# 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 10

Diagnostic Output

When 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)

πŸ› οΈ Tech Stack

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.


πŸ“‹ Standards Compliance

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.md for current pass rates
  • WebDriver: W3C WebDriver protocol
  • Rendering: Acid2 conformance testing (currently ~98% pixel similarity)

Compliance is tracked honestly. See docs/COMPLIANCE.md for the full status breakdown.


πŸ“– Documentation

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

🀝 Contributing

We welcome contributions! Please read CONTRIBUTING_ENGINE.md for our working contract:

  1. Fix one behavior per change β€” keep scope minimal and local
  2. Reproduce first β€” identify the broken pipeline stage before coding
  3. Test everything β€” add or update focused tests for every behavior change
  4. No site-specific hacks β€” fixes belong in the engine, not per-domain branches
  5. 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 minimal

πŸ“œ License

FenBrowser is released under the MIT License. See LICENSE for details.


Built with curiosity, caffeine, and a mass of web specifications.

About

Fen Browser is an independent browser engine focused on correctness and clean architecture. It builds its own rendering and layout systems and is not yet intended for daily use.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages