onehtmlDocs
onehtml docs
Everything about onehtml: getting started, parsing and editing, CSS, the accessibility tree, the WCAG checker and its exports, how it is tested, and the cookbook.
Parsing and editing
Editing HTMLNormative behaviour of Document.Apply and DocumentEditor in RecursiveAI.OneHtml. A port must reproduce it from this text. The saved-edit JSON and replay are in edit-format.md; stylesheet edits are at the end of this file.Edit formatThe saved form of edits: a JSON envelope that names what to change durably enough to replay on another copy of the page or stylesheet, plus the replay rules. It is language-neutral; a port must read and write the same JSON and give the same replay outcomes from this text. The…SelectorsNormative behaviour of RecursiveAI.OneHtml.Selectors and the Node query members. The grammar and matching rules are those of Selectors Level 4 (with the HTML Standard section 4.16 for the HTML pseudo-classes and DOM for the query methods); this file records what those texts…Locators and fingerprintsNormative behaviour of RecursiveAI.OneHtml.Locators, written so another language can reproduce it byte for byte.Reading viewReadingView.Create(tree) and NavigationLists.Create(tree) (also tree.CreateReadingView() and tree.CreateNavigationLists()) in RecursiveAI.OneHtml.Accessibility derive two things from an accessibility tree: the page as one linear sequence of spoken-style steps, and the lists a…
CSS
CSS parsingNormative behaviour of RecursiveAI.OneHtml.Css, written so another language can reproduce it. The algorithms are those of CSS Syntax Module Level 3 (Editor's Draft of 20 October 2026, drafts.csswg.org/css-syntax-3/); this file records only what that text leaves open or what…CSS valuesNormative behaviour of the value layer of RecursiveAI.OneHtml.Css, written so another language can reproduce it. It sits on the tokens and component values of css-syntax.md. The algorithms are those of CSS Values and Units 4, CSS Color 4 (with the Color 5 relative-color and…The cascade and computed stylesNormative behaviour of RecursiveAI.OneHtml.Css.DocumentStyles (namespace RecursiveAI.OneHtml.Css), written so another language can reproduce it. The algorithms are those of CSS Cascade 5 (with the Cascade 6 revert-rule keyword), CSS Nesting 1, CSS Variables 1, CSS Conditional…
Accessibility
The accessibility treeAccessibilityTree.Build(document, styles, context?, options?, cancellationToken) in RecursiveAI.OneHtml.Accessibility computes the objects a browser exposes to assistive technology, from a parsed document and its cascade. This file is normative for what the tree contains and…RolesRecursiveAI.OneHtml.Accessibility computes the role of every element from markup alone, before any style is known. This document is normative for that part: the data it is built from, the algorithm, and what it reports. Choices the specifications leave open are in…Chromium role profileWhere WAI-ARIA 1.2, HTML-AAM and Core-AAM leave a choice, the accessibility tree follows what Chromium exposes. This file lists every such choice made in the role computation (RecursiveAI.OneHtml.Accessibility.Aria). It is normative for the library: a port must make the same…Rendered factsRecursiveAI.OneHtml.Accessibility.Rendered holds what a browser's layout engine said about a page, keyed by the nodes of a OneHtml document. The library never drives a browser: the caller captures a DOMSnapshot.captureSnapshot result (and the page's serialized DOM) and passes…
Checking pages
The checkerRecursiveAI.OneHtml.Accessibility.Validation runs accessibility rules over a document and its accessibility tree and returns labelled results. This page covers the API, how rules are selected, and how to add a private rule. The shape of the results and the two JSON exports is…Results and exportsA CheckReport (see checker.md) holds RuleResults. This page defines the result model and the two JSON exports. Both exports are deterministic: the same report gives the same bytes on every platform. Both are written with System.Text.Json writers; nothing uses reflection.SARIF exportToSarifJson (an extension on CheckReport, in SarifExport) writes the report as SARIF 2.1.0, the OASIS Static Analysis Results Interchange Format (Errata 01). The mapping is version 1 (SarifExport.ExportVersion, written to the run's properties.exportVersion); a change that…Rule catalogueThe Validation package ships reference data about the standards its rules check against, and a few types to hang rule implementations on. This page lists the data, where each file comes from, and how a rule is added. The criterion-by-rule table is in coverage.md.ACT rule coverageGenerated by ActCoverageTests; do not edit by hand. To refresh it after a rule or an expectation changes, run the Validation tests with ONEHTML_UPDATE_DOCS=1. The rule list and its status come from Catalogue/Data/act-rules.json (see catalogue.md); the cases are the W3C test…
How it is tested
Coverage matrixGenerated by CoverageMatrix.ToMarkdown(); do not edit by hand. To refresh it after the data changes, run the Validation tests with ONEHTML_UPDATE_DOCS=1. The sources and their pins are in docs/catalogue.md.AngleSharp differentialHow our trees compare with AngleSharp's on a corpus of real pages, and why each remaining difference is ours being right. AngleSharp is used as a black box (its output only), in the tools/OneHtml.Differential harness and never in the library. Every cause below is tied to the…Chrome accessibility-tree differentialOneHtml.Differential ax compares our accessibility tree with the one Chrome returns from Accessibility.getFullAXTree, node by node, for pages captured by tools/capture. Chrome is a black box here: only its protocol output is read. The command is in tools/OneHtml.Differential…axe-core differentialOneHtml.Differential axe compares what the checker (RecursiveAI.OneHtml.Accessibility.Validation) concludes about a page with what axe-core 4.14.0 concluded about the same page in Chrome for Testing 156.0.8078.47. axe-core is a black box here: it is injected into the page…