Non-visual, spec-driven browser runtime — execute JS-heavy pages without rendering a pixel
- TypeScript 69.7%
- JavaScript 15.2%
- HTML 12.1%
- Rust 2%
- Python 0.8%
- Other 0.2%
JS-side bindings for libmmap_dom.so with full DOM §4/§4.5 spec coverage. View Layer reads PackedNode fields directly via DataView — zero-copy. ## Bug Fixes - FFI: store Arena as Vec<(RawFd, Arena)> keyed by fd, not pointer (Rust: cast ptr→RawFd was truncation; FD lookup is correct model) ## src/native/mmap-dom.ts — FFI Loader - Bun:FFI dlopen for libmmap_dom.so - Resolves library path (process.cwd/native/..., import.meta.dir) - FFI_SYMBOLS: mmap_dom_create/close/alloc_node/node_count/version/default_size/layout_version - TypeScript enums mirror Rust constants: - NodeKind (Element=1, Attr=2, Text=3, ..., Document=9, DocumentType=10) - NodeFlag (IsConnected, IsContentEditable, IsHtmlElement, IsSvgElement, ...) - NodeField offsets (KindAndFlags, Parent, FirstChild, LastChild, ...) - HeaderField offsets (Magic, Version, VersionCounter, NodeCount, ...) - StringTableField (SECTION_BASE, OFFSETS_BASE, LENGTHS_BASE, DATA_BASE) - FfiError enum: Ok=0, OutOfMemory=-1, InvalidArg=-2, Panic=-3, NotFound=-4 ## src/native/mmap-view.ts — Zero-Copy View Layer - MmapDomView wraps SharedArrayBuffer - Reads PackedNode via DataView (O(1) cache-line access) - Spec-aligned methods: - getKind: W3C nodeType (DOM §4) - parentNode/firstChild/lastChild/nextSibling/previousSibling (DOM §4) - childCount/childAt (DOM §4.5) - getTagName/getLocalName (DOM §4.5) - getNamespaceURI (DOM §4.5) - getData/textContent (DOM §4.4 + §4) - getAttribute (DOM §4.10) - getString (zero-copy TextDecoder) - describe/dumpSubtree (debug) - Atomic version counter for mutation visibility - Cached node count (invalidated on version bump) ## Spec Coverage - DOM §4 Node interface (parent, children, siblings, nodeType) - DOM §4.5 Element interface (tagName, localName, namespaceURI) - DOM §4.4 CharacterData (data/textContent) - DOM §4.10 Element attributes (getAttribute with inline attrs) - DOM §4.1 Document (nodeType=9) - DOM §4.3 DocumentType (nodeType=10) - W3C DOM4 §5 Node.nodeType values ## Tests: 31/31 passing - FFI: library path, default size, layout version, create/close, node_count, alloc_node (Document kind=9), version increment, error paths - View: layout validation (magic, version), all DOM §4/§4.5 methods, text content concatenation, subtree dumping, spec constant matching - DOM §4 spec methods: parentNode, firstChild, lastChild, prev/nextSibling, childCount, childAt - DOM §4.5 spec methods: tagName, namespaceURI, getAttribute - DOM §4.4 spec methods: data, textContent - W3C NodeKind enum: Element=1..DocumentFragment=11 Spec: https://dom.spec.whatwg.org/ Refs: Sprint 23.2 of radikale Performance-Plan |
||
|---|---|---|
| .forgejo/workflows | ||
| bench | ||
| benchmarks | ||
| corpus | ||
| docs | ||
| native | ||
| references | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| ACTION-PLAN.md | ||
| ARCHITECTURE-PROPOSAL.md | ||
| ARCHITECTURE-V2.md | ||
| bench-test-500kb.html | ||
| bench-time.ts | ||
| bench-token-pool.ts | ||
| bun.lock | ||
| cli.ts | ||
| COMPATIBILITY.md | ||
| CONVERGENCE-GAP-CLOSURE.md | ||
| GOAL.md | ||
| head | ||
| HOW-TO-DEVELOP.md | ||
| index.ts | ||
| INTERACTION-API-PLAN.md | ||
| package-lock.json | ||
| package.json | ||
| PACKAGES.md | ||
| PLAN-MAPS.md | ||
| PLAN.md | ||
| REACT-COMPAT-PLAN.md | ||
| react19-bundle.js | ||
| react19-entry.jsx | ||
| README.md | ||
| rules.md | ||
| SPEC-GAP-REPORT.md | ||
| STRATEGY.md | ||
| TEST-REPORT.md | ||
| tsconfig.json | ||
| WHAT-TO-BUILD.md | ||