BarrierLab

CASOONOpen Source

One rule set for web audits.

BarrierLab is the shared engine behind the CASOON audit tools: WCAG 2.2 accessibility rules, HTML conformance, perception and web checks as pure-Rust libraries, with the accessibility rules also compiled to WebAssembly. Whether a page is checked during the Astro build, in a terminal audit or live in the browser, a finding has the same ID and means the same thing.

cargo add a11y-rules a11y-dom a11y-report
npm i @casoon/a11y-wasm
From libraries to toolsParsers and a shared document and finding model carry the accessibility rules and HTML conformance; perception and web checks compute on their own. Everything ships as Rust crates on crates.io, the rules additionally as a WebAssembly package on npm. auditmysite, astro-post-audit and Relief use the crates, liveaudit the npm package.From libraries to toolsShared models → a11y-rulesParsers → a11y-rulesParsers → html-conforma11y-rules → crates.iohtml-conform → crates.ioa11y-perception → crates.ioweb-checks → crates.ioa11y-rules → npm: WebAssemblycrates.io → auditmysitecrates.io → astro-post-auditcrates.io → Reliefnpm → liveauditWebAssemblyParsers – HTML, CSS, CSP, XPathParsersHTML, CSS, CSP, XPathShared models – a11y-dom, a11y-reportShared modelsa11y-dom, a11y-reporta11y-rules – WCAG 2.2, accnamea11y-rulesWCAG 2.2, accnamehtml-conform – Conformancehtml-conformConformancea11y-perception – Perceptiona11y-perceptionPerceptionweb-checks – robots, meta, JSON-LDweb-checksrobots, meta, JSON-LDcrates.io – 20 Rust cratescrates.io20 Rust cratesnpm – a11y-wasmnpma11y-wasmauditmysite – Terminal auditauditmysiteTerminal auditastro-post-audit – after the Astro buildastro-post-auditafter the Astro buildRelief – BrowserReliefBrowserliveaudit – inside the live pageliveauditinside the live page
From libraries to toolsParsers and a shared document and finding model carry the accessibility rules and HTML conformance; perception and web checks compute on their own. Everything ships as Rust crates on crates.io, the rules additionally as a WebAssembly package on npm. auditmysite, astro-post-audit and Relief use the crates, liveaudit the npm package.From libraries to toolsShared models → a11y-rulesParsers → a11y-rulesParsers → html-conforma11y-rules → crates.iohtml-conform → crates.ioa11y-perception → crates.ioweb-checks → crates.ioa11y-rules → npm: WebAssemblycrates.io → auditmysitecrates.io → astro-post-auditcrates.io → Reliefnpm → liveauditWebAssemblyParsers – HTML, CSS, CSP, XPathParsersHTML, CSS, CSP, XPathShared models – a11y-dom, a11y-reportShared modelsa11y-dom, a11y-reporta11y-rules – WCAG 2.2, accnamea11y-rulesWCAG 2.2, accnamehtml-conform – Conformancehtml-conformConformancea11y-perception – Perceptiona11y-perceptionPerceptionweb-checks – robots, meta, JSON-LDweb-checksrobots, meta, JSON-LDcrates.io – 20 Rust cratescrates.io20 Rust cratesnpm – a11y-wasmnpma11y-wasmauditmysite – Terminal auditauditmysiteTerminal auditastro-post-audit – after the Astro buildastro-post-auditafter the Astro buildRelief – BrowserReliefBrowserliveaudit – inside the live pageliveauditinside the live page
From libraries to toolsParsers and a shared document and finding model carry the accessibility rules and HTML conformance; perception and web checks compute on their own. Everything ships as Rust crates on crates.io, the rules additionally as a WebAssembly package on npm. auditmysite, astro-post-audit and Relief use the crates, liveaudit the npm package.From libraries to toolsModels → a11y-rulesParsers → a11y-rulesParsers → html-conforma11y-rules → crates.io, npmhtml-conform → crates.io, npmPerception → crates.io, npmcrates.io, npm → auditmysite, astro-post-auditParsers – HTML, CSS, CSP, XPathParsersHTML, CSS, CSP,XPathModels – a11y-dom, a11y-reportModelsa11y-dom,a11y-reporta11y-rules – WCAG 2.2, accnamea11y-rulesWCAG 2.2,accnamehtml-conform – Conformancehtml-conformConformancePerception – a11y-perception, web-checksPerceptiona11y-perception,web-checkscrates.io, npm – 20 crates, a11y-wasmcrates.io, npm20 crates,a11y-wasmauditmysite, astro-post-audit – Relief, liveauditauditmysite,astro-post-auditRelief, liveaudit
From libraries to toolsParsers and a shared document and finding model carry the accessibility rules and HTML conformance; perception and web checks compute on their own. Everything ships as Rust crates on crates.io, the rules additionally as a WebAssembly package on npm. auditmysite, astro-post-audit and Relief use the crates, liveaudit the npm package.From libraries to toolsModels → a11y-rulesParsers → a11y-rulesParsers → html-conforma11y-rules → crates.io, npmhtml-conform → crates.io, npmPerception → crates.io, npmcrates.io, npm → auditmysite, astro-post-auditParsers – HTML, CSS, CSP, XPathParsersHTML, CSS, CSP,XPathModels – a11y-dom, a11y-reportModelsa11y-dom,a11y-reporta11y-rules – WCAG 2.2, accnamea11y-rulesWCAG 2.2,accnamehtml-conform – Conformancehtml-conformConformancePerception – a11y-perception, web-checksPerceptiona11y-perception,web-checkscrates.io, npm – 20 crates, a11y-wasmcrates.io, npm20 crates,a11y-wasmauditmysite, astro-post-audit – Relief, liveauditauditmysite,astro-post-auditRelief, liveaudit

