← Chrome 151 reference

v151 · shipped · dom · svg · security

XML Parsing in Rust for non-XSLT scenarios

Chrome 151 enables by default the memory-safe Rust-based XML parser that replaces the C-based libxml2 parser with a memory-safe Rust-based parser for all non-XSLT XML parsing in Blink — including DOMParser, XMLHttpRequest.responseXML, SVG documents, and XHTML.

Behaviour change The Rust parser aims for full spec compliance, which may differ in edge cases from libxml2's behaviour. Code that relied on libxml2-specific quirks in malformed XML handling may see different output. Well-formed XML is unaffected.

at a glance

Shipped inChrome 151 (Enabled by default, all platforms — after a stepped rollout that began at 1% in Chrome 147)
StatusEnabled by default (stepped rollout)
Finch featureXMLRustForNonXslt
Affected APIsDOMParser, XMLHttpRequest.responseXML, SVG documents, XHTML
Not affectedXSLT processing (separate deprecation track, removal planned Chrome 158)
Blink componentBlink>DOM, Blink>SVG
ChromeStatus5309598397497344 — XML Parsing in Rust for non-XSLT scenarios
Source: blink-dev Intent to Ship — XML Parsing in Rust for non-XSLT scenarios, February 2026.

why it exists

Blink has historically relied on libxml2, a C library, for XML parsing. libxml2 has accumulated a long history of memory-safety vulnerabilities — use-after-free bugs, buffer overflows, heap corruption — that are fundamentally difficult to prevent in C. In addition, libxml2 experienced periods of slow security-disclosure response.

Replacing the parser with a Rust implementation eliminates this entire class of memory-safety vulnerability by construction. XSLT scenarios are excluded from the initial rollout because libxml2 and libxslt are tightly entangled; the Rust parser cannot yet be applied there without also replacing the XSLT engine (which is on a separate deprecation track).

The rollout began at 1% of Chrome 147 stable users and reached enabled-by-default in Chrome 151 (chromestatus milestone listing). During the rollout, Chromium engineers monitored with Chromium engineers monitoring a real-world parsing performance histogram (Blink.XMLParsing.NonXsltXmlParsingTime.Combined) before expanding. A ~50% throughput regression was observed on a 3 MB heavy-XML microbenchmark, so the team is gathering production data to validate real-world impact is acceptable.

Source: blink-dev Intent to Ship — XML Parsing in Rust for non-XSLT scenarios, February 2026.

what changes

This is a transparent implementation swap — the web-facing APIs are unchanged. All of the following continue to work identically for well-formed XML:

API / scenarioUses Rust parser in Chrome 151+
DOMParser.parseFromString(str, 'text/xml')Yes
DOMParser.parseFromString(str, 'application/xhtml+xml')Yes
XMLHttpRequest.responseXMLYes
Top-level SVG navigation (.svg file in address bar)Yes
SVG external image (<img src="...svg">)Yes
XHTML documentsYes
XSLT processingNo — still uses libxml2/libxslt

example: DOMParser (unchanged API)

// API shape is identical — only the underlying parser changes
const parser = new DOMParser();
const doc = parser.parseFromString(
  '<root><item id="1">Hello</item></root>',
  'text/xml'
);
console.log(doc.querySelector('item').textContent); // "Hello"

// Malformed XML still produces a parsererror document
const bad = parser.parseFromString('<unclosed', 'text/xml');
console.log(bad.querySelector('parsererror')); // HTMLElement
Source: blink-dev Intent to Ship — XML Parsing in Rust for non-XSLT scenarios, February 2026.

browser support

BrowserXML parser
Chrome 151+ (all platforms)Rust parser for non-XSLT (enabled by default; stepped rollout began at 1% in M147)
FirefoxOwn XML parser (Expat-based)
SafariOwn XML parser (libxml2-based historically)
Source: chromestatus.com feature page; blink-dev thread, February 2026.

see also