jsdom
31.0.0 · 5 Nov 2026MIT154.5M / weekRepositoryHomepagenpmAtom feed
Where each line stands
Plan an upgradeLatest releases
All 280 releases- 31.x · latest line
31.0.0
5 Nov 2026- Breaking
Changed the optional canvas and image decoding backend from
canvasto@napi-rs/canvas. Install@napi-rs/canvasv1.0.13 or later in the v1.x series alongside jsdom; installingcanvasalone no longer enables this support. The new backend provides prebuilt Skia binaries on supported platforms, and rendering and encoded image bytes can differ. Projects using native canvas objects or custom font registration should follow the canvas migration guidance. Added WebP serialization throughcanvas.toDataURL()andcanvas.toBlob(). Fixed image loading to wait for decoding before firingload, discard obsolete source requests, avoid refetching when dimensions change, and prevent failed images from drawing stale contents. Fixed canvas context and serialization behavior, including unsupported context types, read-onlyctx.canvas, image-drawing exceptions, MIME type and quality normalization, and asynchronousnullresults fromcanvas.toBlob()for empty canvases or encoding failures. - Breaking
Changed CSS parsing, selector matching, and computed styles to use a new integrated implementation, with substantially expanded support and faster selector queries and repeated style reads. This includes cascade layers, nesting,
@scope, custom-property substitution and registration through@propertyandCSS.registerProperty(), typedattr(), conditionalif(), shadow-tree styling with:host,::slotted(), and::part(), pseudo-element computed styles, and constructable stylesheets withdocument.adoptedStyleSheetsandshadowRoot.adoptedStyleSheets. Fixed numerous cascade, shorthand, serialization, and default-style issues; computed declarations now stay live across DOM and stylesheet changes. CSS serialization and computed values can differ from previous releases. - Breaking
Changed HTML and XML parsing to pause at blocking scripts until their required resources are ready. The
JSDOMconstructor,JSDOM.fromURL(), andJSDOM.fromFile()can now return partially parsed documents. Wait forDOMContentLoadedfor the finished tree, or the window'sloadevent for load-delaying resources, checkingdocument.readyStatefirst in case the event has already fired. XML syntax errors encountered after asynchronous parsing resumes are reported through the virtual console as"xml-parsing"errors.
Breaking changes
- Breaking
Changed the optional canvas and image decoding backend from
canvasto@napi-rs/canvas. Install@napi-rs/canvasv1.0.13 or later in the v1.x series alongside jsdom; installingcanvasalone no longer enables this support. The new backend provides prebuilt Skia binaries on supported platforms, and rendering and encoded image bytes can differ. Projects using native canvas objects or custom font registration should follow the canvas migration guidance. Added WebP serialization throughcanvas.toDataURL()andcanvas.toBlob(). Fixed image loading to wait for decoding before firingload, discard obsolete source requests, avoid refetching when dimensions change, and prevent failed images from drawing stale contents. Fixed canvas context and serialization behavior, including unsupported context types, read-onlyctx.canvas, image-drawing exceptions, MIME type and quality normalization, and asynchronousnullresults fromcanvas.toBlob()for empty canvases or encoding failures. - Breaking
Changed CSS parsing, selector matching, and computed styles to use a new integrated implementation, with substantially expanded support and faster selector queries and repeated style reads. This includes cascade layers, nesting,
@scope, custom-property substitution and registration through@propertyandCSS.registerProperty(), typedattr(), conditionalif(), shadow-tree styling with:host,::slotted(), and::part(), pseudo-element computed styles, and constructable stylesheets withdocument.adoptedStyleSheetsandshadowRoot.adoptedStyleSheets. Fixed numerous cascade, shorthand, serialization, and default-style issues; computed declarations now stay live across DOM and stylesheet changes. CSS serialization and computed values can differ from previous releases. - Breaking
Changed HTML and XML parsing to pause at blocking scripts until their required resources are ready. The
JSDOMconstructor,JSDOM.fromURL(), andJSDOM.fromFile()can now return partially parsed documents. Wait forDOMContentLoadedfor the finished tree, or the window'sloadevent for load-delaying resources, checkingdocument.readyStatefirst in case the event has already fired. XML syntax errors encountered after asynchronous parsing resumes are reported through the virtual console as"xml-parsing"errors.
Other changes
Added
window.reportError(), which dispatches anerrorevent and reports uncanceled errors to the virtual console.Added
element.ariaBrailleLabelandelement.ariaBrailleRoleDescription.Fixed page-completion
loadevents to fire only on the window. Usewindow.addEventListener("load", ...)orwindow.onloadinstead of listening on the document.Fixed
document.open(), including implicit calls fromdocument.write(), to clear event listeners and handlers from the document, its descendants, and its window when replacing the input stream.Fixed
document.write()to process successive writes through the parser's input stream, preserve insertion points across nested scripts, and make completed text immediately visible. Script-created input streams now remain open untildocument.close().Fixed dynamically inserted scripts to respect
script.async = falseexecution order, use their source text and document from preparation time, and avoid executing after adoption into another document. Scripts parsed through inert fragment APIs no longer execute when subsequently inserted.Fixed unrelated images, stylesheets, and frames being delayed behind scripts, and resource completion events firing before nested stylesheet imports finish. Cyclic imports no longer prevent completion, and
<style>elements in shadow trees now fireloadevents.Fixed
window.stop()to cancel pending subresource andXMLHttpRequestrequests in descendant frames and suppress completion events for canceled loads, while allowing subsequent requests to proceed.Fixed repeated
document.close()calls replaying readiness and load events, and incorrect iframe load events when reopening documents from event handlers.Fixed memory leaks where pending request interceptor promises retained closed windows, introduced in v28.0.0.
Fixed focus remaining on elements that become non-focusable after DOM or style changes. Focus now moves asynchronously to the document's viewport, and
element.blur()can release it immediately.Fixed
document.hasFocus()returning false before an element is focused or during focus transitions within the document, including inside frames.Fixed
<template>parsing andtemplate.innerHTMLserialization in XML documents, including templates with namespace prefixes.Fixed
rect.toJSON()andperformance.toJSON()to create their result objects in the method's realm instead of the host Node.js realm.
- 30.x · maintenance
30.1.3
15 Oct 2026Fixed slowdowns when focusing elements and running interaction tests, which regressed in v30.1.2.
Fixed
XMLHttpRequestreusing credentials supplied toxhr.open()after cross-origin redirects, including in response to authentication challenges from the destination.
Improved performance of
getComputedStyle()and computed CSS property reads, including with stylesheets containing attribute selectors. (@scttcper, @asamuzaK)Fixed slowdowns when focusing elements and running interaction tests, which regressed in v30.1.2.
Fixed
XMLHttpRequestreusing credentials supplied toxhr.open()after cross-origin redirects, including in response to authentication challenges from the destination.Fixed
XMLHttpRequestincorrectly sending and accepting cookies after cross-origin redirects back to the document's origin whenxhr.withCredentialsis false.Fixed exceptions from malformed CSS math functions, such as
calc(0px - @submenu_space), while parsing documents, stylesheets, and style declarations.Fixed
getComputedStyle()ignoring style rules nested inside multiple@mediarules.Fixed CSS shorthands overwriting longhands with higher priority or specificity during style computation, including declarations containing CSS variables.
Fixed
getComputedStyle()returning unresolved or inconsistent shorthand values, including for 'background', 'border', 'flex', 'font', 'margin', and 'padding', and incorrect shorthand defaults and inheritance.Fixed computed background positions to resolve font-relative lengths using the final font size and handle multiple image layers correctly.
Fixed computed 'color' values depending on property read order, including unresolved
color-mix()results, which regressed in v29.0.2.Fixed
currentcolorborder colors incorrectly becoming transparent when 'color' useslight-dark()or relative color syntax.Fixed CSS calculations that reduce to a percentage incorrectly producing pixel values, which regressed in v30.0.0.
Fixed numeric font weights in the 'font' shorthand incorrectly setting 'line-height'.
Fixed selector matching involving XML namespaces, and selectors such as
[data-a|=""]failing to match empty values and values beginning with-.
30.1.2
4 Oct 2026Updated URLs to support Unicode v18.0.0 in internationalized domain names.
Reduced package size and memory use for CSS property definitions.
Fixed severe slowdowns when building large DOM trees, including SVG charts with D3, which regressed in v30.1.0.
Updated URLs to support Unicode v18.0.0 in internationalized domain names.
Reduced package size and memory use for CSS property definitions.
Fixed severe slowdowns when building large DOM trees, including SVG charts with D3, which regressed in v30.1.0.
Fixed exponentially slow reads of empty inherited CSS custom properties in deeply nested documents, and custom properties incorrectly inheriting past an
initialreset.Fixed
getComputedStyle()returning stale results after editing stylesheet declarations, selectors, or media queries, including in imported stylesheets.Fixed selector matching and computed styles after changes to form control checkedness, indeterminacy, selection, values, and validity, including during form resets and canceled clicks.
Fixed computed styles for
:focus,:focus-visible,:focus-within, and selectors containing them after focus changes, including inside focus and blur listeners.Fixed
element.focus()incorrectly focusing elements hidden by 'display', including through shadow hosts and slots, and elements excluded by shadow DOM slot assignment.Fixed
getComputedStyle()throwing for elements without inline-style support, including XML and MathML elements.Fixed a memory leak where stylesheet parsing retained the last parsed stylesheet's window after
window.close().Fixed memory growth from long-lived
MutationObserverinstances retaining bookkeeping for garbage-collected nodes.Fixed retained
select.selectedOptionscollections becoming stale after selection changes and form resets.Fixed rejection of negative CSS sizing values, including for 'min-width', 'min-height', 'max-width', and 'max-height', which regressed in v30.1.0.
Fixed handling of deeply nested
color-mix()expressions, including exceptions during color resolution.
Dependency tracking · free for 3 projects
Know when your own dependencies move
jsdom shipped 4 new majors in the last 12 months, among 17 releases. inlinr shows which of your projects are behind, and what the upgrade breaks.
Advisories reach you
An email when a critical or high advisory affects a project, before the next install.
Upgrades checked first
Peer ranges, Node, ESM-only and types changes read before you bump.
Only what matters
Majors and breaking notes stay; patches and sibling bumps fold into one line.
Reading releases, release notes and advisories…
Registry facts last checked 8 Nov 2026. Releases and advisories last read 8 Nov 2026.