Networking
ab-url · ab-net · ab-compress
- URL parser with userinfo, IPv6 literals, ports, default-port elision and percent-encoding sets
- Relative resolution passing every RFC 3986 §5.4 normal and abnormal example
file:URLs with Windows drive letters;data:andabout:pages- Address-bar heuristics:
example.combecomeshttps://example.com/ - DNS through the OS resolver, TCP with connect, read and write timeouts
- HTTPS through
native-tls(SChannel on Windows); no custom cryptography - HTTP/1.1: status lines, headers, 1xx skipping, Content-Length, chunked bodies with trailers
- Redirects (301, 302, 303, 307, 308) with a loop limit
- Keep-alive connection pool per origin
- From-scratch DEFLATE, zlib and gzip decoders with checksum verification
- Cookies following RFC 6265, including the cookie-date algorithm
- In-memory cache with
max-age,no-store, ETag and Last-Modified revalidation - Charset decoding for UTF-8 and the Windows-1252 family,
<meta charset>sniffing - Cancellation, used by the Stop button
HTML parsing
ab-html
- Tokenizer for doctypes, comments (including abrupt and bogus ones), tags and all attribute forms
- About 300 named character references plus numeric references with the Windows-1252 remap
- RCDATA, RAWTEXT and PLAINTEXT states for
title,textarea,style,scriptand friends - Tree builder with implicit
html/head/body, implied end tags and scope handling - Error recovery for stray end tags and tables with implied
tbody/tr - Arena DOM with traversal helpers,
getElementById-style lookups and text content - Serialisation (
inner_html) and html5lib-style tree dumps for tests
CSS and style
ab-css · ab-style
- CSS Syntax 3 tokenizer and parser with error recovery and
!important - Lengths in px, em, rem, ex, ch, viewport units, pt, pc, in, cm, mm and Q
- 148 named colours, hex,
rgb(),hsl(),oklch(),oklab(),color-mix(),light-dark() - Type, class, id, attribute and universal selectors with all four combinators
- Pseudo-classes including
:nth-*,:not(),:is(),:where(),:hoverand:focus @media(width, height, orientation,prefers-color-scheme),@import,@supports,@layer- Cascade with origins,
!important, specificity and source order; a rule index for fast matching - Inheritance,
inherit/initial/unset, custom properties andvar() calc(),min(),max()andclamp()- Shorthands for margin, padding, border, background, font, list-style and flex
- Presentational HTML attributes and quirks mode for legacy documents
::beforeand::afterwithcontent
Layout
ab-layout
- Box tree with anonymous block wrappers and block-in-inline handling
- CSS 2.1 width and margin equations, auto-margin centring, min/max sizes,
box-sizing - Margin collapsing between siblings and parents
- Inline layout with all
white-spacemodes, line breaking, baseline alignment andtext-align - Inline-block, replaced elements, form controls and list markers
- Automatic table layout with colspan, percentage columns and
border-spacing - Floats,
clearanddisplay: flow-root - Relative, absolute and fixed positioning with z-index paint order
- Flexbox: direction, wrap, order, grow and shrink with the spec's freezing algorithm, alignment and gaps
- Grid: fixed, percentage,
fr,minmax()andrepeat()tracks, named areas, auto-placement - Hit testing that follows paint order
Rendering
ab-render
- Display list with backgrounds, all border styles, text decorations, clipping, opacity and visibility
- TrueType parser written from scratch (cmap, hmtx, glyf, collections)
- Anti-aliased coverage rasteriser with exact area accumulation
- System font discovery, fallback faces and synthetic bold and italic
- CJK, Indic, Thai and Ethiopic font fallback
- Linear and radial gradients,
box-shadow, rounded corners and translation transforms - One
wgpupipeline drawing textured quads from a glyph and icon atlas - Offscreen rendering with pixel readback and a PNG encoder for screenshots
Images
ab-image
- PNG: all colour types and bit depths, Adam7 interlacing, transparency
- JPEG: baseline and progressive, any chroma sampling, CMYK
- WebP: lossy VP8, lossless VP8L and alpha, checked against libwebp output
- GIF (first frame) and BMP
- SVG renderer for paths, shapes,
<use>, transforms and fills, for<img>and inline<svg> - Per-image GPU textures, CSS
background-imagewith repeat, position and size
Browser application
ab-app · ab-storage
- Tabs with per-tab history, back and forward with scroll restoration, reload and stop
- Address bar with editing, selection and clipboard; falls back to a DuckDuckGo HTML search
- Chrome painted entirely by Project AB's own renderer
- Wheel, keyboard and scrollbar scrolling; link hover, Ctrl- and middle-click
- HTML forms: text fields, checkboxes, radios and GET/POST submission
- Internal pages:
about:home,about:history,about:bookmarks,about:downloads,about:settings - History, bookmarks, downloads and settings persisted in the user data directory
- Non-HTML responses: text and JSON shown inline, other files saved to Downloads
- Keyboard shortcuts such as Ctrl+T, Ctrl+W, Ctrl+L, F5 and Alt+Left
- Headless screenshots:
--screenshot out.png(see the docs)
JavaScript In progress
ab-script
- Lexer with automatic semicolon insertion and template literals
- Parser for an ES2020 subset: classes, destructuring, spread, optional chaining, async/await
- Tree-walking interpreter with closures, prototypes, exceptions and a step budget
- Standard library: Object, Array, String, Math, JSON, RegExp (own engine), Date, Map, Set, Promise
- Event loop with microtasks, timers and
requestAnimationFrame - DOM bindings: queries, mutation,
innerHTML,classList,style, events and bubbling - Isolation: one realm per page, no network or file access from scripts
Not there yet
Project AB is a learning-grade engine, not a replacement for your daily browser. Among other things, there is no HTTP/2, no Brotli, no find-in-page or zoom, no text selection in pages, cookies are kept in memory only, and the JavaScript engine still misses parts of the language and of the web platform, such as fetch.
The full and current list of limitations lives in the roadmap.