Why it exists

Two calls, two answers

The accessibility rules are generic over a document model, so the host decides what it can supply. The simplest host is the Arena from a11y-dom, which holds structure only. Rules that need more are not skipped quietly — they come back as NotRun.

AccessibilityRust
use a11y_dom::Arena;
use a11y_rules::run;

let doc = Arena::builder()
    .open("html")
        .open("body")
            .open("img").attr("src", "logo.png").close()
        .close()
    .close()
    .build();

let report = run(&doc);

// Found: no lang, no title, no alt.
assert!(report.findings.iter()
    .any(|f| f.rule_id == "images/alt-missing"));

// Not judged: rules that need semantics or rendering.
assert_eq!(report.summary.rules_not_run, 7);
HTML conformanceRust
let html = std::fs::read_to_string("index.html")?;
let report = html_conform::check(&html)?;

for f in &report.findings {
    let at = f.location.map(|l| l.to_string())
        .unwrap_or_default();
    println!("{:?} {at} {} {}",
        f.severity, f.rule_id, f.message);
}

// Error 8:17 parser.html5 an unknown named character reference
// Error 9:25 parser.html5 a duplicate attribute on a tag

Findings are plain data with a stable JSON form:

a11y-reportJSON
{
  "rule_id": "images/alt-missing",
  "outcome": "fail",
  "severity": "high",
  "message": "The image has no alt attribute.",
  "location": { "node": "15" },
  "wcag": ["1.1.1"]
}
Rust crates, all on crates.io
20
accessibility rule IDs in a11y-rules
168
vnu fixtures html-conform is measured against
4,977
finding model for every package
1

What the numbers look like

Both charts are generated from the repository: the rule IDs are the output of examples/a11y, the fixture counts come from the differential test against the Nu Html Checker. Rules are grouped by what the host has to provide; structure rules run anywhere, the rest declare their tier.

168 rule IDs, grouped by what the host must provideRule IDs declared by a11y-rules 0.29. Structure rules run on any host; the others only run when the host supplies semantics, rendering data or parsed stylesheets, and are reported as not run otherwise.168 rule IDs, grouped by what the hostmust provide050100150Rule IDsStructure (Document): 107107Structure (Document)Semantics (role, accessible name): 3535Semantics (role, accessiblename)Rendering (styles, geometry): 2121Rendering (styles, geometry)Stylesheets: 55Stylesheets
168 rule IDs, grouped by what the host must provideRule IDs declared by a11y-rules 0.29. Structure rules run on any host; the others only run when the host supplies semantics, rendering data or parsed stylesheets, and are reported as not run otherwise.168 rule IDs, grouped by what the hostmust provide050100150Rule IDsStructure (Document): 107107Structure (Document)Semantics (role, accessible name): 3535Semantics (role, accessiblename)Rendering (styles, geometry): 2121Rendering (styles, geometry)Stylesheets: 55Stylesheets
html-conform against 4,655 vnu fixturesPer fixture: does the document produce findings or not. 3,745 documents vnu rejects are rejected, 909 clean ones stay clean; there are no false positives and one false negative.html-conform against 4,655 vnu fixtures01000200030004000FixturesTrue positives: 37453745True positivesTrue negatives: 909909True negativesFalse negatives: 11False negatives0False positives
html-conform against 4,655 vnu fixturesPer fixture: does the document produce findings or not. 3,745 documents vnu rejects are rejected, 909 clean ones stay clean; there are no false positives and one false negative.html-conform against 4,655 vnu fixtures01000200030004000FixturesTrue positives: 37453745True positivesTrue negatives: 909909True negativesFalse negatives: 11False negatives0False positives

The vnu comparison is per fixture: does the document produce findings or not. It does not compare message text or positions, and html-conform is not a port of vnu. CI fails if the false-positive or false-negative count rises.

