npm / jsdom
jsdom
What changed in jsdom 0.2 to 30, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
240 breaking6 security3 deprecations353 new APIs and options38 performance95 behavior and defaults1 tooling724 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initjsdom 30118 changes
Breaking changes 5
Cross-origin redirects no longer reuse credentials supplied to xhr.open(), including during destination authentication challenges.
The default blobEvent.timecode is now NaN.
DOM APIs now reject user-created proxies where genuine DOM objects are required.
Storage events are no longer sent to windows created afterward, while surviving recipients still receive events after source destruction.
The minimum supported Node.js version was raised.
Security 3
When withCredentials is false, XMLHttpRequest no longer incorrectly sends or accepts cookies after cross-origin redirects back to the document origin.
Fixed XML HTML serialization to reject invalid attribute characters and avoid stack overflows on large strings.
base elements now ignore data: and javascript: URLs.
New APIs and options 6
Elements can be accessed by name directly on document, such as document.myForm.
Adds QuotaExceededError for storage quota errors and oversized crypto.getRandomValues() requests.
Added the background-position-x CSS property.
Added the background-position-y CSS property.
Added the CSS.escape() function.
Added the CSS.supports() function.
Performance 9
Improved computed style and CSS property read performance, including stylesheets containing attribute selectors.
CSS property definitions now use less package space and memory.
Building large DOM trees is no longer severely slowed, including SVG charts created with D3.
Long-lived MutationObserver instances no longer retain bookkeeping for garbage-collected nodes, reducing memory growth.
DOM construction, tree mutations, range operations, and live collection access are faster, especially on large documents.
Memory use is reduced for DOM nodes, attributes, event listeners, and mutation observers.
Event dispatch, form and label lookups, select updates, and radio-group updates are faster.
Computed-style retrieval, style changes, and CSS serialization are faster.
Range operations on large documents are faster.
Behavior and default changes 3
URLs now support Unicode v18.0.0 in internationalized domain names.
Element, attribute, and document type creation now supports relaxed DOM naming rules.
Retained references continue to provide access to the document and DOM after window.close().
Fixes and other changes 92
Computed background positions now resolve font-relative lengths using the final font size and handle multiple image layers correctly.
Computed color values no longer depend on property read order, including unresolved color-mix() results.
CSS calculations reducing to a percentage no longer incorrectly produce pixel values.
Malformed CSS math functions no longer throw exceptions while parsing documents, stylesheets, and style declarations.
Selector matching now handles XML namespaces and attribute selectors matching empty values and values beginning with a hyphen.
Currentcolor border colors no longer incorrectly become transparent when color uses light-dark() or relative color syntax.
Fixed slowdowns when focusing elements and running interaction tests that regressed in v30.1.2.
Numeric font weights in the font shorthand no longer incorrectly set line-height.
Computed styles now include style rules nested inside multiple @media rules.
CSS shorthands no longer overwrite higher-priority or more-specific longhands during style computation, including declarations with CSS variables.
Shorthand values now resolve consistently with correct defaults and inheritance for background, border, flex, font, margin, and padding.
Deeply nested color-mix expressions now resolve correctly without exceptions.
Deeply nested reads of empty inherited custom properties no longer become exponentially slow, and inheritance stops at an initial reset.
Negative CSS sizing values are no longer incorrectly rejected for min-width, min-height, max-width, and max-height.
focus() no longer focuses elements hidden by display or excluded through shadow DOM slot assignment.
Focus-related selectors and computed styles now update correctly after focus changes, including inside focus and blur listeners.
Computed styles now update after editing declarations, selectors, or media queries, including imported stylesheets.
getComputedStyle() no longer throws for XML and MathML elements without inline-style support.
selectedOptions collections now remain current after selection changes and form resets.
Selectors and computed styles now update correctly after form control state changes, resets, and canceled clicks.
Stylesheet parsing no longer retains the last parsed stylesheet's window after window.close().
Fixed exceptions from truncated charset parameters and incomplete meta tags affecting encoding detection.
Fixed selector matching for :lang(), :nth-child(... of ...), and :has() in mutation and duplicate-ID cases.
Fixed element.focus() incorrectly focusing disabled controls and hidden inputs with tabindex="".
Fixed focus and blur behavior across frames and when focusing the document viewport.
Fixed removed or disabled focus targets becoming active and listener-created text selections being overwritten.
Fixed encoding detection to honor XML declarations and detect UTF-16 without a byte order mark.
Fixed !important handling when updating CSS longhands after shorthands, using variables or CSS-wide keywords, and assigning properties directly.
Fixed noscript parsing with includeNodeLocations or inside frames to honor runScripts.
Fixed the storageQuota option being ignored by frames.
Fixed invalid style.setProperty() calls changing existing !important priorities, serialized styles, or mutation records.
Fixed spurious events and incorrect relatedTarget values after removing the previously focused element.
Fixed XML serialization errors for special namespace names and incorrect reuse of sibling namespace prefixes.
ownerDocument is corrected after adopting or assigning an attribute node across documents.
Adjacent shorthand components, invalid assignments, and unusual CSS declaration characters now parse correctly without inline-style crashes.
Computed border widths are corrected, including borderless elements that incorrectly reported 16px.
Successful cached resource loads are no longer treated as aborted.
Modified CDATA sections and processing instructions now clone, import, and serialize correctly.
The CSS object shape and property descriptors now match expected behavior.
Case-sensitive CSS attribute selector values now retain their correct case sensitivity.
Lengths and percentages inside CSS math functions now resolve correctly to pixels or percentages.
CSS values mixing lengths or percentages with math functions now parse correctly.
Queued work stops after window.close() or iframe removal, preventing new scripts, loads, timers, and animation frames.
currentScript is correct during nested script execution and scripts in shadow trees.
Queries now find matching elements when an earlier element shares the same ID but fails the rest of the selector.
Documents created with createDocument() or createHTMLDocument() now reach readyState complete.
Document replacement, element and doctype placement, and mutations during replaceWith() now follow valid DOM behavior.
Elements from DOMParser-created documents no longer become window named properties or remain retained in memory.
Fresh lookups now use the adopted document's case-sensitivity rules when moving between HTML and XML documents.
Selectors now match when the first selector part matches the element itself.
tagName no longer retains stale casing after adoption between HTML and XML documents.
translate now handles empty translate attributes and elements without parents correctly.
readAsText() now honors the blob MIME charset when no supported explicit encoding is supplied.
Unitless zero values parse correctly, while negative flex-basis lengths and percentages are rejected.
Focus state is corrected after removing a focused element or ancestor, including in shadow trees.
:focus now matches correctly in shadow trees.
getComputedStyle() now resolves font-weight keywords to numeric values.
Repeated calls no longer alter case-sensitive background URLs or inconsistently resolve border shorthands with system colors.
Computed styles now use the correct stylesheet order after style elements are inserted or updated.
Computed styles now account for nested @import and @media rules and update after imports finish loading.
Parent documents no longer wait indefinitely when a child iframe removes itself while loading.
Cloning input elements now preserves input.indeterminate.
input.list now works correctly in detached element trees.
Large valueAsNumber assignments now work for time and local date/time inputs.
Resource loading and JSDOM.fromURL() no longer hang when response handling throws.
Serialization now handles min() and max() containing nested calc().
Mutation observers, abort signals, and storage tracking no longer retain removed nodes, listeners, or closed windows.
Attribute lookups, ID lookups, and element behavior now remain correct after namespace prefix changes.
lookupNamespaceURI() now handles the xml and xmlns prefixes correctly.
NodeIterator traversal now remains correct when its filter removes nodes.
Radio grouping and checkedness now handle differing form owners, external and unnamed controls, and canceled clicks.
CDATA boundary offsets and range cloning, extraction, deletion, insertion, and stringification now work correctly.
Cancellation now works across redirects, pending requestInterceptor() callbacks, and XMLHttpRequest reuse after abort.
Script execution now responds correctly to src, type, for, and event attribute changes.
Inserting children into a connected empty script no longer executes scripts incorrectly.
Ordering is corrected for scripts, custom-element callbacks, iframe loading, and mutation observers during insertion.
Select selection remains correct when options or entire select elements move, and unrelated descendants change.
Style invalidation, stylesheet removal, and frame source updates now work correctly in shadow trees.
Shorthand assignments no longer produce extra mutation records or custom-element callbacks for intermediate values.
viewportElement now resolves correctly inside symbol elements.
normalize() no longer incorrectly removes text nodes or merges their siblings.
Textarea hard wrapping now uses the numeric textarea.cols value.
Time input parsing and serialization now preserve fractional seconds.
volumechange and ratechange events now fire asynchronously.
Named-property collections on window are no longer stale, and empty or namespaced IDs and names no longer create incorrect access.
Event dispatch and window.event now work for non-node targets, including correct default passive listener handling.
Lone surrogates in XML are replaced with the Unicode replacement character.
XPath iterators now invalidate correctly after mutations and report errors for invalid result types.
Fixed getComputedStyle with calc() and other functions throwing exceptions after a regression in v30.0.0.
CSS function serialization was corrected, including values returned by getPropertyValue().
document.evaluate() now throws the correct error type.
Length values returned by getComputedStyle() are now converted into pixels.
jsdom 2930 changes
Breaking changes 4
The keyText getter and setter now validate values.
The selectorText setter now rejects invalid selectors.
MediaList now parses media queries properly; invalid queries become "not all" per spec.
The minimum supported Node.js v22 version is now 22.13.0.
New APIs and options 8
Added basic support for the ratio CSS type.
CSSCounterStyleRule is now available on jsdom Window objects.
cssMediaRule now exposes a matches getter.
CSSNamespaceRule is now available on jsdom Window objects.
cssSupportsRule now exposes a matches getter.
styleSheet now exposes href.
styleSheet now exposes ownerNode.
styleSheet now exposes title.
Performance 3
Significantly optimized initial calls before the computed style cache warms up.
getComputedStyle() is significantly faster, reducing the runtime cost of computed-style access.
Document initialization is faster by lazily initializing the CSS selector engine.
Fixes and other changes 15
Fixed computed style computation when using background-origin and background-clip CSS properties.
Fixed computed style serialization for the border-radius CSS property.
Fixed getComputedStyle() sometimes returning outdated results after CSS was modified.
Parsing of the CSS background and border shorthand properties was fixed.
Computed value rules now cover more properties, with fixes for inheritance, defaulting keywords, custom properties, currentcolor, and system colors.
CSS parsing now handles border, background, and their sub-shorthands containing keywords or var().
Returns a more functional CSSStyleDeclaration object with indexed access support, restoring behavior regressed in v29.0.0.
CSSOM serialization, parsing, and API behavior is improved, especially around edge cases.
CSSStyleDeclaration modifications now properly trigger custom element reactions.
The disallow modification flag is now checked in all mutation methods.
getComputedStyle() no longer crashes in XHTML documents containing at-rules.
Nested @media rule parsing now works correctly.
A memory leak when stylesheets were removed from the document has been fixed.
A potential hang in synchronous XMLHttpRequest caused by a worker-thread race condition has been fixed.
The response getter now returns null during the LOADING state instead of parsed JSON.
jsdom 2820 changes
Breaking changes 2
These elements now fire load rather than error events on non-OK HTTP responses.
WebSockets are no longer correctly throttled to one connection per origin, causing a regression.
New APIs and options 1
Added a method for reading a Blob as text.
Performance 1
Synchronous requests avoid about 400ms of repeated setup overhead after the first request.
Behavior and default changes 1
MIME type sniffing was added to iframe and frame loads.
Fixes and other changes 15
Returns the first element in tree order when multiple elements share the same ID.
Restored compatibility when Node.js built-in fetch was used before importing jsdom.
Event timing and result state now more closely follow the specification.
Now accounts for CSS specificity when multiple rules apply.
Correctly handles !important priority.
SVG elements no longer incorrectly proxy event handlers to the Window.
Synchronous requests no longer potentially hang when dispatch errors occur.
Query components of anchor elements now decode correctly in non-UTF-8 documents.
APIs now correctly snapshot data passed through ArrayBuffers.
A redirected document's referrer is now the initiating page rather than the last redirect hop.
APIs now correctly snapshot data passed through typed arrays.
Using WebSockets no longer emits a require("url").parse() deprecation warning.
WebSocket upgrade requests can now be intercepted by customizable resource loading.
XMLHttpRequest fetches can now be intercepted by customizable resource loading, except synchronous requests.
Many small correctness issues in XMLHttpRequest were fixed.
jsdom 2740 changes
Breaking changes 9
XML byte decoding uses UTF-8 more often instead of sniffing meta charset or using the parent frame's encoding.
The minimum supported Node.js versions are now v20.19.0+, v22.12.0+, or v24.0.0+; earlier versions should remain on jsdom v26.1.0.
element.click() now fires a PointerEvent instead of a MouseEvent.
jsdomError events for failed XMLHttpRequest fetches are no longer emitted.
Node.js v20 is now the minimum supported version.
Certain events are now passive by default.
Renamed sendTo() to forwardTo() on the virtual console.
The omitJSDOMErrors boolean option was replaced by jsdomErrors.
The virtual console sendTo() method was renamed to forwardTo().
New APIs and options 9
Added TextDecoder support.
Added TextEncoder support.
Added the BeforeUnloadEvent event constructor.
Added customElements.getName().
Added the DeviceMotionEvent event constructor, without requestPermission().
Added the DeviceOrientationEvent event constructor, without requestPermission().
Added movementX to MouseEvent from the Pointer Lock specification.
Added movementY to MouseEvent from the Pointer Lock specification.
forwardTo() now accepts jsdomErrors to control which errors reach the Node.js console.
Behavior and default changes 6
CSS parsing was improved, which may affect how CSS is interpreted by jsdom.
CSSOM object APIs were improved, which may affect code interacting with parsed CSS objects.
CSS parsing and CSSOM object APIs were improved through updates to @acemir/cssom.
CSS parsing now supports nested selectors, nested declarations, layer statements, and improved at-rule validation.
The input pattern attribute now uses the v regular expression flag instead of u.
The user agent stylesheet is now derived from the HTML Standard.
Fixes and other changes 16
HTML byte decoding is much more correct through use of the new @exodus/bytes package.
Fixed a memory leak when ranges were used and their referenced elements were removed.
@import-ed stylesheets are properly exposed to CSSOM without overwriting sheets created by link or style elements.
The engines field now reflects the minimum Node.js versions required to run jsdom.
Changes to attributes are now picked up correctly by selector cache invalidation.
CSS display style resolution was fixed.
Upgraded cssstyle with various CSS parsing fixes.
CSS system colors now resolve correctly.
document.createEvent() now accepts a more correct set of event names.
Fixed the ElementInternals accessibility getters and setters.
The CSS inherit keyword now resolves correctly.
The CSS initial keyword now resolves correctly.
The url option now updates document.baseURI and properties derived from it.
Fixed Object.defineProperty() on certain objects, including HTMLSelectElement instances.
The CSS unset keyword now resolves correctly.
Fixed specification conformance issues involving named properties and data-to-accessor property changes.
jsdom 2615 changes
New APIs and options 9
Added the SVGSVGElement createSVGRect() method.
Added indexed property support to HTMLFormElement.
Added SVGAnimatedPreserveAspectRatio, including support in the reflection layer.
Added SVGAnimatedRect, including support in the reflection layer.
Added partial support for the SVG defs element and its class.
Added AbortSignal.any().
ElementInternals now supports the labels property for form-associated custom elements.
Initial support makes form-associated custom elements labelable.
Updated whatwg-url adds support for URL.parse().
Performance 1
Various performance improvements were made through caches, microoptimizations, and deferred object creation.
Behavior and default changes 1
Updated CSS dependencies improve CSS parsing capabilities.
Fixes and other changes 4
Updated viewportElement() to correctly establish the viewport based on ancestor elements.
Updated nwsapi improves CSS selector matching.
The returned promise now properly rejects when a server redirects to an invalid URL.
Fixed handling around <noframes> elements and HTML entity decoding.
jsdom 251 changes
Breaking changes 1
The prototype chain stays entirely within jsdom when runScripts is set to dangerously or outside-only, which could change instanceof behavior.
jsdom 249 changes
Breaking changes 2
blur() no longer fires focus or focusin on Document, and blur or focusout no longer set relatedTarget.
:has() support was removed as a functionality regression from reverting to nwsapi.
New APIs and options 1
Added getSetCookie() to the Headers class for retrieving Set-Cookie header values.
Behavior and default changes 1
CSS parsing now supports additional CSS constructs.
Fixes and other changes 5
Bare property calls to postMessage() are fixed to use window.postMessage().
Fixed the
inoperator when applied to EventTarget methods in Node.js ≥22.5.0.Selection methods now trigger the selectionchange event on the Document object.
Fixed creation and parsing of elements named after Object.prototype properties such as constructor and toString.
Edge-case behavior was fixed for input.maxLength.
jsdom 238 changes
Breaking changes 1
Node.js v18 is now required as the minimum supported version.
New APIs and options 2
Added string-valued ARIA attribute-reflecting properties to Element.
Added an initial implementation of ElementInternals, including the shadowRoot getter and string-valued ARIA properties.
Performance 1
Selector-heavy workloads may experience a performance regression with the new engine.
Fixes and other changes 4
Now follows the latest specification, including updated handling of empty string inputs and possible new URLs.
Now follows the latest specification, including updated handling of empty string inputs and possible new URLs.
The setter now handles NaN correctly.
Fixed the incorrect canvas peer dependency introduced in v23.0.0.
jsdom 2210 changes
Breaking changes 1
Node.js v16 is now the minimum supported version.
New APIs and options 6
Added abortSignal.throwIfAborted().
Added AbortSignal.timeout() for creating timeout-based abort signals.
Added crypto.randomUUID() for generating UUIDs.
Added DOMRect.
Added DOMRectReadOnly.
The FormData constructor now supports the submitter argument.
Fixes and other changes 3
DOMParser-created documents now inherit their URL from the creating document.
Color-based properties now resolve named colors and attempt to provide initial inheritance support.
Window event handler properties now reflect the latest list from the standard.
jsdom 2121 changes
Breaking changes 3
Script elements without a src attribute no longer fire load events.
formEl.submit() no longer fires submit events.
The window, document, location, and top properties are now non-configurable.
New APIs and options 3
MouseEvent now includes x, y, pageX, pageY, offsetX, and offsetY properties.
SubmitEvent now exposes the submitter property.
Window.location now has a setter that forwards to location.href, with URL setting implemented only for fragment navigations.
Performance 1
getComputedStyle() now caches results, improving performance.
Behavior and default changes 2
getComputedStyle() now supports the unset CSS value.
Image input elements now submit forms.
Fixes and other changes 12
Corrected pageX, pageY, offsetX, and offsetY values during MouseEvent dispatch.
Selector engine fixes were included through the nwsapi upgrade.
Corrected the new end index calculated when setRangeText() is used on input and textarea elements.
Several CSS parsing bugs were fixed by replacing cssom with the maintained rweb-cssom parser.
URL changes now propagate to the history API, preventing history.replaceState() from corrupting the URL.
Assigning an empty hash now preserves an existing # in location.href.
getComputedStyle() now correctly applies inheritance for pointer-events.
screenX and screenY now preserve fractional values instead of coercing them to integers.
Removed link stylesheets no longer affect the document.
Deferred script elements added after DOMContentLoaded now execute instead of being skipped.
Several issues with JSDOM.fromURL() in the browser build have been fixed.
selectElement.selectedOptions is now correct when optionElement.selected is set, reverting a related option-appending performance improvement.
jsdom 2012 changes
Breaking changes 1
Node.js v14 is now the minimum supported version.
New APIs and options 3
Added the signal option to addEventListener().
Added crypto.getRandomValues().
Added HTMLFormControlsCollection and RadioNodeList, so formEl.elements now behaves correctly.
Performance 1
Appending option elements to select elements is faster.
Fixes and other changes 7
DOMParser now works on XML documents containing emoji.
Custom element creation is no longer affected by modifications to the window.customElements property.
getModifierState now properly consults the event's ctrlKey, altKey, metaKey, and shiftKey properties.
Calling xhr.abort no longer throws an exception when the constructed XMLHttpRequest is invalid.
The method now accepts typed array subclasses.
The getter no longer crashes for opaque-path URLs, including the default about:blank URL.
Fixed the :root pseudoclass to work correctly.
jsdom 192 changes
Breaking changes 1
Returns undefined for nodes originating from fragment parsing, making node locations reliable with respect to the original document source.
Fixes and other changes 1
Calling window.close inside the Window load event no longer crashes.
jsdom 1814 changes
Breaking changes 2
Almost all Promise and TypeError instances now use the jsdom global, potentially changing instanceof checks.
WebSocket SSL certificate checking now respects ResourceLoader strictSSL, which defaults to true.
New APIs and options 2
AbortSignal now exposes a reason property.
abortSignal.abort() now accepts a reason argument.
Performance 2
Node insertion performance was improved.
node.contains() performance was improved.
Fixes and other changes 8
Fixed connectedCallback firing in situations involving document fragments, which was broken in v18.0.1.
headers.append() now normalizes values.
headers.set() now normalizes values.
pageshow events now have bubbles and cancelable enabled.
Live Ranges now update correctly after calling node.normalize().
Live Ranges now update correctly after child nodes are removed.
Setting valueAsDate to null now sets the value to an empty string instead of throwing.
Form submission no longer occurs when the form is invalid.
jsdom 171 changes
Breaking changes 1
Node v12 is now the minimum supported version, so older Node.js runtimes are no longer supported.
jsdom 16119 changes
Breaking changes 11
Removed ondragexit from Window and related interfaces.
Using the second pseudo-element argument now emits a not-implemented warning, except ::part and ::slotted throw according to the spec.
createDocument now returns an XMLDocument instead of a Document.
StyleSheetList no longer inherits from Array.prototype, improving spec compliance.
When runScripts remains undefined, noscript children are parsed as nodes rather than text.
Removes document.origin.
A more general API replaces dom.runVMScript() for accessing jsdom's internal VM context.
The dom.runVMScript() API was replaced and is no longer available.
Node v10 is now the minimum supported runtime version.
JavaScript-spec-defined globals are exposed uniformly, as outer-environment aliases when disabled and fresh scripting-environment copies when enabled.
Each jsdom Window now creates new instances of all web platform globals instead of sharing constructors and prototypes.
New APIs and options 20
Added AbortSignal.abort() for creating an aborted signal.
Added the parentNode.replaceChildren() API.
Added the inputType property to input events.
Added the window.event API.
Added the window.queueMicrotask() API.
Added support for custom elements, enabling developers to use them with jsdom.
Added console.timeLog() support.
Adds the AbstractRange API for working with DOM ranges.
Adds a working Comment constructor.
Adds a working DocumentFragment constructor.
Adds stepDown() to input elements.
Adds stepUp() to input elements.
Adds valueAsDate to input elements.
Adds valueAsNumber to input elements.
Adds the Range API for working with DOM ranges.
Adds the Selection API for accessing and manipulating document selections.
Adds the StaticRange API for working with static DOM ranges.
Adds a working Text constructor.
Adds window.getSelection() for accessing the document selection.
Adds window.origin.
Performance 2
Repeated access to el.tagName is faster, indirectly improving selector matching and style computation.
Improves the performance of getComputedStyle().
Behavior and default changes 2
The return value now includes dummy x and y properties.
Attr now extends Node, aligning its object model with specifications.
Fixes and other changes 84
Fixed incorrect cascade computation in getComputedStyle().
textareaEl.value now applies wrapping when the wrap attribute is specified.
Fixed handling when code running inside jsdom throws null or undefined as an exception.
Fixed several XMLHttpRequest issues around header processing.
Fixed infinite recursion when observing elements inside a MutationObserver callback.
The wildcard header now works with XMLHttpRequest.
Constructed comment nodes now receive the correct ownerDocument.
The returned promise now resolves with the custom element constructor.
HTML parsing now treats noscript elements appropriately.
Inline event handlers now behave correctly when globals named element or formOwner exist.
Validity checking now works for controls associated through the form attribute outside the form element.
Canceling a checkbox or radio click now restores the previous indeterminate value.
The form property now correctly reflects the legend's parent fieldset.
NodeIterator remains functional beyond ten instances and uses less memory from inactive iterators.
The text property now excludes script descendants.
Disconnected radio buttons and checkboxes no longer fire input and change events.
SVG templates now parse without throwing and use the SVG namespace.
Constructed text nodes now receive the correct ownerDocument.
JSON responses now strip a leading BOM when responseType is json.
Restores customElements.get() after a regression in v16.5.0.
Adds a setter so window.event can be overwritten and globals named event can be assigned in the jsdom context.
about:blank iframe URLs no longer incorrectly inherit the parent URL.
Fixed edge cases involving callback functions and event handlers.
Fixed a potential memory leak involving custom elements.
Fixed edge cases involving properties of proxy-like objects such as dataset.
new File() no longer converts slash characters to colons.
Filesystem subresources now load correctly when filenames contain non-ASCII characters.
The hidden attribute now causes display: none according to the user-agent stylesheet.
Checkbox inputs remain mutable when disabled.
Radio inputs remain mutable when disabled.
Fixed edge cases involving properties of proxy-like objects such as localStorage.
Mutation observer callbacks now receive the MutationObserver instance as their this value.
xhr.response now returns null for failures occurring during download.
Cross-origin XMLHttpRequest responses now expose the Content-Length header.
XMLHttpRequest no longer fires a redundant final progress event with the same loaded value.
draggable="" attribute processing now uses ASCII case-insensitivity instead of Unicode case-insensitivity.
el.focus() now does nothing when called on disconnected elements.
el.focus() now works on SVG elements.
Removing the currently focused element now moves focus to the body element.
form.elements now respects form="" and can contain non-descendant form controls.
imgEl.complete now returns true for images with empty or unset src attributes.
With canvas enabled, imgEl.complete now returns true when an image-loading error occurs.
imgEl.complete now returns false when an image's src attribute is reset to an empty value.
translate="" attribute processing now uses ASCII case-insensitivity instead of Unicode case-insensitivity.
The valueMissing validation check for radio inputs is corrected.
Drawing an empty canvas into another canvas now works correctly.
Elements with the contenteditable="" attribute are now considered focusable.
A second failing image load now fires an error event instead of sometimes firing load when canvas is installed.
el.focus() and el.blur() now fire focusin and focusout events.
Edge-case behavior for event listener objects with handleEvent properties is fixed.
NodeFilter is now scoped per Window instead of shared across all Windows.
DOM objects can now be used as addEventListener arguments without triggering errors.
Running jsdom in a browser now detects globals more reliably.
Calling click on a label or descendant no longer causes infinite recursion.
Closing a window with outstanding requests to data URLs no longer causes errors.
The del cite property now properly reflects its value as a URL.
getComputedStyle now accounts for inline style attributes.
Month input values are now consistent across affected time zones and times.
The input src property now properly reflects its value as a URL.
The ins cite property now properly reflects its value as a URL.
requestAnimationFrame no longer prevents the Node.js process from exiting.
Updating a select element's value now invalidates dependent properties such as selectedOptions.
setTimeout no longer leaks closures passed to it.
Number input stepUp and stepDown now use decimal-based calculations instead of floating point calculations.
Window event methods now properly inherit from EventTarget instead of being distinct functions.
Fixed issues using Attr as a Node, including checking baseURI and calling cloneNode().
Fixed edge cases in number/string conversion for element properties reflecting integer attributes.
Fixed a memory leak during parsing introduced in v14.0.0.
Fixed selection-related issues when manipulating input and textarea values.
Handling of rgba() and hsl() colors now includes fixes through cssstyle v2.1.0.
Fixed timer and animation-frame issues, especially around window closing and recursive calls.
Changing an input element's type attribute now behaves correctly.
Validation now behaves correctly when a range input's max value is less than its min value.
Node v10 and v11 support now works when runScripts is set.
fileReader.readAsDataURL() now always base64-encodes the result.
Inserting img elements into documents without a browsing context no longer crashes when canvas is installed.
Fixes validation for email inputs using multiple and pattern attributes.
Fixes incorrect validation errors on readonly input elements.
Fixes validation errors for fractional input values when step is fractional.
input.type now defaults to text.
Fixes character encoding detection when documents use meta charset declarations.
Fixes template elements so they work correctly inside XML documents.
Fixes a memory leak when using window.setInterval().
Fixes a memory leak when using window.setTimeout().
jsdom 1532 changes
Breaking changes 8
Changed the exception thrown when attaching a shadow root to something already acting as a shadow host.
Changed el.tabIndex's default value when no tabindex attribute is set to reflect the updated specification.
selectEl.value now returns the empty string when no option is selected instead of the first option's value.
element.tagName now uses the ASCII uppercase of the element's qualified name instead of Unicode uppercase.
The endings: "native" option now converts line endings to \n on all operating systems.
When parsing binary input, charset now overrides sniffed encoding instead of being ignored.
The endings: "native" option now converts line endings to \n on all operating systems.
Now treats .xht files as application/xhtml+xml instead of text/html, matching .xhtml and .xml handling.
New APIs and options 5
Added shadowRoot.activeElement.
Added a form.requestSubmit() stub to match the existing form.submit() stub.
Added readystatechange events during document loading.
Added the element.translate getter and setter.
Added the Headers class from the Fetch standard.
Behavior and default changes 2
Added basic style inheritance for visibility in getComputedStyle(), laying groundwork for further inheritance, cascading, and specificity work.
The nonce property moved from HTMLScriptElement and HTMLStyleElement to HTMLElement, remaining a simple reflection of the attribute.
Tooling 1
Set canvas as an optional peer dependency, which helps Yarn PnP support.
Fixes and other changes 16
Focusing an already-focused element now does nothing instead of firing additional focus events.
URL hashes are no longer sent to the server or duplicated when constructing the Document.
Namespaced attribute selectors are handled correctly by the selector engine.
WebKit-prefixed pseudo-elements are handled correctly by the selector engine.
Fixed various correctness issues with constructing FormData from a form element.
Fixed validation logic for range inputs.
Reflected properties are no longer affected by overwriting el.getAttributeNS() or el.setAttributeNS().
XML parsing errors now include the filename instead of using "undefined".
The on<event> properties now properly track their related attributes for SVG elements.
The style property now properly tracks its related attribute for SVG elements.
XMLHttpRequest no longer unnecessarily reserializes content-type request headers.
XMLHttpRequest now correctly merges preflight and response headers.
Fixed event path iteration in shadow DOM cases to follow specification fixes.
form.elements now excludes input elements with type=image.
pattern="" form control validation now applies the regular expression to the whole string.
Fixed synchronous XMLHttpRequest behavior on the newly-released Node.js v12.
jsdom 1419 changes
Breaking changes 4
Attribute access now ignores attributes with namespaces, as required by the specification.
During document loading, the load event now targets the Document instead of the Window.
Styles no longer apply to documents without a browsing context, including styles containing @import rules.
Calling JSDOM.fragment() without arguments now creates an empty DocumentFragment instead of one containing the text node "undefined".
New APIs and options 5
The External class is now exposed as a property of window.
The input element now exposes a list property.
The datalist element now exposes an options property.
pageshow events now fire during document loading.
PageTransitionEvent was added.
Behavior and default changes 1
Anchor and area elements with an empty href can activate javascript URLs or fragments.
Fixes and other changes 9
Re-enabling a disabled element restores its activation behavior.
HTML fragment parsing through innerHTML and outerHTML is now spec-compliant.
HTML serialization no longer breaks after certain properties receive non-string values.
option elements now return correct label property values in edge cases.
The pretendToBeVisual option now propagates to child subframes as well as the main Window.
option elements now return correct value property values in edge cases.
Fixed a regression when calling element.blur() on a focused element.
Inserting link elements into documents without a browsing context no longer crashes, and resources are fetched only when browsing-context connected.
Template contents now use a separate browsing-context-less document, preventing resources from being fetched inside templates.
jsdom 1342 changes
Breaking changes 7
Events fired by jsdom now have isTrusted set to true.
XML documents now default to UTF-8 instead of windows-1252.
mediaElement.duration now defaults to NaN.
Radio button group names are now matched case-sensitively.
titleElement.text now returns child text content instead of titleElement.innerHTML.
Support for canvas-prebuilt was removed because canvas v2.x includes a built-in prebuilt version.
DOM tree modifications now prevent impossible trees from being created.
Security 1
getComputedStyle now throws a sensible exception for the wrong argument without exposing jsdom internals.
New APIs and options 13
Added support for MutationObserver.
Added navigator.mimeTypes, which is always empty.
Added navigator.plugins, which is always empty.
The progress element now exposes value, max, and position properties.
Added the outputEl.htmlFor property.
Added el.insertAdjacentElement().
Added el.insertAdjacentText().
Added the defaultValue property to output elements, including form reset behavior.
Added the type property to output elements, including form reset behavior.
Added the value property to output elements, including form reset behavior.
addEventListener() now supports the passive option.
The storageEvent.initStorageEvent() method was added.
The relList property was added to <a>, <area>, and <link> elements.
Performance 1
Parsing large text nodes is faster, particularly for large inline style or script elements.
Behavior and default changes 2
form.reset() now fires a cancelable reset event.
olEl.start now defaults to 1.
Fixes and other changes 18
Nested fieldsets now receive correct disabled-state handling.
DOMParser-created documents now have readyState set to complete.
Summary elements are now focusable.
Clicking summary elements now toggles their parent details element.
XML document DOCTYPE parsing now preserves custom name values.
XML documents loaded in frames and iframes no longer error.
Bubbling click events now activate behavior correctly, including submitting forms from child clicks.
Fixed document.title in SVG documents.
Fixed the value of Element.prototype[Symbol.unscopables].
focus and blur events are now composed.
Reset buttons and inputs now actually perform a form reset when clicked.
node.isConnected now correctly reports nodes inside a shadow tree as connected.
Fixed el.setCustomValidity() for output and fieldset elements.
Fixed the style property on a and area elements.
Textareas now properly account for changes to child CDATA section nodes.
XML parsing now ignores text outside the root element instead of treating it as an error.
Fixed XML serialization for elements with unknown prefixes.
XMLHttpRequest against nonexistent file URLs now produces a network error instead of crashing.
jsdom 1227 changes
Breaking changes 6
Errors are no longer swallowed when the canvas or canvas-prebuilt packages are installed but fail to load.
input and change events for input elements are now trusted and uncancelable.
XML parsing now conforms more closely to specifications, rejecting some ill-formed documents and handling additional constructs correctly.
CSS selection APIs now throw an error for invalid selectors even when used on empty nodes.
jsdom now requires Node.js v8.
The old jsdom API was removed because the new API now provides all required capabilities.
New APIs and options 12
Added the element.toggleAttribute() method.
Added support for shadow roots, slots, composed events, and related shadow DOM functionality.
dom.runVMScript() now accepts an options parameter for configuring script execution.
Custom resource loader fetch() implementations can now see which element initiated the fetch.
Added the fieldsetEl.elements property for accessing elements associated with a fieldset.
Added the fieldsetEl.type property.
Added the countReset() method to console.
Added the dir() method to console.
Added the dirxml() method to console.
Added htmlElement.draggable.
Added the InputEvent class.
Added window.status.
Behavior and default changes 1
window.name now defaults to the empty string instead of "nodejs", per spec.
Fixes and other changes 8
formElement.form now also checks the form="" attribute instead of only the closest ancestor form element.
Fixed XMLHttpRequest sometimes sending an empty request body after a preflight request.
Scripts with the async attribute no longer execute before preceding synchronous scripts, reducing a regression from v12.0.0.
CSS selection APIs no longer sometimes return outdated results, especially for state pseudo-class selectors like :checked.
select.selectedOptions no longer sometimes returns outdated results.
Cloning textarea elements now preserves their values.
The default User-Agent now says "unknown OS" instead of "undefined" when jsdom is used in web browsers.
window.frameElement now returns an actual HTMLElement instance instead of a jsdom internal class.
jsdom 11174 changes
Breaking changes 23
hashchange events no longer bubble, matching the updated specification.
popstate events no longer bubble, matching the updated specification.
Style and script evaluation better follows the specification; scripts inserted by innerHTML are no longer evaluated.
data: URL parsing no longer includes fragment portions.
Various APIs now use ASCII lowercasing instead of Unicode lowercasing for element and attribute names.
Removed probablySupportsContext() from HTMLCanvasElement per specification updates.
Removed setContext() from HTMLCanvasElement per specification updates.
Removed the nonstandard window.createPopup() method.
Removed the nonstandard window.scrollLeft property.
Removed the nonstandard window.scrollTop property.
Stopped XML parsing from interpreting HTML character entities.
document.getElementsByName() now returns a NodeList instead of an HTMLCollection.
Disabled labeled controls no longer receive activation behavior when label.click() is called.
UIEvent now only allows initialization with Window objects for its view property.
blob.close() and blob.isClosed() were removed.
Disconnected forms no longer submit.
Location info objects returned by nodeLocation() now have a different structure after the parse5 upgrade.
The old API no longer accepts custom parsers; parse5 and sax are always used for HTML and XML.
Invalid qualified names now throw InvalidCharacterError instead of NamespaceError DOMExceptions.
Event handler attributes require runScripts: "dangerously"; event handler properties now work with any runScripts value.
Remaining non-spec toString() methods on various prototypes were removed.
Methods accepting web platform objects now type-check arguments and throw TypeError for invalid values.
getAllResponseHeaders() lowercases response headers and separates values with comma-space.
New APIs and options 64
Added element.closest for finding the nearest matching ancestor element.
Added storageQuota to control how much data in-memory storage can contain.
Added StorageEvent support for storage-related event handling.
Added in-memory localStorage support for browser-like storage access.
Added in-memory sessionStorage support for browser-like storage access.
Added el.labels for form control elements.
Added label.control.
Added the node.getRootNode() API.
Added event.returnValue.
Added event.srcElement.
Added node.lookupPrefix().
Added the full constraint validation API to eight HTML element interfaces.
Added getElementById() to DocumentFragment, enabling ID lookup within fragments.
FileReader gains readAsBinaryString(), which was added back to the specification.
Added support for the endings option to the Blob constructor.
Added window.devicePixelRatio.
Added a setter for HTMLInputElement.files.
Added support for the public HTMLMeterElement API except meterEl.labels.
Added getModifierState() to KeyboardEvent.
Added getModifierState() to MouseEvent.
Added window.performance with High Resolution Time basics.
Added performance.now().
Added performance.timeOrigin.
Added performance.toJSON().
Added screen.availHeight, and made all screen properties getters.
Added screen.availWidth, and made all screen properties getters.
Added screen.colorDepth, and made all screen properties getters.
Added screen.pixelDepth, and made all screen properties getters.
Added a fully functioning WebSocket implementation.
Added the locationbar property to Window.
Added the menubar property to Window.
Added the personalbar property to Window.
Added the scrollbars property to Window.
Added the statusbar property to Window.
Added the toolbar property to Window.
Added AbortController support.
Added AbortSignal support.
Added after() to DocumentType, Element, and CharacterData.
Added append() to Document, DocumentFragment, and Element.
Added before() to DocumentType, Element, and CharacterData.
Added node.isConnected.
Added node.isSameNode().
Added prepend() to Document, DocumentFragment, and Element.
Added an option controlling requestAnimationFrame(), cancelAnimationFrame(), document.hidden, and document.visibilityState.
Added replaceWith() to DocumentType, Element, and CharacterData.
Added rudimentary SVG element classes, making SVG elements instances of SVGElement; only SVGSVGElement is concretely implemented for svg.
Added the CompositionEvent class.
Added a <details> element implementation.
Added a stub <marquee> element implementation.
Added a stub <picture> element implementation.
Added a setter for table.caption.
Added the table.createTBody() method.
Added a setter for table.tFoot.
Added a setter for table.tHead.
Added the WheelEvent class.
Added a no-op document.captureEvents() API for compatibility.
Added a no-op document.clear() API for compatibility.
Added a no-op document.releaseEvents() API for compatibility.
Added support for accessing element data attributes through dataset.
Select elements now support indexed and named access, plus item() and namedItem().
Added a no-op AddSearchProvider() API for compatibility.
Added a no-op IsSearchProviderInstalled() API for compatibility.
Updated whatwg-url brought along URLSearchParams.
Event handler properties such as oneventname were added to relevant prototypes and now follow the specification.
Performance 4
Parsing HTML documents with large numbers of sibling elements is faster.
Significantly sped up synchronous XMLHttpRequest.
getComputedStyle() is significantly faster because unsupported selectors were removed from the default style sheet.
HTMLCollection performance was significantly improved, including parsing performance for large documents.
Behavior and default changes 14
Selector matching now uses nwsapi, bringing fixes, performance improvements, and additional selector support.
DOMTokenList.replace() now returns a boolean, matching the recent specification addition.
MIME type parsing was improved throughout jsdom using the new whatwg-mimetype package.
All window.screen properties are now getters.
Added XML CDATA section parsing, including through domParser.parseFromString().
Converted DOMTokenList to proxies for improved specification compliance and liveness.
FileList now supports indexed property access such as fileList[i].
select.options is now an HTMLOptionsCollection instance.
Updated URL behavior to include origin serialization changes.
Added javascript: URL navigation via window.location, evaluating side effects without actually navigating.
event.initEvent() and related methods now provide additional defaults.
Location properties are now own instance properties and are non-configurable.
tokenList.replace() now follows updated edge-case behavior.
XMLHttpRequest now permits redirects after a CORS preflight and changes username/password CORS treatment.
Fixes and other changes 69
The old API no longer throws on invalid file-path input such as typical HTML strings.
Fixed the contentType of Documents created through iframes.
Fixed the contentType of Documents created through document.implementation.createDocument().
Upgraded cssstyle, bringing fixes to the CSS parser and object model.
node.normalize() no longer modifies non-Text nodes.
Fixed the origin of Documents created through document.implementation.createDocument().
sourceEl.srcset now returns the srcset attribute value instead of the cite attribute value.
Fixed the interaction of URL's href and searchParams properties.
XMLHttpRequest now correctly sets the User-Agent header, including on CORS preflight requests.
JPEG quality is now passed through correctly instead of always being passed as zero to node-canvas.
Document cloning now preserves all appropriate state and avoids adding an extra document type node.
Fixed various edge cases in the nodeValue property.
Fixed various edge cases in the textContent property.
AbortSignal abort events now have isTrusted set to true.
data: URL parsing was improved throughout jsdom using the new data-urls package.
Event handlers are now own properties of each Window rather than properties on Window.prototype.
Removing an img element's empty src attribute no longer sometimes raises an exception.
Argument conversions in XMLHttpRequest.open() were corrected.
Restores parsing jsdomError events omitted for style sheet text containing spaces.
Fixed style elements whose sheet property was sometimes null when it should not be.
Fixed style elements retaining a CSSStyleSheet after being removed from the document.
Documents created via new Document() now use UTF-8 encoding.
Various events now fire with correct default values, including MouseEvent properties from element.click().
Event handler properties now behave correctly when assigned non-callable objects.
hashchange events during fragment navigation are now trusted events.
popstate events during fragment navigation are now trusted events.
URL-accepting properties now perform scalar value string conversion and URL resolution correctly.
Fixed validation for file inputs and added validation for more input types.
Fixed xhr.abort() so it clears any set headers.
Fixed radioButton.click() to fire appropriate input and change events.
Fixed line number reporting in exception stack traces for script elements when includeNodeLocations is set.
Implemented appropriate input.value getter and setter behavior for input type=file.
Improved spec compliance so named and indexed properties on element.attributes are retrieved properly.
Fixed SVG selector behavior inside template contents DocumentFragments, including fragments created by JSDOM.fragment().
Fixed SVG selector behavior inside template contents DocumentFragments, including fragments created by JSDOM.fragment().
Responses are now always decoded as UTF-8 when responseType is set to json.
Fixed CORS header handling, especially for preflights and Access-Control-Allow-Headers.
Made DOMException spec-compliant, including its constructor signature.
Fixed FocusEvent creation, which had regressed in the previous release.
The element interface for <td> and <th> is now HTMLTableCellElement with improved specification compliance.
Fixed interactions between inline event handlers and other event listeners.
Updated keyboardEvent.initKeyboardEvent() to match the latest specifications.
Updated mouseEvent.initiMouseEvent() to match the latest specifications.
Fixed the behavior of table.createCaption().
Fixed the behavior of table.deleteRow().
Fixed the behavior of the table.rows getter.
Fixed the behavior of tr.deleteCall().
Fixed the behavior of tr.rowIndex.
Updated uiEvent.initUIEvent() to match the latest specifications.
Improved event handlers, abort(), and network error behavior.
Improved behavior around navigating to URL fragments.
Class matching is now ASCII case-insensitive instead of using JavaScript toLowerCase().
Indexed, id, and name property retrieval is now spec-compliant and live.
Added active checks to prevent reentrancy and improved edge-case spec compliance.
Indexed property retrieval is now spec-compliant and live.
Added active checks to prevent reentrancy.
Elements with id="undefined" no longer shadow the global undefined property.
Improved event handlers, abort(), and network error behavior.
Fixed javascript: URL loading for iframes with proper percent-decoding and error reporting.
Timers no longer start after a window is closed, avoiding errors from unusable objects.
Fixed corrupted XMLHttpRequest responses larger than 1 MiB.
fileReader.abort() now properly terminates ongoing reads.
Upgrading parse5 brings correctness improvements to HTML parsing.
input.select() no longer throws for input types where selection does not apply.
Symbol.toStringTag properties are now non-writable and non-enumerable.
tokenList.remove() now works when its DOMTokenList corresponds to a nonexistent attribute.
xhr.overrideMimeType() no longer throws for invalid input.
xhr.send() now accepts array buffer views as well as ArrayBuffers.
Non-GET requests to data: URLs now work with XMLHttpRequest.
jsdom 1021 changes
Breaking changes 6
Removed prototype toString() methods that returned class-like strings to imitate Symbol.toStringTag behavior.
Setting htmlElement.dir now restricts values to ltr, rtl, or auto.
img elements no longer fire load events unless their image data is actually loaded.
The API for creating and manipulating jsdoms was completely overhauled with more intuitive usage and better defaults.
The omitJsdomErrors option was renamed to omitJSDOMErrors.
Node.js v4 and v5 are no longer supported; Node.js v6 or newer is required.
Security 1
Origin checking is corrected, so callers do not always need to pass an origin of "*".
Deprecations 1
The old API remains available through old-api.js but will not receive new features.
New APIs and options 2
Added the select.selectedOptions property.
document.dir is now available.
Performance 1
XMLHttpRequest now pre-allocates and exponentially grows a 1 MiB buffer to avoid frequent allocation and concatenation.
Behavior and default changes 1
Added value sanitization for password, search, tel, text, color, email, and url input types.
Fixes and other changes 9
Properties intended to return the same object now consistently preserve object identity.
Fixed inheritance of the resources option into iframes.
Fixed inheritance of the runScripts option into iframes.
Added Symbol.toStringTag to all web platform classes, making Object.prototype.toString.call() work as expected on jsdom objects.
Fixed an uncaught exception when xhr.abort() was called during a readystatechange event.
The <a> and <area> APIs now match the latest specification, with several bugs fixed.
Setting innerHTML to an empty string now updates the document instead of doing nothing.
The error message is improved when xhr.open receives too few arguments.
Approved preflight headers are now forwarded to the actual request.
jsdom 9134 changes
Breaking changes 22
HTML elements now expose offsetParent, always returning null.
getClientRects() now returns an empty array instead of a dummy bounding box.
Named access now returns the first matching element encountered instead of the last.
Moved file.lastModified from Blob to File.
Calling stopImmediatePropagation on an already-dispatched event now follows the latest DOM Standard changes.
Calling stopPropagation on an already-dispatched event now follows the latest DOM Standard changes.
The default file.lastModified value is now the current time instead of 0.
Now returns HTMLCollection instead of NodeList and follows the spec algorithms more exactly.
Now returns HTMLCollection instead of NodeList and follows the spec algorithms more exactly.
The minimum tough-cookie version was upgraded to protect installations against a security advisory.
Disabled-element semantics now more closely match the specification, especially for descendants of fieldset disabled.
XML parsing now rejects ill-formed XHTML markup when parsingMode is set to xml.
Constructors exposed as globals on the jsdom window are now non-enumerable.
URL setters now ignore invalid input instead of throwing.
Makes appName more browser-like instead of based on Node.js information.
Removes the noUI navigator property.
Makes platform more browser-like instead of based on Node.js information.
Makes userAgent more browser-like instead of based on Node.js information.
Makes version more browser-like instead of based on Node.js information.
tabIndex now defaults to 0 for focusable elements.
Support for mutation events was removed; mutation observers are not yet supported.
XMLHttpRequest statusText now defaults to an empty string instead of OK.
New APIs and options 43
Supports canvas-prebuilt as an alternative package to canvas.
Adds the Option named constructor.
HTML elements now expose offsetHeight, always returning 0.
HTML elements now expose offsetLeft, always returning 0.
HTML elements now expose offsetTop, always returning 0.
HTML elements now expose offsetWidth, always returning 0.
Elements now expose clientHeight, returning 0.
Elements now expose clientLeft, returning 0.
Elements now expose clientTop, returning 0.
Elements now expose clientWidth, returning 0.
Events now expose the cancelBubble property.
NodeList now supports iteration and key/value/entry access methods.
Elements now expose scrollHeight, returning 0.
Elements now expose scrollWidth, returning 0.
Added CDATASection nodes, including document.createCDATASection.
Added a setter for document.body.
Added node.wholeText.
Added the blob.isClosed property.
Added document.hasFocus() for checking whether the document currently has focus.
addEventListener and removeEventListener now support EventListenerOptions, including once and capture.
HTMLCollection now supports for-of iteration.
Added document.embeds.
Added document.plugins.
Added document.scripts.
Custom request agents can now be passed through the agent option.
Custom request agent classes can now be passed through the agentClass option.
Adds a spec-compliant DOMParser API, except parsed documents always use about:blank instead of the creating document's URL.
Adds window.frameElement, but without appropriate cross-origin security checks.
Adds the public jsdom.evalVMScript API for evaluating VM scripts.
Added the Audio named constructor.
Added an API to override a window's existing URL.
Adds the FocusEvent class and fires focus and blur events appropriately.
Adds the appCodeName navigator property.
Adds the javaEnabled() navigator method.
Adds the language navigator property.
Adds the languages navigator property.
Adds the onLine navigator property.
Adds the product navigator property.
Adds the productSub navigator property.
Adds the vendor navigator property.
Adds the vendorSub navigator property.
Added DOMTokenList.prototype.replace.
XMLHttpRequest gained a responseURL property.
Performance 1
XPath execution is faster.
Behavior and default changes 3
Adds rudimentary processing of XML <!ENTITY declarations.
XMLHttpRequest methods, headers, and header values now use the ByteString algorithm.
Argument validation was removed from DOMTokenList.prototype.contains to match the latest specification.
Fixes and other changes 65
Works correctly when jsdom is browserified.
Works correctly when jsdom is browserified.
Preserves URL fragments across redirects.
Makes optionEl.text more spec-compliant.
Makes optionEl.value more spec-compliant.
Always returns a positive integer instead of 0 on the first call.
Always returns a positive integer instead of 0 on the first call.
Actually stops immediate propagation instead of only stopping propagation.
Edge cases in type conversions for method arguments and setters across implemented web platform APIs were fixed.
Blob, File, and FileReader behavior now better matches the File API specification.
Progress events now match recent specification changes and test updates.
Readystatechange events now match recent specification changes and test updates.
Removed use of array.includes to restore compatibility with Node.js v4.
Fixed removal of event listeners registered with the once option.
document.body now acts more correctly in various edge cases.
Added document.embeds, which had been mistakenly omitted from 9.5.0.
Added document.plugsin, which had been mistakenly omitted from 9.5.0.
Added document.scripts, which had been mistakenly omitted from 9.5.0.
document.title now acts more correctly in various edge cases.
Now works with null or document parent nodes for afterbegin and beforeend insertion positions.
The not implemented virtual console message now occurs only when form submission is not canceled.
Fixed POSTing JSON with Authorization to a CORS endpoint.
Fixed syntax errors so jsdom can run correctly on Node.js v4.
Now splits only on ASCII whitespace instead of all Unicode whitespace.
Now splits only on ASCII whitespace instead of all Unicode whitespace.
Fixed an error when passing no class names to getElementsByClassName, including empty or whitespace-only strings.
file.lastModified now defaults to the File object's creation time.
Non-HTML elements named "iframe" are no longer incorrectly focusable.
Fixed a performance regression when modifying the DOM, especially during initial parsing of documents with many elements.
Focusing something inside an iframe now also focuses the iframe itself.
Cloning Attrs now correctly preserves the namespace prefix.
XMLHttpRequest progress events now have ordering closer to the specification and browsers.
Corrected console.groupCollapse to console.groupCollapsed and updated the virtual console.
Various HTMLCollection-returning getters are now more spec-compliant.
Now respects the agent and agentClass options in addition to agentOptions.
Fixed error events from failed resource loads going missing since v9.4.3.
Removed leftover console.log from the error handling path introduced in v9.4.3.
Fixed spurious jsdomError events when closing a window due to aborted resource loads.
Inline event handlers returning non-boolean values no longer erroneously cancel events.
Cloned input elements now copy their value, checkedness, and dirty flags correctly.
Iframe documents now receive the parent document's URL as their referrer.
External images specified with relative URLs now load when the canvas npm package is installed.
input.checked now has the correct value inside checkbox click events.
Stylesheet link elements now load when their href attributes change while in a document.
Script elements now load when they gain a src attribute while in a document.
Window named properties now correctly resolve iframe elements or iframe windows for name versus id scenarios.
Canceling clicks on submit buttons and labels now prevents form submission and re-dispatches to the relevant form control.
The Image named constructor now follows the specification more closely, including matching HTMLImageElement.prototype.
The tabIndex setter no longer causes errors after regressing in 9.1.0.
Unhandled errors thrown in XHR event handlers are now redirected to the virtual console instead of being swallowed.
Returns the attribute value instead of an empty string for unparseable URLs.
External resources now receive the document's URL as referrer instead of its base URL.
Returns null instead of throwing for elements that do not allow selection.
Returns null instead of throwing for elements that do not allow selection.
Returns null instead of throwing for elements that do not allow selection.
Returns null instead of undefined for out-of-bounds indices.
The URL constructor now correctly throws for unparseable URLs.
Error events are no longer suppressed after the first event.
The proxy option is now applied to all requests.
Fixed response header filtering for cross-origin requests and ProgressEvents fired from those XHRs.
Only focusable elements can be focused.
Resolves formEl.action relative to the document URL, or uses that URL when the attribute is missing or empty.
Invalid CSS no longer crashes parsing and instead emits a jsdomError to the virtual console.
window.close() now correctly clears event listeners on the document.
Fixed validation of the Blob constructor's type option.
jsdom 866 changes
Breaking changes 19
Removed the nonstandard Internet Explorer-only property.
Removed the unimplemented property, which previously crashed when used.
Clicks cannot begin while another click is in progress.
XHTML frames and iframes are parsed as XML instead of HTML.
Created documents now use XML parsing mode, affecting several DOM APIs.
relatedNode is now the new Attr object instead of the Node.
Changed DOMTokenList.toString serialization slightly to match recent spec changes.
Named properties are now lowercase except for specified XML and non-HTML edge cases.
Named properties are now non-enumerable.
tc.headers is now a DOMTokenList reflecting the headers attribute instead of a string.
All jsdom installs now benefit from cssstyle's improved margin parsing and CSSOM behavior.
All jsdom installs now benefit from cssstyle's improved padding parsing and CSSOM behavior.
Removed this minor unimplemented or no-longer-standard DOM Level 3 API.
Removed this minor unimplemented or no-longer-standard DOM Level 3 API.
Removed this minor unimplemented or no-longer-standard DOM Level 3 API.
Nodes are adopted during insertion instead of causing WrongDocumentError exceptions.
Now returns numeric IDs, accepts string arguments to eval, and passes extra arguments after the first two.
Now returns numeric IDs, accepts string arguments to eval, and passes extra arguments after the first two.
Removed this minor unimplemented or no-longer-standard DOM Level 3 API.
Deprecations 1
The proprietary navigator.noUI is superseded by the Page Visibility API and will be removed in v9.0.0.
New APIs and options 14
Added the TreeWalker class and document.createTreeWalker implementation for traversing document trees.
Adds canvasContext.createPattern when the canvas npm package is installed.
Images can be drawn onto canvases when the canvas npm package is installed.
Adds canvasContext.toBlob when the canvas npm package is installed.
Adds the Page Visibility API's document.hidden property, which always returns true.
Adds the Page Visibility API's document.visibilityState property, which always returns prerender.
Adds the document.lastModified property.
Adds the document.origin property.
A top-level strictSSL option governs all requests made by jsdom.
Added a setter for element.classList that forwards to element.classList.value.
Added element.getAttributeNames() for enumerating an element's attribute names.
Added Node.prototype.adoptNode to adopt nodes across documents.
Added a stub matching the existing getBoundingClientRect stub.
Added Element.prototype.insertAdjacentHTML for inserting HTML adjacent to an element.
Performance 1
Parsing speed should improve because URLs are no longer parsed and resolved during parsing.
Behavior and default changes 5
Decodes URL or file bytes using Content-Type, meta charset, or BOM signals, matching browser encoding behavior.
Images load and decode when the canvas package is installed and external img resources are fetched, updating dimensions and firing load or error events.
XMLHttpRequest gains preliminary CORS support.
Labels now proxy clicks to their labeled form elements.
Many properties are now available, with more spec-compliant type conversions and attribute/property reflections; implementation details are hidden behind a single symbol.
Fixes and other changes 26
Accounts for Content-Type, meta charset, and BOM signals when fetching resources through browser-like mechanisms.
Fixed setting proxied inline event handlers for documents without a browsing context.
Setting selected on a multi-select no longer clears all other selectedness.
Fixed issues with generated files in the published package that impacted webpack users.
Fixed minor bugs in URL parsing and the URL API.
Fixed spurious attributes appearing on jsdom nodes when Object.prototype was modified.
Change events now fire appropriately for input clicks.
Input selection methods and properties now distinguish outright-selectable inputs from textual inputs with variable-length selection.
Input events now fire appropriately for input clicks.
Scripts execute only when their MIME type appears on the canonical JavaScript MIME type list.
The scriptEl.text getter and setter now follow the specification.
Corrected the constructor property, which previously incorrectly pointed to Window.
option.index no longer errors for options outside a select.
Can now replace an attribute node without changing its order in the attribute list.
Can now replace an attribute node without changing its order in the attribute list.
tc.cellIndex no longer errors for cells outside a table row.
tr.sectionRowIndex no longer errors for rows outside table sections.
Fixed the this value when passing an object with handleEvent() to addEventListener.
Fixed a typo that prevented HTMLOptionElement.prototype.label from working.
document.activeElement now falls back to the body element when no element is focused or the active element is removed.
Custom user agents now propagate to navigator.userAgent in frames and iframes.
Event handler callbacks now bind this to the event's current target.
Event objects are now always initialized unless created with document.createEvent, including events with an empty name.
Reimplemented according to the latest specs, improving URL resolution and navigation correctness for links and areas.
Iframes now load through the custom resource loader.
Fixed shorthand properties so component properties update and parsing works correctly.
jsdom 762 changes
Breaking changes 12
Attr now follows the latest specification, is no longer a Node subclass, and no longer has child text nodes.
CustomEvent now provides initCustomEvent for initialization.
initProgressEvent was replaced by initCustomEvent on CustomEvent.prototype.
Invalid selectors now throw SyntaxError DOMExceptions instead of Error instances.
Invalid selectors now throw SyntaxError DOMExceptions instead of Error instances.
Invalid selectors now throw SyntaxError DOMExceptions instead of Error instances.
The template content structure no longer includes an extra intermediate document fragment or child nodes.
document.implementation.createDocumentType now requires all three arguments.
Comparing any two doctypes no longer always returns true.
Creating a jsdom document with an invalid URL now throws an error.
Node.js 4.0 or later is now required to run jsdom.
omitJsdomErrors moved from virtual-console creation to the sendTo call.
New APIs and options 24
Adds support for text selection APIs on input and textarea elements.
Almost all supported Event subclasses now have constructors that allow setting supported properties.
KeyboardEvent is now implemented.
TouchEvent is now implemented, although it does not yet have a constructor.
The AT_TARGET event-phase constant is now available.
Blob is now supported by the XMLHttpRequest implementation.
The BUBBLING_PHASE event-phase constant is now available.
The CAPTURING_PHASE event-phase constant is now available.
document.charset is now available as an alias for document.characterSet.
Event.prototype.stopImmediatePropagation is now available.
File is now supported by the XMLHttpRequest implementation.
FileList is now supported by the XMLHttpRequest implementation.
FileReader is now supported by the XMLHttpRequest implementation.
FormData is now supported by the XMLHttpRequest implementation.
HTMLTemplateElement.prototype.content now exposes a template's contents as a document fragment.
The agentOptions option adds new request-management control.
The pool option adds new request-management control.
The userAgent option adds new request-management control.
The NONE event-phase constant is now available.
ProgressEvent is now supported by the XMLHttpRequest implementation.
Resource loads can now be aborted.
Synchronous XMLHttpRequests are now supported.
XMLHttpRequestEventTarget is now supported as part of the XMLHttpRequest implementation.
XMLHttpRequestUpload is now supported as part of the XMLHttpRequest implementation.
Behavior and default changes 3
postMessage tasks now use jsdom's timer queue, making them easier to mock.
Uses sax as the default XML parser, fixing many XML and XHTML parsing issues.
XMLHttpRequest and related classes were completely re-implemented with more complete, standards-compliant behavior.
Fixes and other changes 23
Fixed canvasEl.toDataURL() argument handling when the canvas npm package is installed.
Fixed data: URL parsing to allow empty contents, such as data:text/css;base64,.
Fixed a regression when parsing attributes with a namespace URL but no prefix.
Canvas contents now reset when width or height changes, including changes from the default dimensions.
Fixes doctype parsing that confused the system ID and public ID.
Fixes HTMLCollections containing elements with numeric id or name values.
document.writeln now correctly handles multiple arguments instead of ignoring all arguments after the first.
FileList objects no longer contain a property named "undefined".
Unresolvable iframe URLs now load about:blank instead of crashing jsdom, matching spec behavior.
Creating a customevent now correctly returns a CustomEvent instead of an Event.
The Event class hierarchy now has more complete functionality and correct public APIs.
EventTarget now follows the specification exactly, improving edge-case behavior.
Browser builds can again fetch URLs for content and similar uses.
Template parsing and serialization now make innerHTML work as specified.
appendChild now validates its arguments more correctly.
insertBefore now validates its arguments more correctly.
replaceChild now validates its arguments more correctly.
Template parsing and serialization now make outerHTML work as specified.
Fixed RegExp literals inside jsdom script code so instanceof RegExp returns true.
Comparing two elements with attributes no longer throws an error.
Loose cookie parsing now correctly handles assignments such as document.cookie = "foo".
document.styleSheets now correctly tracks stylesheet removal from the document.
The created callback now receives the same window object as the loaded and done callbacks when scripting is enabled.
jsdom 659 changes
Breaking changes 13
Now splits class arguments on whitespace, requires all classes, returns an HTMLCollection, and memoizes the result to match the specification.
Now matches the specification and no longer inherits from NodeList.
The href getter now applies spec-compliant fallbacks and always returns an absolute URL.
Removed the vestigial HTMLIsIndexElement global property.
sendTo(console) now forwards jsdomError events to console.error by default.
Nodes no longer expose the nonstandard errors array.
hashchange now emits HashChangeEvent instances with correctly named newURL and oldURL properties.
io.js 2.0 or newer is now required because jsdom uses ES2015 features.
The done callback now receives one error object instead of an array of errors.
The load(errors, window) callback is replaced by onload(window), reflecting window.onload behavior.
Callers may need to pass file: URLs where filenames previously worked.
Nodes no longer expose the raise method used to add entries to the errors array.
jsdom no longer uses setimmediate, removing its eval-based incompatibility with CSP scenarios.
New APIs and options 26
Allows cookie as either a top-level option or nested under document.
Allows referrer as either a top-level option or nested under document.
Allows cookie as either a top-level option or nested under document.
Allows referrer as either a top-level option or nested under document.
Adds iteration support so developers can use for-of loops with NodeLists.
Adds the element that initiated a resource load, enabling customization based on the loading element.
Adds an API to retrieve the source-text location of a given node.
Allows changing a window's top property.
Implemented HTMLAudioElement in full, while its HTMLMediaElement base remains largely a stub.
Added a complete implementation of HTMLDataElement.
Added a stub implementation of HTMLDataListElement.
Added a stub implementation of HTMLDialogElement.
Added a stub implementation of HTMLEmbedElement.
Added appropriate constants to HTMLMediaElement.
Added a stub implementation of HTMLMeterElement.
Added a complete implementation of HTMLSpanElement.
Added a complete implementation of HTMLTimeElement.
Added a property returning the node's owner document base URL.
Added a fully spec-compliant implementation of window.atob.
Added a fully spec-compliant implementation of window.btoa.
Added a full-featured, spec-compliant classList implementation.
Added an option to disable forwarding jsdomError events when using sendTo(console).
Added a basic implementation of HTMLMediaElement for use in jsdom.
Added a basic implementation of HTMLVideoElement for use in jsdom.
A new ErrorEvent class is available as part of script error handling.
XMLHttpRequest.prototype.response is now available as a getter.
Behavior and default changes 7
Canvas elements now expose a uniform spec-compliant API with or without the canvas package installed.
Updated HTMLTableCellElement to the latest specification.
Updated HTMLTableDataCellElement to the latest specification.
Updated HTMLTableHeaderCellElement to the latest specification.
Updated HTMLTableRowElement to the latest specification.
Updated HTMLTableSectionElement to the latest specification.
The url option is now resolved as a URL before installation as document.URL, including a trailing slash for host-only URLs.
Fixes and other changes 13
An about:blank iframe without base elements now falls back to the parent window's base URL.
Canvas elements now have the correct HTMLCanvasElement and HTMLElement instanceof relationships when the canvas package is installed.
The height property now reflects the height attribute and defaults to 150.
The width property now reflects the width attribute and defaults to 300.
Canvas elements now work better with other jsdom APIs when the canvas package is installed, including document.getElementById.
The DOMSubtreeModified event now fires in more cases, though mutation events remain incomplete.
Fixed errors when parsing invalid doctype declarations such as <!DOCTYPE>.
Stopped emitting spurious jsdomError events after window.close().
No longer crashes when used with file: URLs.
Correctly returns response text when responseType is unset.
StyleSheetList.prototype.item now works correctly.
The browser vm shim now adds built-in global properties to the sandbox, fixing scripts run in web workers.
window.onerror and error event listeners now catch all script errors, similarly to browsers.
jsdom 551 changes
Breaking changes 12
DOM attribute handling now follows the specification more closely, including updated NamedNodeMap, Element methods, and style attribute behavior.
Removed the erroneously added mapDOMNodes function from window.
Removed the erroneously added mapper function from window.
Removed the erroneously added visitTree function from window.
The setter now converts null to the cookie value "null" instead of ignoring it.
Calling document.write on XML documents now throws as required by the specification.
The setter now converts undefined to the string "undefined" instead of ignoring it.
XML documents no longer receive an automatically inserted HTML document structure when created without arguments.
Added an API for creating cookie jars that can be shared among multiple jsdom documents.
Added cookieJar configuration for supplying shared cookie jars to jsdom documents.
Removed cookieDomain configuration from jsdom document creation.
Removed the jar option from jsdom document creation configuration.
New APIs and options 10
Added support for communicating between parent windows, iframes, and combinations thereof, with some origin and structured-cloning semantics still missing.
Added nextElementSibling to Element and the various types of CharacterData.
Added previousElementSibling to Element and the various types of CharacterData.
A factory creates virtual consoles that can be installed before document creation to catch initialization events.
Document creation methods accept a virtual console before creation, allowing virtual console events during initialization to be caught.
Implemented the childElementCount property through the ParentNode mixin.
Implemented the firstElementChild property through the ParentNode mixin.
Implemented the lastElementChild property through the ParentNode mixin.
Implemented the outerHTML setter, allowing developers to assign serialized markup.
Added support for the NodeIterator class from the DOM Standard.
Behavior and default changes 7
Attrs can no longer be cloned according to the latest specification, although cloneNode remains for legacy reasons.
StyleSheetList now inherits from Array, matching the latest CSSOM specification.
Elements with id or certain name attributes now create named properties and global variables on window, improving script compatibility.
Node.js now fails fast with a clear error message to avoid confusion from syntax errors.
Cookie handling is delegated to tough-cookie, bringing additional previously missing cookie behaviors.
Descendant iframes automatically share cookie jars, allowing same-domain iframes to access appropriate cookies.
document.cookie now accepts arrays, allowing multiple cookies to be set at once.
Fixes and other changes 22
Stops createAttributeNS from accidentally creating a global attribute variable.
CSS properties using url("quoted string") now parse correctly.
Selectors matching the empty string, such as div[title=""], now work correctly.
Clicking submit buttons now submits their containing form, matching input type=submit behavior.
The type property of button elements now defaults to submit and remains within the allowed range.
Elements with unusual tag names that only the parser normally creates can now be cloned.
Doctypes can now be cloned in accordance with the latest specification.
Cloned documents now correctly preserve their URL and content-type.
document.open() now returns the document itself as required by the specification.
Virtual console output from iframes is now proxied to the parent window's virtual console.
Invalid values assigned to el.style.cssText or the style attribute are ignored instead of throwing an error.
License metadata now conforms to the latest npm standards.
Restored compatibility with browserify after a regression introduced in v5.4.0.
Fixed getElementById for img elements whose id attributes were modified.
The virtualConsole option now works with jsdom.env as well as jsdom.jsdom.
The default HTML stylesheet is now applied, making computed styles more accurate and allowing jQuery show() and hide() methods to work correctly.
Fixed relative stylesheet resolution when using @import.
Fixed outerHTML getter results for select and form elements.
Fixed incorrect results and failures in documents created without a window.
The initial request now shares its cookie jar with subsequent requests, avoiding possible EventEmitter memory leak warnings.
document.write now accepts multiple arguments and concatenates them.
Calling document.write with an empty string no longer attempts to insert a default HTML document structure.
jsdom 432 changes
Breaking changes 7
Removed an unnecessary browserify dependency that was erroneously included in 4.5.0.
Unknown elements now create HTMLUnknownElement instances instead of HTMLElement instances.
document.createEvent accepts more argument types and throws for invalid arguments according to the DOM Standard.
The native Contextify dependency was eliminated, making jsdom easier to install without a C++ compiler toolchain.
The non-standard document.parentWindow property was removed; use the standard document.defaultView instead.
jsdom no longer works with Node.js; applications must use io.js or remain on the 3.x series.
Window instances no longer implicitly share parser- and serializer-related state.
New APIs and options 7
Adds document.currentScript for accessing the currently executing script element.
Event instances now expose whether preventDefault() has been called.
MouseEvent now accepts a second parameter, behaving the same as Event's second parameter for now.
MutationEvent now accepts a second parameter, behaving the same as Event's second parameter for now.
UIEvent now accepts a second parameter, behaving the same as Event's second parameter for now.
The Event constructor now accepts a second parameter to set bubbles and cancelable properties.
DOMException provides a more comprehensive set of constants.
Performance 1
Window creation is approximately 600% faster when no scripts are executed.
Behavior and default changes 5
The click() method is now defined on HTMLElement.prototype instead of HTMLInputElement.prototype, matching the latest spec.
The click() method now dispatches a MouseEvent instead of a generic Event.
DOMException instances now have name properties.
Some Window data properties became accessors for improved specification compliance.
Window methods moved from the prototype to each instance for improved specification compliance.
Fixes and other changes 12
Dispatching click events now activates radio buttons and checkboxes, matching the behavior of el.click().
Fixed named and indexed window properties and window.length when frames or iframes are added or removed.
Doctype parsing now relies on information provided by the HTML parser when possible.
Fixed cases where childNodes was not correctly up to date.
EventTarget handlers now execute in FIFO order, as required by the specification.
Chrome 40 is supported again; latest stable Firefox and IE versions should also work, though less well-tested.
Events created with new Event("click") can now be dispatched.
EventTarget is now correctly in the prototype chain of Window.
EventTarget argument validation now follows the DOM Standard.
Node.prototype.contains now always returns a boolean, correcting a regression introduced in 3.1.1.
Document.prototype now correctly delegates its ownerDocument getter to Node.prototype.
Fixed edge cases when running scripts in browserified jsdom.
jsdom 338 changes
Breaking changes 16
Removed isSameNode because it is not part of the DOM Standard and only performed a verbose strict-equality check.
CDATA sections were removed from the DOM APIs.
Default attributes were removed from the DOM APIs.
Documents now default to about:blank instead of inferring a file URL or using location.href.
DocumentType now follows the DOM Standard and no longer includes notations, entities, or default attributes.
Accessors on Node, Element, Attr, and Document were corrected to match the specification; some nonstandard setters were removed.
Removed the non-standard addFeature method from DOMImplementation.
DOMImplementation.hasFeature now always returns true.
Removed the ownerDocument property from DOMImplementation.
Removed the non-standard removeFeature method from DOMImplementation.
Entities were removed from the DOM APIs.
Entity types were removed from the DOM APIs.
3.0.x is the last jsdom release supporting Node.js; future releases will require io.js.
Notations were removed from the DOM APIs.
console.error no longer contributes to the non-standard window.errors array.
XML and HTML documents now differ more accurately in tag-name and attribute casing.
New APIs and options 2
Adds the named Image(width, height) constructor.
A virtual console abstraction captures console output from inside the page.
Performance 1
Some properties moved to Document.prototype and Window.prototype, improving memory usage and specification compliance.
Behavior and default changes 6
Comment now follows the DOM Standard and derives from CharacterData.
document.contentType is now generally inferred from the document parsing mode.
Name and qualified-name validation now uses xml-name-validator and centralized algorithms.
The XML parser now has limited awareness of processing instructions.
ProcessingInstruction now follows the DOM Standard and derives from CharacterData.
Text now follows the DOM Standard and derives from CharacterData.
Fixes and other changes 13
URL resolution now handles about:blank properly on all systems, including the default URL since 3.0.0.
Scripts can now run at least partially inside a browserified jsdom instance through dynamic global reference rewriting.
Calling window.alert no longer crashes applications in cases handled by the NOT_IMPLEMENTED helper.
Triggering NOT_IMPLEMENTED methods such as window.location.reload no longer leaks a global variable.
Scripts generally do not work well in browserified jsdom, despite fixes to browserifying issues around jsdom.env.
Updated isEqualNode to the DOM Standard algorithm, fixing an error thrown during comparison.
Unchecking a radio button no longer incorrectly unchecks radio buttons outside its containing form.
Empty HTML strings passed through the html option are now handled.
Null bytes passed to autodetecting capabilities are now handled.
Serialization errors for text nodes were fixed, including cases possibly occurring inside template elements.
CharacterData now follows DOM Standard algorithms, removing some exceptions previously thrown.
Doctype parsing and association with documents were cleaned up, improving handling of exotic doctypes.
Fixes an exception when querySelector receives selectors such as div:last-child > span[title].
jsdom 24 changes
Breaking changes 3
Replaced the nonstandard matchesSelector method with the standard matches method.
Removed the level option from jsdom.jsdom.
Removed the defunct jsdom.level public API in favor of the living standard model.
Fixes and other changes 1
querySelector now correctly coerces its argument to a string.
jsdom 141 changes
Breaking changes 5
div.toString() now returns [object HTMLDivElement].
Separate cssstyle-browserify dependency is no longer required; cssstyle can be used directly.
Returns true when the default is not prevented, correcting the previous opposite behavior.
The nonstandard document.innerHTML API was removed.
The nonstandard EventTarget.getListeners API was removed.
New APIs and options 4
Adds missing console methods; most currently do nothing, while assert is implemented.
The textLength property now exists on HTMLTextAreaElement.
Adds NodeFilter, including its constants.
Adds document.implementation.createHTMLDocument() for creating HTML documents.
Performance 5
Makes childNodes and the many places in jsdom that use it much faster.
Faster implementation should speed up common operations like appendChild and similar.
Performance improved for several AttributeList methods, reducing the cost of attribute operations.
Performance improved for Node.prototype.insertBefore, reducing the cost of this DOM mutation method.
Performance improved for Node.prototype.removeChild, reducing the cost of this DOM mutation method.
Behavior and default changes 4
blur is now available on HTMLElement.prototype instead of only certain element prototypes.
focus is now available on HTMLElement.prototype instead of only certain element prototypes.
cssstyle is no longer pinned, allowing future upstream fixes to arrive automatically.
In browsers, options.url now defaults to location.href instead of an inferred fil:// URL.
Fixes and other changes 23
document.cloneNode now works.
Resetting a form now follows the specification for all form element types.
hasAttribute is now case-insensitive as required by the specification.
The checked property now behaves according to the specification.
The defaultChecked property now behaves according to the specification.
The value property now behaves according to the specification.
The selected property now behaves according to the specification.
The value property now behaves according to the specification.
Resetting radio buttons now correctly resets the other radio buttons according to the specification.
Checks whether module.parent exists before constructing a document's initial URL, compensating for testing frameworks that do not correctly emulate the module environment.
Changing attributes on option elements now produces the correct consequences, including correct document.getElementById interaction when changing id.
The text-node data setter now correctly coerces assigned values to strings.
document.toString() now returns the standard HTMLDocument object string.
Arguments are now correctly coerced to strings, allowing arrays to be passed.
Parsing and serialization of <template> elements now work correctly because parse5 supports them.
The initial history.length is now 1 instead of 0.
history.pushState no longer fires the popstate event.
history.replaceState no longer fires the popstate event.
Ensures localName is no longer null for elements when it should not be.
Browserifying jsdom should work better because required packages are now declared as dependencies.
The dependency is temporarily pinned to version 0.2.18 or earlier to avoid a known CSSStyleDeclaration issue.
The defaultValue property is now correctly synced to the value="" attribute.
The value property is now correctly synced to the value="" attribute.
jsdom 0.1114 changes
Breaking changes 3
Attributes reflected as properties now return '' when absent, while getAttribute still returns null.
DOCTYPE names are no longer uppercased during parsing.
DOCTYPEs now appear in the output of document.innerHTML.
New APIs and options 4
Adds Node.prototype.parentElement for accessing a node's parent element.
navigator.cookieEnabled is now implemented and always returns true.
Various document position constants were added to the Node constructor.
Node.prototype.contains is now implemented.
Behavior and default changes 1
A new default level focuses jsdom on the DOM Living Standard and HTML Living Standard, enabling more modern DOM and HTML features.
Fixes and other changes 6
Corrects the default URL used by jsdom.jQueryify to load jQuery.
Makes textContent work for nodes without children, including text nodes.
DocumentType.prototype.parentNode now returns the document node instead of null.
A bug involving invalid script paths and jsdom.jQueryify was fixed.
Various navigator properties are now getters instead of data properties.
Node.prototype.compareDocumentPosition is now implemented correctly.
jsdom 0.1016 changes
Breaking changes 2
Serializing void elements no longer includes a space-slash, producing <br> instead of <br />.
window.location.port now defaults to an empty string instead of null.
New APIs and options 4
Remaining URL properties are now available on HTMLAnchorElement.
Remaining URL properties are now available on window.location.
Added querySelector to DocumentFragments.
Added querySelectorAll to DocumentFragments.
Behavior and default changes 3
Defaults should usually be the empty string instead of null.
Defaults should usually be the empty string instead of null.
document.cookie now supports multiple cookies, though options like path and max-age remain ignored.
Fixes and other changes 7
Iframes correctly load about:blank when the src attribute is empty or missing.
Reflected attributes no longer break when String.prototype.normalize is available by default in newer Node versions.
Documents containing only whitespace now generate wrapper documents, matching blank documents.
The list of void elements now matches the latest HTML specification.
Fixed another case where jQuery 1.11's show method caused errors.
Using jQuery 1.11's show() method no longer throws an error.
window.location properties now update correctly after pushState or replaceState.
jsdom 0.97 changes
Breaking changes 2
An empty namespace URI is now treated as meaning no namespace.
HTMLInputElement no longer has a type attribute by default, while its type property remains "text".
New APIs and options 2
HTMLAnchorElement gains a port property.
HTMLAnchorElement gains a protocol property.
Behavior and default changes 1
Attribute ordering now follows WHATWG DOM semantics, with more accurate attribute storage behavior.
Fixes and other changes 2
An empty namespace URI is now treated as meaning no namespace.
An empty namespace URI is now treated as meaning no namespace.
jsdom 0.822 changes
New APIs and options 10
Cookies are stored and used between requests, with customizable cookie jars supported.
Adds a hash property to HTMLAnchorElement.
CSS now supports the @-moz-document at-rule.
Adds the host property to HTMLAnchorElement.
Adds a dummy method returning 0 for all rectangle properties.
Adds an href property to CSSStyleSheet instances for external CSS files.
Typed array constructors are now available on window.
Basic history navigation and state methods are now supported.
Adds a property that evaluates to true for specifically distinguishing jsdom in tests.
Adds working XMLHttpRequest support, including cookie passing.
Behavior and default changes 2
CSS now supports many shorthand properties.
Documents beginning with an XML declaration are parsed as XML without lowercasing tags.
Fixes and other changes 10
Attributes named like NamedNodeMap prototype properties no longer break jsdom.
Calling removeAttributeNS on a missing attribute no longer throws.
CSS unit handling is improved.
Stops accidentally modifying Error.prototype.
querySelector is now placed on Element and Document prototypes instead of being an own-property.
querySelectorAll is now placed on Element and Document prototypes instead of being an own-property.
Auto-detection of whether the first parameter is an HTML string or filename now handles long strings without erroring.
Tag names passed to createElement are coerced to strings before evaluation.
Fixed a casing issue that prevented jsdom from loading on Unix and Solaris systems.
Fixed the broken window.location.replace behavior.
jsdom 0.79 changes
Breaking changes 1
The html property no longer uses the previous string auto-detection behavior, making this a breaking change.
New APIs and options 3
hashchange events now fire when the URL hash changes.
The file property provides an explicit way to specify file input.
The url property provides an explicit way to specify URL input.
Behavior and default changes 1
window.location is now more complete and accurate, including hashchange events when the hash changes.
Fixes and other changes 4
Errors raised in scripts are now passed to jsdom.env's callback.
String input detection is more accurate, changing how jsdom.env interprets passed strings.
Errors for unsupported features now identify exactly which feature is not implemented.
window.location.href is set correctly when constructing a window from a URL that redirects.
jsdom 0.615 changes
Breaking changes 1
Empty attributes now expose an empty string value instead of the attribute name.
New APIs and options 1
Frames and iframes are now accessible through named properties.
Behavior and default changes 2
Attribute names may now use any value permitted by HTML5, including characters such as ^.
Attribute values may now use any value permitted by HTML5, including > and <.
Fixes and other changes 11
Custom attributes named like Object.prototype properties no longer confuse jsdom.
CSS selectors containing commas inside quotes are no longer misinterpreted.
img elements now fire load events when their src attributes change.
Improves automatic detection of URLs versus HTML fragments when using jsdom.env.
node-canvas integration is fixed after being broken since version 0.5.7.
URL resolution now handles document URLs, base tags, and relative hrefs more browser-compatibly, affecting external resources and href/src accuracy.
The code is now parseable with Esprima, improving compatibility with Esprima-based tooling.
The package metadata now uses repository instead of repositories to prevent npm warnings.
The innerHTML of script tags no longer loses its first character.
Multiline attributes are no longer mangled during parsing.
Elements with optional closing tags, such as p or td, are now parsed correctly.
jsdom 0.519 changes
Breaking changes 1
This release and future releases require at least Node.js 0.8.
Deprecations 1
This release remains compatible with Node.js 0.6; future releases will require at least Node.js 0.8.
New APIs and options 1
The parser can now be configured through jsdom.env.
Fixes and other changes 16
canvas behaves like a div when node-canvas is unavailable instead of causing a crash.
Event handlers now support return false and receive the event argument more spec-compatibly.
The textContent getter is more accurate for comment nodes and processing instruction nodes.
HTMLCollections now expose named properties for members' id and name attributes, enabling access such as form.elements.inputId.
Event handler properties now update correctly through setAttributeNode, attributeNode.value =, removeAttribute, and removeAttributeNode.
Corrected the property when the attribute value is falsy, such as an empty attribute value.
Corrected the property when the attribute value is falsy, such as an empty attribute value.
Accessing rowIndex for table rows outside a table no longer throws.
Image src properties now resolve relative to location.href, matching anchor href behavior.
getAttributeNS now returns null for absent attributes, matching getAttribute.
Stylesheets containing @-webkit-keyframes no longer crash getComputedStyle calls.
The features option is handled correctly by jsdom.env.
Radio buttons now allow only one checked button, and clicking one no longer incorrectly unchecks it.
Calling click on input elements now fires a click event.
selectedIndex now changes correctly when option elements are selected, making select elements work properly, especially with jQuery.
Makes contextify a non-optional dependency because jsdom never worked without it.
jsdom 0.47 changes
Breaking changes 3
getAttribute now returns null for attributes that are not present, matching DOM4 behavior.
Nonstandard NodeList properties such as toArray are now hidden unless prefixed with an underscore.
NodeList instances no longer provide array methods, including indexOf, matching the specification.
Performance 1
The querySelectorAll implementation was adjusted for improved accuracy and speed.
Behavior and default changes 1
Static NodeList-returning methods such as querySelectorAll now return a real NodeList instance.
Fixes and other changes 2
selected now returns true for the first <option> in a <select> when nothing is explicitly set.
Loading HTML files no longer crashes when an <a> tag lacks an href attribute.
jsdom 0.313 changes
Breaking changes 2
A window's load event now always fires asynchronously, including when no external resources are needed.
Turning off mutation events is no longer supported because it breaks external-resource fetching.
New APIs and options 3
Adds a basic blur() implementation on appropriate elements.
Adds a basic focus() implementation on appropriate elements.
Adds the matchesSelector API through nwmatcher.
Behavior and default changes 1
Styles from style and linked stylesheet elements are now applied to getComputedStyle results.
Fixes and other changes 7
Stylesheets with @media rules no longer crash calls to getComputedStyle, including those in jQuery initialization.
document.write calls now insert new elements correctly.
Inputs without a type attribute now return "text" from getAttribute.
Stylesheets with comma-separated selectors now apply when using getComputedStyle.
Prevents crashes when stylesheets contain invalid selectors.
Script filenames containing spaces now work when passed to jsdom.env.
A real querySelector implementation solves many outstanding querySelector bugs.
jsdom 0.2116 changes
Breaking changes 18
attr is no longer placed in the global scope when using node-canvas.
cssText is no longer as accurate after reverting use of the cssstyle package.
style is no longer as accurate after reverting use of the cssstyle package.
HTMLOptionElement.text now returns the option's text rather than its value.
The name property is now exposed only on specific tags and accurately reflects the corresponding name attribute.
Falsy values assigned to text nodes are converted to strings instead of becoming empty strings.
outerHTML is no longer formatted, which is especially important for pre elements.
Text instances no longer expose a value property.
Exceptions occurring in the callback are no longer swallowed.
Single tags now serialize with a space before the closing slash.
Disabling external script processing also prevents inline event handlers from running.
The trigger name changes to raise for a more descriptive API.
removeAttributeNS no longer returns a value.
The method now returns only elements attached to the document.
Attr.specified is now readonly.
download now receives the object returned by URL.parse() as its first parameter.
setAttributeNS() no longer returns a value.
setNamedItem no longer sets Node.parentNode.
Security 1
Script loading over HTTPS is fixed.
New APIs and options 24
Adds SkipExternalResources, which accepts a regular expression for skipping external resources.
Anchor elements gain a hostname property to comply with the WHATWG standard.
HTTP proxy support is added to jsdom.env.
Anchor elements gain a pathname property to comply with the WHATWG standard.
Adds JSONP support.
Support was added for document.cookie.
Encoding and decoding support was added for all HTML entities from HTML4 and HTML5.
A document configuration option allows users to change the document referer.
jsdom.env() now accepts the same features object used by jsdom.jsdom and related APIs.
Support was added for reading window.location.search.
Initial support for reading and using the URL fragment through window.location.hash.
Inline event handlers such as onclick are supported.
Initial CSSOM integration was added.
DOM level configuration now accepts a string or object.
removeEventListener() was added to DOMWindow.
The download() function now supports an HTTP referrer.
HTML serialization can optionally pretty print while traversing the tree.
The encoding of the jsdom.env HTML request can now be set.
HTTP request headers can now be configured for jsdom.env.
jsdom.env now supports a src configuration option.
A DOM level can now be selected using a level number and feature string.
NodeList#indexOf was added.
window.stopTimers() was introduced as an initial attempt to fix a memory leak.
XPath support was added.
Performance 1
Runtime performance received a major boost.
Behavior and default changes 6
Elements may now have non-unique ids.
Scripts injected by jsdom receive a jsdom class during serialization.
The selector engine was upgraded from sizzle 1.0 to a version roughly equivalent to 1.5.1.
Error reports now include stacktraces, giving developers more diagnostic context.
Invalid markup is reported as an error and attached to the associated element and document.
Scheme-less URLs now default to the current protocol.
Fixes and other changes 66
URL resolution now works correctly on pages containing href-less <base> tags.
cssText is accurate again after cssstyle fixed its memory problems.
style properties are accurate again after cssstyle fixed its memory problems.
Out-of-memory errors caused by cssstyle on some larger real-world pages were fixed.
Checkbox and radiobutton checked state now correctly reflects the checked attribute.
CSS style declarations now provide more accurate cssText and style properties on all elements.
The level3/xpath functionality is now included correctly.
jsdom no longer breaks when String.prototype.normalize is provided by libraries such as sugar.js.
Doctypes are no longer set as the documentElement.
HTML entities are decoded in text only when outside script and style tags.
Single-selection HTMLSelectElement instances now report type as select-one instead of select.
config.html now handles file paths containing spaces.
QuerySelector is isolated from the prototype.
Setting textContent to an empty string clears children.
Contextify simulation now works using vm.runInContext.
Removes an unused style property that caused explosions in 0.2.12 and Node 0.4.7.
The npm package no longer includes gmon.out, v8.log, or tests, reducing unnecessary distributed files.
contexify is now optional, so projects may no longer need it installed as a required dependency.
NamedNodeMap items can now be accessed via properties.
toArray and item are now non-enumerable properties on NodeList objects.
Using the :not() selector with querySelector no longer throws a ReferenceError.
Attribute event handlers on the bubbling path are now called.
DocumentFeatures now handles iframes without a src attribute.
CSSOM constructors are exposed on the dom object.
Script tag content is no longer escaped.
Assigning markup to textarea.value no longer parses it.
Fixes appendHtmlToElement behavior with the HTML5 parser.
Prevents double loading when scripts and src properties are mixed.
Fixes a bug involving the src property.
Features are properly reset after a jsdom.env invocation.
NodeList properties now enumerate like arrays.
Fixes a ReferenceError in the scanForImportRules helper function.
Fixes setting a script element's text property.
Downloaded file paths now include the URL search component.
Inline event handlers are ignored in every context except the JavaScript context.
Fixed stylesheet loading so stylesheets load correctly for developers using jsdom.
Different jsdom levels can now be used in the same process.
Mutation events for DOMAttrModified receive fixes, improving attribute-change event behavior.
Special characters are serialized like a grade A browser in element attributes.
Special characters are serialized like a grade A browser when reading or writing innerHTML.
Events now bubble up to the window object.
Changing the id attribute's nodeValue now updates the element's id.
Calling insertBefore with the same node for both parameters now does nothing.
Adding a script to an invalid or incomplete DOM now catches the error and passes it to the .env callback.
A crash is fixed when setChild fails to create a new DOM element.
Using style.setProperty now updates the style attribute.
Prevents segfaults caused by window being garbage collected prematurely; developers must manually close the window to free memory.
Parsing incomplete DOCTYPE declarations no longer causes a JavaScript error.
document.parentWindow now equals window.
Frames and iframes load and process scripts when the parent has the features enabled.
NodeLists can now have a length of 0.
Style serialization issues were fixed.
toArray now returns an empty array when given an empty NodeList.
Missing body and html tags are now inserted automatically.
Every document now has either a body or a frameset.
Doctype serialization now handles newlines correctly.
getListeners() now returns a shallow copy, allowing listeners to be safely removed during dispatch.
HTMLDecode now correctly decodes common named entities.
JavaScript errors are triggered on the script element instead of the document.
Empty scripts no longer cause jsdom.env to hang.
Node and Exception type constants are now available in all levels.
The defaultSelected field of option elements was corrected.
The selected field of option elements was corrected.
Relative and absolute URLs now work as expected.
resourceLoader.download now handles HTTPS and redirects correctly.
The title node now uses textContent, and the getter walks the DOM to extract text correctly.