Measured next to axe-core

The test bench of barrierlab.eu is a set of practice pages with 22 known barriers, each page also in a corrected version. Every tool runs with its default WCAG A and AA rules, and the page lists for each barrier which rule of which tool reported it. Here: axe-core, the engine inside Lighthouse and most test setups, and barrierlab-cli, which runs the BarrierLab rules on the page source.

Test bench, measured 12 and 13 November 2026
axe-core 4.13barrierlab-cli 0.1
Barriers reported as a failure8 of 228 of 22
Of those, the same barriersall 8
Further barriers handed to a person for review13
Failures reported on the corrected pages00
Needs a browseryesno

barrierlab-cli asks for a review of missing landmarks, vague link text and a table without headers; axe-core of missing captions. Twelve barriers neither reports: focus, tab order, dialogs, error messages, colour as the only signal, moving content. No tool on the bench found more than 10 of the 22.

Barriers reported as a failure, of 22 known onesTest bench of barrierlab.eu, measured 12 and 13 November 2026: practice pages with 22 known barriers. Lighthouse and Alfa report 10, QualWeb 9, axe-core, IBM Equal Access and barrierlab-cli 8, Pa11y with HTML_CodeSniffer 7, html-validate 5. barrierlab-cli and html-validate read the page without a browser; the others run in one.Barriers reported as a failure, of 22known ones0510152025Barriers foundLighthouse 13.6: 1010Lighthouse 13.6Alfa 0.84: 1010Alfa 0.84QualWeb 0.7: 99QualWeb 0.7axe-core 4.13: 88axe-core 4.13IBM Equal Access 4.0: 88IBM Equal Access 4.0barrierlab-cli 0.1: 88barrierlab-cli 0.1Pa11y / HTML_CodeSniffer: 77Pa11y / HTML_CodeSnifferhtml-validate 11.21: 55html-validate 11.21
Barriers reported as a failure, of 22 known onesTest bench of barrierlab.eu, measured 12 and 13 November 2026: practice pages with 22 known barriers. Lighthouse and Alfa report 10, QualWeb 9, axe-core, IBM Equal Access and barrierlab-cli 8, Pa11y with HTML_CodeSniffer 7, html-validate 5. barrierlab-cli and html-validate read the page without a browser; the others run in one.Barriers reported as a failure, of 22known ones0510152025Barriers foundLighthouse 13.6: 1010Lighthouse 13.6Alfa 0.84: 1010Alfa 0.84QualWeb 0.7: 99QualWeb 0.7axe-core 4.13: 88axe-core 4.13IBM Equal Access 4.0: 88IBM Equal Access 4.0barrierlab-cli 0.1: 88barrierlab-cli 0.1Pa11y / HTML_CodeSniffer: 77Pa11y / HTML_CodeSnifferhtml-validate 11.21: 55html-validate 11.21

The figures say two things: the rule set finds what an established engine finds, without a browser, and an automated check of any make finds less than half. Bench and tool come from the same maintainer; the raw results per tool and barrier are on the bench page.

Held to public test suites

A bench of our own is one view. The other is test cases nobody here wrote: the suites that browsers, validators and the W3C use to say what correct means. Each runs from this repository; the parser and name suites on every change.

Results of 14 November 2026
SuitePublished byResult
html5lib-tests, tree constructionWHATWG, the suite browsers test their parsers with1,726 of 1,726 (210 fragment and scripting cases skipped)
html5lib-tests, parse errorsWHATWG1,591 of 1,602
web-platform-tests, accnameW3C377 of 489; the rest need CSS the test host does not model
Nu Html Checker test filesvalidator/validator4,654 of 4,655 decided as vnu does (chart above)
ACT Rules test casesW3C ACT Rules Community Group23 rules consistent, 8 partially; axe-core 4.14.0: 35 and 9 (W3C report)

The first ACT run, with nothing tuned, gave 8 consistent rules and 60 wrong cases. Each was checked against the specification and the rule corrected where the page source holds the answer; now 451 of 512 cases come out right, 56 stay undecided and 5 wrong, three of them because the content only exists after a script runs. The remaining gap to axe-core is mostly rules that need a browser.

How it fits together

Only libraries live here. None of them opens a page or speaks a browser protocol: the tool obtains the data, BarrierLab computes. That is why the same rule set runs in a terminal, after a build and as WebAssembly inside an open page.

Dependencies point down through four layers: parsers, models, computation, delivery. No package imports one from its own or a higher layer, and each package names the specification it implements, from WHATWG HTML to XPath 1.0 to WCAG 2.2.

The core crates and their dependenciesAn arrow leads from a crate to the one that uses it. Dependencies only point down, from L0 to L3: html-conform builds on six parsers and engines, a11y-rules on a11y-dom, a11y-report and stylesheet-parse, and a11y-wasm bundles a11y-rules and accname for the browser. a11y-perception and web-checks stand alone.The core crates and their dependenciesL0 · Parsers and enginesL1 · ModelL2 · ComputationL3 · Deliverystylesheet-parse → a11y-rulesa11y-dom → a11y-rulesa11y-report → a11y-rulesa11y-dom → a11y-wasma11y-report → a11y-wasma11y-rules → a11y-wasmaccname → a11y-wasma11y-dom → accnamecsp-parse → html-conformhtml5-parser → html-conformmedia-query-parse → html-conformrelax-ng → html-conformschematron-engine → html-conformxpath-eval → html-conformxpath-eval → schematron-enginemedia-query-parse → stylesheet-parsehtml5-parser – HTML parserhtml5-parserHTML parsercsp-parse – CSPcsp-parseCSPmedia-query-parse – Media Queriesmedia-query-parseMedia Queriesxpath-eval – XPath 1.0xpath-evalXPath 1.0relax-ng – RELAX NGrelax-ngRELAX NGschematron-engine – Schematronschematron-engineSchematrona11y-dom – Document modela11y-domDocument modela11y-report – Finding modela11y-reportFinding modelstylesheet-parse – CSS stylesheetsstylesheet-parseCSS stylesheetshtml-conform – HTML conformancehtml-conformHTML conformanceaccname – Accessible NameaccnameAccessible Namea11y-rules – Rule seta11y-rulesRule seta11y-perception – Perceptiona11y-perceptionPerceptionweb-checks – robots, meta, JSON-LDweb-checksrobots, meta, JSON-LDa11y-wasm – WebAssembly, npma11y-wasmWebAssembly, npm
The core crates and their dependenciesAn arrow leads from a crate to the one that uses it. Dependencies only point down, from L0 to L3: html-conform builds on six parsers and engines, a11y-rules on a11y-dom, a11y-report and stylesheet-parse, and a11y-wasm bundles a11y-rules and accname for the browser. a11y-perception and web-checks stand alone.The core crates and their dependenciesL0 · Parsers and enginesL1 · ModelL2 · ComputationL3 · Deliverystylesheet-parse → a11y-rulesa11y-dom → a11y-rulesa11y-report → a11y-rulesa11y-dom → a11y-wasma11y-report → a11y-wasma11y-rules → a11y-wasmaccname → a11y-wasma11y-dom → accnamecsp-parse → html-conformhtml5-parser → html-conformmedia-query-parse → html-conformrelax-ng → html-conformschematron-engine → html-conformxpath-eval → html-conformxpath-eval → schematron-enginemedia-query-parse → stylesheet-parsehtml5-parser – HTML parserhtml5-parserHTML parsercsp-parse – CSPcsp-parseCSPmedia-query-parse – Media Queriesmedia-query-parseMedia Queriesxpath-eval – XPath 1.0xpath-evalXPath 1.0relax-ng – RELAX NGrelax-ngRELAX NGschematron-engine – Schematronschematron-engineSchematrona11y-dom – Document modela11y-domDocument modela11y-report – Finding modela11y-reportFinding modelstylesheet-parse – CSS stylesheetsstylesheet-parseCSS stylesheetshtml-conform – HTML conformancehtml-conformHTML conformanceaccname – Accessible NameaccnameAccessible Namea11y-rules – Rule seta11y-rulesRule seta11y-perception – Perceptiona11y-perceptionPerceptionweb-checks – robots, meta, JSON-LDweb-checksrobots, meta, JSON-LDa11y-wasm – WebAssembly, npma11y-wasmWebAssembly, npm

Tools built on it

Frequently asked questions

Is BarrierLab itself a tool that checks a page?

No. This repository contains libraries only: Rust crates for accessibility, HTML conformance, perception and web checks. To audit a page you need one of the tools that embed them, such as auditmysite, barrierlab-cli or liveaudit; “Testing a website” in the documentation shows where to start.

Which tools use the libraries today?

auditmysite, astro-post-audit, liveaudit and barrierlab-cli use the crates from crates.io and npm. Because they share the rule set, a finding ID means the same thing in all of them.

What does it mean when a rule is marked “not run”?

Some rules need data not every host can supply, such as focus or computed styles for static HTML. When the prerequisite is missing, the rule is listed in the report with the reason instead of counting as passed.

Can I use a single parser without the audit code?

Yes. The L0 crates (html5-parser, csp-parse, media-query-parse, xpath-eval, relax-ng, schematron-engine) are independent of the audit code. xpath-eval and schematron-engine are generic over the document model and also work outside HTML.

Why is there no shared changelog?

BarrierLab is a monorepo without a common version number. Each crate keeps its own changelog next to its source, so changes to one package are recorded there.